GwyGraphCurveModel

GwyGraphCurveModel — Representation of a one graph curve.

Synopsis




            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,
                                             gdouble *xdata,
                                             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,
                                             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,
                                             GwyRGBA color);
gdouble*    gwy_graph_curve_model_get_xdata (GwyGraphCurveModel *gcmodel);
gdouble*    gwy_graph_curve_model_get_ydata (GwyGraphCurveModel *gcmodel);
gint        gwy_graph_curve_model_get_ndata (GwyGraphCurveModel *gcmodel);
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);

Object Hierarchy


  GObject
   +----GwyGraphCurveModel

Implemented Interfaces

GwyGraphCurveModel implements GwySerializable and GwyWatchable.

Description

GwyGraphCurveModel represents information about a graph curve necessary to fully reconstruct it. It will be meaningfully used by the new generation of graph widgets and should be mostly ignored for now.

Details

GwyGraphCurveModel

typedef struct _GwyGraphCurveModel GwyGraphCurveModel;


GwyGraphCurveModelClass

typedef struct {
    GObjectClass parent_class;

    gpointer reserved1;
    gpointer reserved2;
    gpointer reserved3;
} GwyGraphCurveModelClass;


gwy_graph_curve_model_duplicate()

#define     gwy_graph_curve_model_duplicate(gcmodel)

gcmodel :

gwy_graph_curve_model_new ()

GwyGraphCurveModel* gwy_graph_curve_model_new
                                            (void);

Creates a new graph curve model.

With current generation of graph widgets it is useless without gwy_graph_curve_model_save_curve().

Returns : New empty graph curve model as a GObject.

gwy_graph_curve_model_set_data ()

void        gwy_graph_curve_model_set_data  (GwyGraphCurveModel *gcmodel,
                                             gdouble *xdata,
                                             gdouble *ydata,
                                             gint n);

Sets curve model data. Curve model does not make a copy of the data, therefore you should not free the data unless you know what are you doing.

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)

gwy_graph_curve_model_set_data_from_dataline ()

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 case that from_index == to_index full GwyDataLine is used.

gcmodel : A GwyGraphCurveModel.
dline : A GwyDataLine
from_index : index where to start
to_index : where to stop

gwy_graph_curve_model_set_description ()

void        gwy_graph_curve_model_set_description
                                            (GwyGraphCurveModel *gcmodel,
                                             gchar *description);

Sets curve model description. The description should appear on graph label, for example.

gcmodel : A GwyGraphCurveModel.
description : curve description text

gwy_graph_curve_model_set_curve_type ()

void        gwy_graph_curve_model_set_curve_type
                                            (GwyGraphCurveModel *gcmodel,
                                             GwyGraphCurveType type);

Sets curve type for plotting the curve. This includes setting points, linespoints, line, etc.

gcmodel : A GwyGraphCurveModel.
type : curve type

gwy_graph_curve_model_set_curve_point_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

gwy_graph_curve_model_set_curve_point_size ()

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)

gwy_graph_curve_model_set_curve_line_style ()

void        gwy_graph_curve_model_set_curve_line_style
                                            (GwyGraphCurveModel *gcmodel,
                                             GdkLineStyle line_style);

gcmodel :
line_style :

gwy_graph_curve_model_set_curve_line_size ()

void        gwy_graph_curve_model_set_curve_line_size
                                            (GwyGraphCurveModel *gcmodel,
                                             gint line_size);

gcmodel :
line_size :

gwy_graph_curve_model_set_curve_color ()

void        gwy_graph_curve_model_set_curve_color
                                            (GwyGraphCurveModel *gcmodel,
                                             GwyRGBA color);

Sets the curve color.

gcmodel : A GwyGraphCurveModel.
color : GwyRGBA color structure (will not be directly used)

gwy_graph_curve_model_get_xdata ()

gdouble*    gwy_graph_curve_model_get_xdata (GwyGraphCurveModel *gcmodel);

Gets pointer to x data points. The data might be used somewhere within the curve or graph model or graph widget, so do no free them until you don't know what are you doing.

gcmodel : A GwyGraphCurveModel.
Returns : x data points

gwy_graph_curve_model_get_ydata ()

gdouble*    gwy_graph_curve_model_get_ydata (GwyGraphCurveModel *gcmodel);

Gets pointer to y data points. The data might be used somewhere within the curve or graph model or graph widget, so do no free them until you don't know what are you doing.

gcmodel : A GwyGraphCurveModel.
Returns : y data points

gwy_graph_curve_model_get_ndata ()

gint        gwy_graph_curve_model_get_ndata (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : number of data points within the curve data

gwy_graph_curve_model_get_description ()

gchar*      gwy_graph_curve_model_get_description
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve data description (what appears as curve label on graph) as newly allocated string.

gwy_graph_curve_model_get_curve_type ()

GwyGraphCurveType gwy_graph_curve_model_get_curve_type
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve plot type (as points, lines, linespoints, etc.)

gwy_graph_curve_model_get_curve_point_type ()

GwyGraphPointType gwy_graph_curve_model_get_curve_point_type
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve plot point type (square, circle, etc.)

gwy_graph_curve_model_get_curve_point_size ()

gint        gwy_graph_curve_model_get_curve_point_size
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve plot point size (in pixels)

gwy_graph_curve_model_get_curve_line_style ()

GdkLineStyle gwy_graph_curve_model_get_curve_line_style
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve plot line style

gwy_graph_curve_model_get_curve_line_size ()

gint        gwy_graph_curve_model_get_curve_line_size
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve plot line size (in pixels)

gwy_graph_curve_model_get_curve_color ()

GwyRGBA*    gwy_graph_curve_model_get_curve_color
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A GwyGraphCurveModel.
Returns : curve color structure (directly used by curve model, not free it after use).