GwyGraphCurveModel

GwyGraphCurveModel — Representation of 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,
                                             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_mode  (GwyGraphCurveModel *gcmodel,
                                             GwyGraphCurveType mode);
void        gwy_graph_curve_model_set_point_type
                                            (GwyGraphCurveModel *gcmodel,
                                             GwyGraphPointType point_type);
void        gwy_graph_curve_model_set_point_size
                                            (GwyGraphCurveModel *gcmodel,
                                             gint point_size);
void        gwy_graph_curve_model_set_line_style
                                            (GwyGraphCurveModel *gcmodel,
                                             GdkLineStyle line_style);
void        gwy_graph_curve_model_set_line_size
                                            (GwyGraphCurveModel *gcmodel,
                                             gint line_size);
void        gwy_graph_curve_model_set_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_mode
                                            (GwyGraphCurveModel *gcmodel);
GwyGraphPointType gwy_graph_curve_model_get_point_type
                                            (GwyGraphCurveModel *gcmodel);
gint        gwy_graph_curve_model_get_point_size
                                            (GwyGraphCurveModel *gcmodel);
GdkLineStyle gwy_graph_curve_model_get_line_style
                                            (GwyGraphCurveModel *gcmodel);
gint        gwy_graph_curve_model_get_line_size
                                            (GwyGraphCurveModel *gcmodel);
const GwyRGBA* gwy_graph_curve_model_get_color
                                            (GwyGraphCurveModel *gcmodel);

Object Hierarchy


  GObject
   +----GwyGraphCurveModel

Implemented Interfaces

GwyGraphCurveModel implements GwySerializable.

Properties


  "color"                GwyRGBA               : Read / Write
  "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

Signals


"data-changed"
            void        user_function      (GwyGraphCurveModel *gwygraphcurvemodel,
                                            gpointer            user_data)               : Run first

Description

GwyGraphCurveModel represents information about a graph curve necessary to fully reconstruct it.

Details

GwyGraphCurveModel

typedef struct _GwyGraphCurveModel GwyGraphCurveModel;


GwyGraphCurveModelClass

typedef struct {
    GObjectClass parent_class;

    void (*data_changed)(GwyGraphCurveModel *model);

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


gwy_graph_curve_model_duplicate()

#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.

gwy_graph_curve_model_new ()

GwyGraphCurveModel* gwy_graph_curve_model_new
                                            (void);

Creates a new graph curve model.

Returns : New empty graph curve model as a GObject.

gwy_graph_curve_model_set_data ()

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 graph curve model.
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 the case that from_index == to_index, the full GwyDataLine is used.

gcmodel : A graph curve model.
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,
                                             const gchar *description);

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

gcmodel : A graph curve model.
description : curve description text

gwy_graph_curve_model_set_mode ()

void        gwy_graph_curve_model_set_mode  (GwyGraphCurveModel *gcmodel,
                                             GwyGraphCurveType mode);

Sets curve type for plotting the curve (e. g. points, lines, points & lines, etc.).

gcmodel : A graph curve model.
mode : Curve mode.

gwy_graph_curve_model_set_point_type ()

void        gwy_graph_curve_model_set_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 graph curve model.
point_type : point type to be used for plot

gwy_graph_curve_model_set_point_size ()

void        gwy_graph_curve_model_set_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 graph curve model.
point_size : point size to be used for plot (in pixels)

gwy_graph_curve_model_set_line_style ()

void        gwy_graph_curve_model_set_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 graph curve model.
line_style : line style to be used for plot

gwy_graph_curve_model_set_line_size ()

void        gwy_graph_curve_model_set_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 graph curve model.
line_size : line size to be used for plot (in pixels)

gwy_graph_curve_model_set_color ()

void        gwy_graph_curve_model_set_color (GwyGraphCurveModel *gcmodel,
                                             const GwyRGBA *color);

Sets the color of a graph curve.

gcmodel : A graph curve model.
color : Color to use for this curve (both line and symbols).

gwy_graph_curve_model_get_xdata ()

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 graph curve model.
Returns : x data points

gwy_graph_curve_model_get_ydata ()

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 graph curve model.
Returns : y data points

gwy_graph_curve_model_get_ndata ()

gint        gwy_graph_curve_model_get_ndata (GwyGraphCurveModel *gcmodel);

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

gwy_graph_curve_model_get_description ()

const gchar* gwy_graph_curve_model_get_description
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A graph curve model.
Returns : Curve data description (what appears as curve label on graph) as a string owned by curve (do not free).

gwy_graph_curve_model_get_mode ()

GwyGraphCurveType gwy_graph_curve_model_get_mode
                                            (GwyGraphCurveModel *gcmodel);

Gets the current plot mode of a graph curve.

gcmodel : A graph curve model.
Returns : Curve plot mode (e. g. points, lines, points & lines, etc.).

gwy_graph_curve_model_get_point_type ()

GwyGraphPointType gwy_graph_curve_model_get_point_type
                                            (GwyGraphCurveModel *gcmodel);

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

gwy_graph_curve_model_get_point_size ()

gint        gwy_graph_curve_model_get_point_size
                                            (GwyGraphCurveModel *gcmodel);

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

gwy_graph_curve_model_get_line_style ()

GdkLineStyle gwy_graph_curve_model_get_line_style
                                            (GwyGraphCurveModel *gcmodel);

gcmodel : A graph curve model.
Returns : curve plot line style

gwy_graph_curve_model_get_line_size ()

gint        gwy_graph_curve_model_get_line_size
                                            (GwyGraphCurveModel *gcmodel);

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

gwy_graph_curve_model_get_color ()

const GwyRGBA* gwy_graph_curve_model_get_color
                                            (GwyGraphCurveModel *gcmodel);

Gets the color of a graph curve model.

gcmodel : A graph curve model.
Returns : Curve color (onwed by curve model, do not free nor modify).

Property Details

The "color" property

  "color"                GwyRGBA               : Read / Write

Curve color.


The "curve-type" property

  "curve-type"           GwyGraphCurveType     : Read / Write

Curve plotting mode (line, points, ...).

Default value: GWY_GRAPH_CURVE_LINE


The "description" property

  "description"          gchararray            : Read / Write

Curve description.

Default value: "curve"


The "line-size" property

  "line-size"            gint                  : Read / Write

Curve line size.

Allowed values: [0,100]

Default value: 1


The "line-style" property

  "line-style"           GdkLineStyle          : Read / Write

Curve line style.

Default value: GDK_LINE_SOLID


The "point-size" property

  "point-size"           gint                  : Read / Write

Curve point size.

Allowed values: [0,100]

Default value: 5


The "point-type" property

  "point-type"           GwyGraphPointType     : Read / Write

Curve point type.

Default value: GWY_GRAPH_POINT_SQUARE

Signal Details

The "data-changed" signal

void        user_function                  (GwyGraphCurveModel *gwygraphcurvemodel,
                                            gpointer            user_data)               : Run first

The ::data-changed signal is emitted whenever curve data is set with a function like gwy_graph_curve_model_set_data().

gwygraphcurvemodel : The GwyGraphCurveModel which received the signal.
user_data : user data set when the signal handler was connected.