gtk_curveWidget

gtk_curveWidget — A specialised curve widget to draw distance distribution for pairs.

Synopsis

                    VisuUiCurveFrame;
                    VisuUiCurveFrameClass;
enum                VisuUiCurveFrameStyle;
void                visu_ui_curve_frame_addData         (VisuUiCurveFrame *curve,
                                                         const gchar *eleName,
                                                         const gchar *lkName,
                                                         const guint *data,
                                                         guint nSteps,
                                                         float init,
                                                         float step);
void                visu_ui_curve_frame_draw            (VisuUiCurveFrame *curve);
gboolean            visu_ui_curve_frame_getHighlightRange
                                                        (VisuUiCurveFrame *curve,
                                                         float range[2]);
float               visu_ui_curve_frame_getIntegralInRange
                                                        (VisuUiCurveFrame *curve,
                                                         gchar **label);
float               visu_ui_curve_frame_getMeanInRange  (VisuUiCurveFrame *curve,
                                                         gchar **label);
void                visu_ui_curve_frame_getSpan         (VisuUiCurveFrame *curve,
                                                         float span[2]);
gboolean            visu_ui_curve_frame_hasData         (VisuUiCurveFrame *curve);
GtkWidget *         visu_ui_curve_frame_new             (float distMin,
                                                         float distMax);
void                visu_ui_curve_frame_setData         (VisuUiCurveFrame *curve,
                                                         float step,
                                                         float min,
                                                         float max);
gboolean            visu_ui_curve_frame_setFilter       (VisuUiCurveFrame *curve,
                                                         const gchar *filter);
gboolean            visu_ui_curve_frame_setHighlightRange
                                                        (VisuUiCurveFrame *curve,
                                                         float range[2]);
void                visu_ui_curve_frame_setNNodes       (VisuUiCurveFrame *curve,
                                                         const gchar *ele,
                                                         guint n);
gboolean            visu_ui_curve_frame_setSpan         (VisuUiCurveFrame *curve,
                                                         float span[2]);
gboolean            visu_ui_curve_frame_setStyle        (VisuUiCurveFrame *curve,
                                                         VisuUiCurveFrameStyle style);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkDrawingArea
                     +----VisuUiCurveFrame

Implemented Interfaces

VisuUiCurveFrame implements AtkImplementorIface and GtkBuildable.

Description

This is a psecialised widget to display g(r) information.

Details

VisuUiCurveFrame

typedef struct _VisuUiCurveFrame VisuUiCurveFrame;

An opaque structure defining a VisuUiCurveFrame widget.

Since 3.6


VisuUiCurveFrameClass

typedef struct _VisuUiCurveFrameClass VisuUiCurveFrameClass;

An opaque structure defining the class of a VisuUiCurveFrame widget.

Since 3.6


enum VisuUiCurveFrameStyle

typedef enum {
  CURVE_LINEAR,
  CURVE_BAR,
  CURVE_GAUSS
} VisuUiCurveFrameStyle;

Possible styles for the curve rendering, see visu_ui_curve_frame_setStyle().

CURVE_LINEAR

the curve is drawn with lines ;

CURVE_BAR

the curve is drawn with bars ;

CURVE_GAUSS

the curve is convoluted with gaussians (not implemented yet).

visu_ui_curve_frame_addData ()

void                visu_ui_curve_frame_addData         (VisuUiCurveFrame *curve,
                                                         const gchar *eleName,
                                                         const gchar *lkName,
                                                         const guint *data,
                                                         guint nSteps,
                                                         float init,
                                                         float step);

This routine changes the distribution for element eleName, with respect to element lkName. data is an array that gives the number data[i] of pairs eleName - lkName which distance is in (init + step * i).

curve :

a VisuUiCurveFrame widget.

eleName :

a string.

lkName :

a string.

data :

an array of frequencies.

nSteps :

the size of data.

init :

the initial x value for array data.

step :

the step value to increase x for array data.

Since 3.6


visu_ui_curve_frame_draw ()

void                visu_ui_curve_frame_draw            (VisuUiCurveFrame *curve);

Forces to redraw the widget.

curve :

a VisuUiCurveFrame widget.

Since 3.6


visu_ui_curve_frame_getHighlightRange ()

gboolean            visu_ui_curve_frame_getHighlightRange
                                                        (VisuUiCurveFrame *curve,
                                                         float range[2]);

Retrieves the distance span that is used for highlight rendering and calculation, see visu_ui_curve_frame_setHighlightRange().

curve :

a VisuUiCurveFrame widget.

range :

