![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|
GwyGraphCurveModelGwyGraphCurveModel — Representation of one graph curve |
GwyGraphCurveModel; GwyGraphCurveModelClass; #define gwy_graph_curve_model_duplicate (gcmodel) GwyGraphCurveModel* gwy_graph_curve_model_new (void); void gwy_graph_curve_model_set_data (GwyGraphCurveModel *gcmodel, const gdouble *xdata, const gdouble *ydata, gint n); void gwy_graph_curve_model_set_data_from_dataline (GwyGraphCurveModel *gcmodel, GwyDataLine *dline, gint from_index, gint to_index); void gwy_graph_curve_model_set_description (GwyGraphCurveModel *gcmodel, const gchar *description); void gwy_graph_curve_model_set_curve_type (GwyGraphCurveModel *gcmodel, GwyGraphCurveType type); void gwy_graph_curve_model_set_curve_point_type (GwyGraphCurveModel *gcmodel, GwyGraphPointType point_type); void gwy_graph_curve_model_set_curve_point_size (GwyGraphCurveModel *gcmodel, gint point_size); void gwy_graph_curve_model_set_curve_line_style (GwyGraphCurveModel *gcmodel, GdkLineStyle line_style); void gwy_graph_curve_model_set_curve_line_size (GwyGraphCurveModel *gcmodel, gint line_size); void gwy_graph_curve_model_set_curve_color (GwyGraphCurveModel *gcmodel, const GwyRGBA *color); const gdouble* gwy_graph_curve_model_get_xdata (GwyGraphCurveModel *gcmodel); const gdouble* gwy_graph_curve_model_get_ydata (GwyGraphCurveModel *gcmodel); gint gwy_graph_curve_model_get_ndata (GwyGraphCurveModel *gcmodel); const gchar* gwy_graph_curve_model_get_description (GwyGraphCurveModel *gcmodel); GwyGraphCurveType gwy_graph_curve_model_get_curve_type (GwyGraphCurveModel *gcmodel); GwyGraphPointType gwy_graph_curve_model_get_curve_point_type (GwyGraphCurveModel *gcmodel); gint gwy_graph_curve_model_get_curve_point_size (GwyGraphCurveModel *gcmodel); GdkLineStyle gwy_graph_curve_model_get_curve_line_style (GwyGraphCurveModel *gcmodel); gint gwy_graph_curve_model_get_curve_line_size (GwyGraphCurveModel *gcmodel); GwyRGBA* gwy_graph_curve_model_get_curve_color (GwyGraphCurveModel *gcmodel); void gwy_graph_curve_model_signal_layout_changed (GwyGraphCurveModel *model);
"curve-type" GwyGraphCurveType : Read / Write "description" gchararray : Read / Write "line-size" gint : Read / Write "line-style" GdkLineStyle : Read / Write "point-size" gint : Read / Write "point-type" GwyGraphPointType : Read / Write
"layout-updated" void user_function (GwyGraphCurveModel *gwygraphcurvemodel, gpointer user_data);
GwyGraphCurveModel represents information about a graph curve necessary to fully reconstruct it.
typedef struct { GObjectClass parent_class; void (*layout_updated)(GwyGraphCurveModel *model); gpointer reserved1; gpointer reserved2; gpointer reserved3; } GwyGraphCurveModelClass;
#define gwy_graph_curve_model_duplicate(gcmodel)
Convenience macro doing gwy_serializable_duplicate() with all the necessary typecasting.
gcmodel : | A graph curve model to duplicate. |
GwyGraphCurveModel* gwy_graph_curve_model_new (void);
Creates a new graph curve model.
Returns : | New empty graph curve model as a GObject. |
void gwy_graph_curve_model_set_data (GwyGraphCurveModel *gcmodel, const gdouble *xdata, const gdouble *ydata, gint n);
Sets curve model data. Curve model will make a copy of the data, so you are responsible for freeing the original arrays.
gcmodel : | A GwyGraphCurveModel. |
xdata : | x data points (array of size n) |
ydata : | y data points (array of size n) |
n : | data array size (number of data points) |
void gwy_graph_curve_model_set_data_from_dataline (GwyGraphCurveModel *gcmodel, GwyDataLine *dline, gint from_index, gint to_index);
Sets the curve data from GwyDataLine. The range of import can be modified using parameters from_index and to_index that are interpreted directly as data indices within the GwyDataLine. In the case that from_index == to_index, the full GwyDataLine is used.
gcmodel : | A GwyGraphCurveModel. |
dline : | A GwyDataLine |
from_index : | index where to start |
to_index : | where to stop |
void gwy_graph_curve_model_set_description (GwyGraphCurveModel *gcmodel, const gchar *description);
Sets curve model description. The description should appear on graph label, for example. description is duplicated.
gcmodel : | A GwyGraphCurveModel. |
description : | curve description text |
void gwy_graph_curve_model_set_curve_type (GwyGraphCurveModel *gcmodel, GwyGraphCurveType type);
Sets curve type for plotting the curve (e. g. points, lines, points & lines, etc.).
gcmodel : | A GwyGraphCurveModel. |
type : | curve type |
void gwy_graph_curve_model_set_curve_point_type (GwyGraphCurveModel *gcmodel, GwyGraphPointType point_type);
Sets curve point type for plotting the curve. Curve type that is chosen must include some kind of point plot to see any change (e. g. GWY_GRAPH_CURVE_POINTS).
gcmodel : | A GwyGraphCurveModel. |
point_type : | point type to be used for plot |
void gwy_graph_curve_model_set_curve_point_size (GwyGraphCurveModel *gcmodel, gint point_size);
Sets curve point size for plotting the curve. Curve type that is chosen must include some kind of point plot to see any change (e. g. GWY_GRAPH_CURVE_POINTS).
gcmodel : | A GwyGraphCurveModel. |
point_size : | point size to be used for plot (in pixels) |
void gwy_graph_curve_model_set_curve_line_style (GwyGraphCurveModel *gcmodel, GdkLineStyle line_style);
Sets curve line style for plotting the curve. Curve type that is chosen must include some kind of line plot to see any change (e. g. GWY_GRAPH_CURVE_LINE).
gcmodel : | A GwyGraphCurveModel. |
line_style : | line style to be used for plot |
void gwy_graph_curve_model_set_curve_line_size (GwyGraphCurveModel *gcmodel, gint line_size);
Sets curve line size (thickness). Curve type that is chosen must include some kind of line plot to see any change (e. g. GWY_GRAPH_CURVE_LINE).
gcmodel : | A GwyGraphCurveModel. |
line_size : | line size to be used for plot (in pixels) |
void gwy_graph_curve_model_set_curve_color (GwyGraphCurveModel *gcmodel, const GwyRGBA *color);
Sets the curve color.
gcmodel : | A GwyGraphCurveModel. |
color : | Color to use for this curve (both line and symbols). color is duplicated. |
const gdouble* gwy_graph_curve_model_get_xdata (GwyGraphCurveModel *gcmodel);
Gets pointer to x data points. Data are used within the graph and cannot be freed.
gcmodel : | A GwyGraphCurveModel. |
Returns : | x data points |
const gdouble* gwy_graph_curve_model_get_ydata (GwyGraphCurveModel *gcmodel);
Gets pointer to y data points. Data are used within the graph and cannot be freed.
gcmodel : | A GwyGraphCurveModel. |
Returns : | y data points |
gint gwy_graph_curve_model_get_ndata (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | number of data points within the curve data |
const gchar* gwy_graph_curve_model_get_description (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | Curve data description (what appears as curve label on graph) as a string owned by curve (do not free). |
GwyGraphCurveType gwy_graph_curve_model_get_curve_type (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | curve plot type (e. g. points, lines, points & lines, etc.) |
GwyGraphPointType gwy_graph_curve_model_get_curve_point_type (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | curve plot point type (square, circle, etc.) |
gint gwy_graph_curve_model_get_curve_point_size (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | curve plot point size (in pixels) |
GdkLineStyle gwy_graph_curve_model_get_curve_line_style (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | curve plot line style |
gint gwy_graph_curve_model_get_curve_line_size (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | curve plot line size (in pixels) |
GwyRGBA* gwy_graph_curve_model_get_curve_color (GwyGraphCurveModel *gcmodel);
gcmodel : | A GwyGraphCurveModel. |
Returns : | curve color structure (directly used by curve model, do not free it after use). |
void gwy_graph_curve_model_signal_layout_changed (GwyGraphCurveModel *model);
Emits signal that something general in curve layout (plotting style) was changed. Graph widget or other widgets connected to graph model object should react somehow.
model : | A GwyGraphCurveModel. |
"curve-type" GwyGraphCurveType : Read / Write
Changed curve type.
Default value: GWY_GRAPH_CURVE_LINE
"description" gchararray : Read / Write
Changed curve description.
Default value: "curve"
"line-size" gint : Read / Write
Changed curve line size.
Allowed values: [0,100]
Default value: 1
"line-style" GdkLineStyle : Read / Write
Changed curve line style.
Default value: GDK_LINE_SOLID
"point-size" gint : Read / Write
Changed curve point size.
Allowed values: [0,100]
Default value: 5
"point-type" GwyGraphPointType : Read / Write
Changed curve point type.
Default value: GWY_GRAPH_POINT_SQUARE
void user_function (GwyGraphCurveModel *gwygraphcurvemodel, gpointer user_data);
gwygraphcurvemodel : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<< GwyGraphModel | GwyGraphArea >> |