![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|
GwyGraphModelGwyGraphModel — Representation of a graph |
GwyGraphModel; GwyGraphModelClass; #define gwy_graph_model_duplicate (gmodel) GwyGraphModel* gwy_graph_model_new (void); GwyGraphModel* gwy_graph_model_new_alike (GwyGraphModel *gmodel); gint gwy_graph_model_get_n_curves (GwyGraphModel *gmodel); void gwy_graph_model_add_curve (GwyGraphModel *gmodel, GwyGraphCurveModel *curve); gint gwy_graph_model_remove_curve_by_description (GwyGraphModel *gmodel, const gchar *description); void gwy_graph_model_remove_curve_by_index (GwyGraphModel *gmodel, gint cindex); GwyGraphCurveModel* gwy_graph_model_get_curve_by_description (GwyGraphModel *gmodel, const gchar *description); GwyGraphCurveModel* gwy_graph_model_get_curve_by_index (GwyGraphModel *gmodel, gint cindex); void gwy_graph_model_remove_all_curves (GwyGraphModel *gmodel); void gwy_graph_model_set_title (GwyGraphModel *model, const gchar *title); void gwy_graph_model_set_label_position (GwyGraphModel *model, GwyGraphLabelPosition position); void gwy_graph_model_set_label_has_frame (GwyGraphModel *model, gboolean label_has_frame); void gwy_graph_model_set_label_frame_thickness (GwyGraphModel *model, gint thickness); void gwy_graph_model_set_label_reverse (GwyGraphModel *model, gboolean reverse); void gwy_graph_model_set_label_visible (GwyGraphModel *model, gboolean visible); void gwy_graph_model_set_si_unit_x (GwyGraphModel *model, GwySIUnit *siunit); void gwy_graph_model_set_si_unit_y (GwyGraphModel *model, GwySIUnit *siunit); void gwy_graph_model_set_units_from_data_line (GwyGraphModel *model, GwyDataLine *data_line); const gchar* gwy_graph_model_get_title (GwyGraphModel *model); GwyGraphLabelPosition gwy_graph_model_get_label_position (GwyGraphModel *model); gboolean gwy_graph_model_get_label_has_frame (GwyGraphModel *model); gint gwy_graph_model_get_label_frame_thickness (GwyGraphModel *model); gboolean gwy_graph_model_get_label_reverse (GwyGraphModel *model); gboolean gwy_graph_model_get_label_visible (GwyGraphModel *model); GwySIUnit* gwy_graph_model_get_si_unit_x (GwyGraphModel *model); GwySIUnit* gwy_graph_model_get_si_unit_y (GwyGraphModel *model); GString* gwy_graph_model_export_ascii (GwyGraphModel *model, const gchar *filename, gboolean export_units, gboolean export_labels, gboolean export_metadata, GwyGraphModelExportStyle export_style, GString *string); void gwy_graph_model_signal_layout_changed (GwyGraphModel *model); void gwy_graph_model_set_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction, gboolean is_logarithmic); gboolean gwy_graph_model_get_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction); gboolean gwy_graph_model_x_data_can_be_logarithmed (GwyGraphModel *model); gboolean gwy_graph_model_y_data_can_be_logarithmed (GwyGraphModel *model);
"layout-updated" void user_function (GwyGraphModel *gwygraphmodel, gpointer user_data);
typedef struct { GObjectClass parent_class; void (*layout_updated)(GwyGraphModel *gmodel); gpointer reserved2; gpointer reserved3; gpointer reserved4; gpointer reserved5; } GwyGraphModelClass;
#define gwy_graph_model_duplicate(gmodel)
Convenience macro doing gwy_serializable_duplicate() with all the necessary typecasting.
gmodel : | A graph model to duplicate. |
GwyGraphModel* gwy_graph_model_new (void);
Creates a new graph model.
Returns : | New graph model as a GObject. |
GwyGraphModel* gwy_graph_model_new_alike (GwyGraphModel *gmodel);
Creates new graph model object that has the same settings as gmodel. This includes axis/label visibility, actual plotting range, etc. Curves are not duplicated or referenced.
gmodel : | A GwyGraphModel. |
Returns : | New graph model. |
gint gwy_graph_model_get_n_curves (GwyGraphModel *gmodel);
gmodel : | A GwyGraphModel. |
Returns : | number of curves in graph model. |
void gwy_graph_model_add_curve (GwyGraphModel *gmodel, GwyGraphCurveModel *curve);
Adds a new curve to the model. All the curve parameters should be specified within the curve structure.
gmodel : | A GwyGraphModel. |
curve : | A GwyGraphCurveModel representing the curve to add. |
gint gwy_graph_model_remove_curve_by_description (GwyGraphModel *gmodel, const gchar *description);
Removes all the curves having same description string as description.
gmodel : | A GwyGraphModel. |
description : | curve description (label) |
Returns : | The number of removed curves. |
void gwy_graph_model_remove_curve_by_index (GwyGraphModel *gmodel, gint cindex);
Removes the curve having given index.
gmodel : | A GwyGraphModel. |
cindex : | Curve index in graph model. |
GwyGraphCurveModel* gwy_graph_model_get_curve_by_description (GwyGraphModel *gmodel, const gchar *description);
gmodel : | A GwyGraphModel. |
description : | curve description (label) |
Returns : | First curve that has description (label) given by description. Do not free the curve model, it is associated with graph model. |
GwyGraphCurveModel* gwy_graph_model_get_curve_by_index (GwyGraphModel *gmodel, gint cindex);
gmodel : | A GwyGraphModel. |
cindex : | Curve index in graph model. |
Returns : | Curve with given index. Do not free the curve model. It's associated with the graph model. |
void gwy_graph_model_remove_all_curves (GwyGraphModel *gmodel);
Removes all the curves from graph model
gmodel : | A GwyGraphModel. |
void gwy_graph_model_set_title (GwyGraphModel *model, const gchar *title);
Sets new title for the graph model. title is duplicated.
model : | A GwyGraphModel. |
title : | A new graphmodel title. |
void gwy_graph_model_set_label_position (GwyGraphModel *model, GwyGraphLabelPosition position);
Sets label (curve desriptions) postion on graph widget.
model : | A GwyGraphModel. |
position : | A new graphmodel label position. |
void gwy_graph_model_set_label_has_frame (GwyGraphModel *model, gboolean label_has_frame);
Sets whether graph label widget should have a frame around it. Note that the label must be visible (see #gwy_graph_model_set_label_visible()) to see label.
model : | A GwyGraphModel. |
label_has_frame : | label frame mode. |
void gwy_graph_model_set_label_frame_thickness (GwyGraphModel *model, gint thickness);
Sets the label frame thickness. Note that both the frame and label must be visible (see #gwy_graph_model_set_label_visible()) to see label and label frame.
model : | A GwyGraphModel. |
thickness : | Label frame thickness (in pixels). |
void gwy_graph_model_set_label_reverse (GwyGraphModel *model, gboolean reverse);
Sets the label alignment (curve samples and their description postion). By setting the reverse = TRUE you get alignment ("text", "sample"), otherwise you get alignment ("sample", "text").
model : | A GwyGraphModel. |
reverse : | Label alingment mode. |
void gwy_graph_model_set_label_visible (GwyGraphModel *model, gboolean visible);
Sets the graph widget label visibility.
model : | A GwyGraphModel. |
visible : | Label visibility. |
void gwy_graph_model_set_si_unit_x (GwyGraphModel *model, GwySIUnit *siunit);
Sets the physical unit for graph x axis. The unit is duplicated, so you are responsible for freeing siunit.
model : | A GwyGraphModel. |
siunit : | physical unit for x axis |
void gwy_graph_model_set_si_unit_y (GwyGraphModel *model, GwySIUnit *siunit);
Sets the physical unit for graph y axis. The unit is duplicated, so you are responsible for freeing siunit.
model : | A GwyGraphModel. |
siunit : | physical unit for y axis |
void gwy_graph_model_set_units_from_data_line (GwyGraphModel *model, GwyDataLine *data_line);
Sets x and y graph model units to match a data line.
model : | A graph model. |
data_line : | A data line to take units from. |
const gchar* gwy_graph_model_get_title (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | graph title. |
GwyGraphLabelPosition gwy_graph_model_get_label_position (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | graph widget label position. |
gboolean gwy_graph_model_get_label_has_frame (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | graph widget label frame visibility. |
gint gwy_graph_model_get_label_frame_thickness (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | graph widget label frame thickness. |
gboolean gwy_graph_model_get_label_reverse (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | graph widget label alignment mode. |
gboolean gwy_graph_model_get_label_visible (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | graph widget label visibility. |
GwySIUnit* gwy_graph_model_get_si_unit_x (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | A GwySIUnit containing the physical unit of the x-axis of model. (Do not free). |
GwySIUnit* gwy_graph_model_get_si_unit_y (GwyGraphModel *model);
model : | A GwyGraphModel. |
Returns : | A GwySIUnit containing the physical unit of the y-axis of model. (Do not free). |
GString* gwy_graph_model_export_ascii (GwyGraphModel *model, const gchar *filename, gboolean export_units, gboolean export_labels, gboolean export_metadata, GwyGraphModelExportStyle export_style, GString *string);
Exports graph model into a file. The export format is specified by parameter export_style.
model : | A GwyGraphModel. |
filename : | name of file to be created |
export_units : | export units in the column header |
export_labels : | export labels in the column header |
export_metadata : | export all graph metadata within file header |
export_style : | specifies the file format to export to (e. g. plain, csv, gnuplot, etc.) |
string : | |
Returns : |
void gwy_graph_model_signal_layout_changed (GwyGraphModel *model);
Emits signal that something general in graph layout (label settings) was changed. Graph widget or other widgets connected to graph model object should react somehow.
model : | A GwyGraphModel. |
void gwy_graph_model_set_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction, gboolean is_logarithmic);
Sets data along the axis specified by direction to display either logarithmically (is_logarithmic=TRUE) or normally (is_logarithmic=FALSE).
model : | a GwyGraphModel. |
direction : | axis orientation (e. g. horizontal, vertical). |
is_logarithmic : | the logarithmic mode |
gboolean gwy_graph_model_get_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction);
model : | a GwyGraphModel. |
direction : | axis orientation (e. g. horizontal, vertical). |
Returns : | TRUE if the axis specified by direction is currently set to display logarithmically. FALSE if it is set to display normally. |
gboolean gwy_graph_model_x_data_can_be_logarithmed (GwyGraphModel *model);
model : | a GwyGraphModel. |
Returns : | TRUE if all x-values are greater than zero (thus logarithmic display of x-data is safe). |
gboolean gwy_graph_model_y_data_can_be_logarithmed (GwyGraphModel *model);
model : | a GwyGraphModel. |
Returns : | TRUE if all y-values are greater than zero (thus logarithmic display of y-data is safe). |
"n" gint : Read
Changed number of curves in graph.
Allowed values: [0,100]
Default value: 0
"title" gchararray : Read / Write
Changed title of graph.
Default value: "new graph"
void user_function (GwyGraphModel *gwygraphmodel, gpointer user_data);
gwygraphmodel : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<< GwyGraphWindow | GwyGraphCurveModel >> |