![]() | ![]() | ![]() | Gwyddion Widgets Library Reference Manual | ![]() |
---|
GwyGraphArea — Layout for drawing graph curves.
typedef GwyGraphAreaCurvePoints; enum GwyGraphStatusType; typedef GwyGraphDataPoint; typedef GwyGraphScrPoint; typedef GwyGraphStatus_CursorData; typedef GwyGraphStatus_SelData; typedef GwyGraphStatus_PointsData; typedef GwyGraphStatus_ZoomData; typedef GwyGraphAreaCurve; typedef GwyGraphAreaParams; struct GwyGraphArea; struct GwyGraphAreaClass; GtkWidget* gwy_graph_area_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment); void gwy_graph_area_set_style (GwyGraphArea *area, GwyGraphAreaParams style); void gwy_graph_area_set_boundaries (GwyGraphArea *area, gdouble x_min, gdouble x_max, gdouble y_min, gdouble y_max); void gwy_graph_area_add_curve (GwyGraphArea *area, GwyGraphAreaCurve *curve); void gwy_graph_area_clear (GwyGraphArea *area); void gwy_graph_area_signal_selected (GwyGraphArea *area); void gwy_graph_area_signal_zoomed (GwyGraphArea *area);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkLayout +----GwyGraphArea
GwyGraphArea implements AtkImplementorIface.
"selected" void user_function (GwyGraphArea *gwygrapharea, gpointer user_data); "zoomed" void user_function (GwyGraphArea *gwygrapharea, gpointer user_data);
This widget is a part of GwyGraph widget. It is recommended to use it within the GwyGraph widget, however, it can be used separately. It plots a set of data curves with a given plot properties.
typedef struct { gdouble *xvals; /*screen coordinates of points*/ gdouble *yvals; /*screen coordinates of points*/ gint N; /*number of points*/ } GwyGraphAreaCurvePoints;
typedef enum { GWY_GRAPH_STATUS_PLAIN = 0, GWY_GRAPH_STATUS_CURSOR = 1, GWY_GRAPH_STATUS_XSEL = 2, GWY_GRAPH_STATUS_YSEL = 3, GWY_GRAPH_STATUS_POINTS = 4, GWY_GRAPH_STATUS_ZOOM = 5 } GwyGraphStatusType;
typedef struct { gdouble x; gdouble y; char *x_unit; char *y_unit; } GwyGraphDataPoint;
typedef struct { GwyGraphScrPoint scr_point; GwyGraphDataPoint data_point; } GwyGraphStatus_CursorData;
typedef struct { gint scr_start; gint scr_end; gdouble data_start; gdouble data_end; } GwyGraphStatus_SelData;
typedef struct { GwyGraphScrPoint actual_scr_point; GwyGraphDataPoint actual_data_point; GArray *scr_points; GArray *data_points; gint n; } GwyGraphStatus_PointsData;
typedef struct { gint x; gint y; gint width; gint height; gdouble xmin; gdouble xmax; gdouble ymin; gdouble ymax; } GwyGraphStatus_ZoomData;
typedef struct { GwyGraphAreaCurvePoints data; /*original data including its size*/ GwyGraphAreaCurveParams params; /*parameters of plot*/ GdkPoint *points; /*points to be directly plotted*/ gpointer reserved; } GwyGraphAreaCurve;
struct GwyGraphAreaClass { GtkLayoutClass parent_class; GdkCursor *cross_cursor; GdkCursor *arrow_cursor; void (*selected)(GwyGraphArea *area); void (*zoomed)(GwyGraphArea *area); gpointer reserved1; gpointer reserved2; };
GtkWidget* gwy_graph_area_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment);
hadjustment: | |
vadjustment: | |
Returns : |
void gwy_graph_area_set_style (GwyGraphArea *area, GwyGraphAreaParams style);
area: | |
style: |
void gwy_graph_area_set_boundaries (GwyGraphArea *area, gdouble x_min, gdouble x_max, gdouble y_min, gdouble y_max);
Sets the boudaries of graph area and calls for recomputation of actual curve screen representation and its redrawing. used for example by zoom to change curve screen representation.
area: | graph area |
x_min: | x minimum |
x_max: | x maximum |
y_min: | y minimim |
y_max: | y maximum |
void gwy_graph_area_add_curve (GwyGraphArea *area, GwyGraphAreaCurve *curve);
Adds a curve to graph. Adds the curve data values, but the recomputation of actual screen points representing curve must be called after setting the boundaries of the graph area (and complete graph).
area: | graph area |
curve: | curve to be added |
void gwy_graph_area_clear (GwyGraphArea *area);
clear graph area
area: | graph area |
void gwy_graph_area_signal_selected (GwyGraphArea *area);
emit signal that something was selected by mouse. "Something" depends on the actual graph status (points, horizontal selection, etc.).
area: | graph area |
void gwy_graph_area_signal_zoomed (GwyGraphArea *area);
emit signal that user finished drawing zoom rectangle by mouse.
area: | graph area |
void user_function (GwyGraphArea *gwygrapharea, gpointer user_data);
gwygrapharea: | the object which received the signal. |
user_data: | user data set when the signal handler was connected. |
void user_function (GwyGraphArea *gwygrapharea, gpointer user_data);
gwygrapharea: | the object which received the signal. |
user_data: | user data set when the signal handler was connected. |
<< GwyAxis | GwyGraphCorner >> |