a location for two floats.

Returns :

TRUE if range has been set already.

Since 3.6


visu_ui_curve_frame_getIntegralInRange ()

float               visu_ui_curve_frame_getIntegralInRange
                                                        (VisuUiCurveFrame *curve,
                                                         gchar **label);

Calculates the integral of the displayed distribution (see visu_ui_curve_frame_setFilter()) in the given range (see visu_ui_curve_frame_setHighlightRange()). If label is present, it will points on a string labeling the displayed distribution. The string is owned by V_Sim.

curve :

a VisuUiCurveFrame widget.

label :

a location to a string.

Returns :

the integral.

Since 3.6


visu_ui_curve_frame_getMeanInRange ()

float               visu_ui_curve_frame_getMeanInRange  (VisuUiCurveFrame *curve,
                                                         gchar **label);

Calculates the average distance value of the displayed distribution (see visu_ui_curve_frame_setFilter()) in the given range (see visu_ui_curve_frame_setHighlightRange()). If label is present, it will points on a string labeling the displayed distribution. The string is owned by V_Sim.

curve :

a VisuUiCurveFrame widget.

label :

a location to a string.

Returns :

the average distance value.

Since 3.6


visu_ui_curve_frame_getSpan ()

void                visu_ui_curve_frame_getSpan         (VisuUiCurveFrame *curve,
                                                         float span[2]);

Retrieves the distances inside which the distribution is displayed.

curve :

a VisuUiCurveFrame widget.

span :

a location for two floats.

Since 3.6


visu_ui_curve_frame_hasData ()

gboolean            visu_ui_curve_frame_hasData         (VisuUiCurveFrame *curve);

Retrieve if some distance data have been added to the curve.

curve :

a VisuUiCurveFrame widget.

Returns :

TRUE if the curve has some data associated.

Since 3.6


visu_ui_curve_frame_new ()

GtkWidget *         visu_ui_curve_frame_new             (float distMin,
                                                         float distMax);

It creates a graph that can display distances distribution for VisuElement pairing. The display span is given by distMin and distMax.

distMin :

a float.

distMax :

a float (bigger than distMin).

Returns :

a newly craeted VisuUiCurveFrame widget.

Since 3.6


visu_ui_curve_frame_setData ()

void                visu_ui_curve_frame_setData         (VisuUiCurveFrame *curve,
                                                         float step,
                                                         float min,
                                                         float max);

Compute and allocate the required size to store distributions, see visu_ui_curve_frame_addData() to actually setup the distribution values.

curve :

a VisuUiCurveFrame widget.

step :

the stepping distance.

min :

the minimum distance for the distribution.

max :

the maximum distance for the distribution.

Since 3.6


visu_ui_curve_frame_setFilter ()

gboolean            visu_ui_curve_frame_setFilter       (VisuUiCurveFrame *curve,
                                                         const gchar *filter);

Modify the filter used to draw all or single VisuElement distribution.

curve :

a VisuUiCurveFrame widget.

filter :

a string.

Returns :

TRUE if filter is actually changed.

Since 3.6


visu_ui_curve_frame_setHighlightRange ()

gboolean            visu_ui_curve_frame_setHighlightRange
                                                        (VisuUiCurveFrame *curve,
                                                         float range[2]);

Modify the distance span that is used for highlight rendering and calculation, see visu_ui_curve_frame_getMeanInRange().

curve :

a VisuUiCurveFrame widget.

range :

two floats.

Returns :

TRUE if range is actually changed.

Since 3.6


visu_ui_curve_frame_setNNodes ()

void                visu_ui_curve_frame_setNNodes       (VisuUiCurveFrame *curve,
                                                         const gchar *ele,
                                                         guint n);

Modify the number of ... TODO

curve :

a VisuUiCurveFrame widget.

ele :

a string.

n :

a number.

Since 3.6


visu_ui_curve_frame_setSpan ()

gboolean            visu_ui_curve_frame_setSpan         (VisuUiCurveFrame *curve,
                                                         float span[2]);

Changes the distance range that is displayed on the curve.

curve :

a VisuUiCurveFrame widget.

span :

two floats.

Returns :

TRUE if the distance displayed is actually changed.

Since 3.6


visu_ui_curve_frame_setStyle ()

gboolean            visu_ui_curve_frame_setStyle        (VisuUiCurveFrame *curve,
                                                         VisuUiCurveFrameStyle style);

Modify the rendering style of the graph.

curve :

a VisuUiCurveFrame object.

style :

a style id.

Returns :

TRUE if the style is actually changed.

Since 3.5