## gtk_curveWidget

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

## Synopsis

    enum                CurveFrameStyle;
    #define             CURVE_FRAME_TYPE
    #define             CURVE_FRAME                         (obj)
    #define             CURVE_FRAME_CLASS                   (obj)
    #define             IS_CURVE_FRAME                      (obj)
    #define             IS_CURVE_FRAME_CLASS                (obj)
    #define             CURVE_FRAME_GET_CLASS
                        CurveFrame;
                        CurveFrameClass;
    GType               curveFrame_get_type                 (void);
    GtkWidget *         curveFrameNew                       (float distMin,
                                                             float distMax);
    void                curveFrameRedraw                    (CurveFrame *curve);
    gboolean            curveFrameSet_span                  (CurveFrame *curve,
                                                             float span[2]);
    void                curveFrameGet_span                  (CurveFrame *curve,
                                                             float span[2]);
    gboolean            curveFrameHas_data                  (CurveFrame *curve);
    void                curveFrameSet_data                  (CurveFrame *curve,
                                                             float step,
                                                             float min,
                                                             float max);
    void                curveFrameAdd_data                  (CurveFrame *curve,
                                                             const gchar *eleName,
                                                             const gchar *lkName,
                                                             const guint *data,
                                                             guint nSteps,
                                                             float init,
                                                             float step);
    gboolean            curveFrameSet_style                 (CurveFrame *curve,
                                                             CurveFrameStyle style);
    gboolean            curveFrameSet_filter                (CurveFrame *curve,
                                                             const gchar *filter);
    gboolean            curveFrameSet_highlightRange        (CurveFrame *curve,
                                                             float range[2]);
    gboolean            curveFrameGet_highlightRange        (CurveFrame *curve,
                                                             float range[2]);
    void                curveFrameSet_nNodes                (CurveFrame *curve,
                                                             const gchar *ele,
                                                             guint n);
    float               curveFrameGet_integralInRange       (CurveFrame *curve,
                                                             gchar **label);
    float               curveFrameGet_meanInRange           (CurveFrame *curve,
                                                             gchar **label);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkDrawingArea
                               +----CurveFrame

## Implemented Interfaces

CurveFrame implements AtkImplementorIface and GtkBuildable.

## Description

## Details

### enum CurveFrameStyle

    typedef enum
    {
      CURVE_LINEAR,
      CURVE_BAR,
      CURVE_GAUSS
    } CurveFrameStyle;

Possible styles for the curve rendering, see `curveFrameSet_style()`.

`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).

### CURVE_FRAME_TYPE

    #define CURVE_FRAME_TYPE          (curveFrame_get_type())

Return the associated GType to the CurveFrame objects.

Since 3.6

### CURVE_FRAME()

    #define CURVE_FRAME(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), CURVE_FRAME_TYPE, CurveFrame))

Cast the given object to a CurveFrame object.

`obj` : | the widget to cast.

Since 3.6

### CURVE_FRAME_CLASS()

    #define CURVE_FRAME_CLASS(obj)    (G_TYPE_CHECK_CLASS_CAST((obj), CURVE_FRAME, CurveFrameClass))

Cast the given class to a CurveFrame object.

`obj` : | the class to cast.

Since 3.6

### IS_CURVE_FRAME()

    #define IS_CURVE_FRAME(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj), CURVE_FRAME_TYPE))

Return if the given object is a valid CurveFrame object.

`obj` : | the object to test.

Since 3.6

### IS_CURVE_FRAME_CLASS()

    #define IS_CURVE_FRAME_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((obj), CURVE_FRAME_TYPE))

Return if the given class is a valid CurveFrameClass class.

`obj` : | the class to test.

Since 3.6

### CURVE_FRAME_GET_CLASS

    #define CURVE_FRAME_GET_CLASS     (G_TYPE_INSTANCE_GET_CLASS((obj), CURVE_FRAME_TYPE, CurveFrameClass))

Get the class of the given object.

`obj` : | the widget to get the class of.

Since 3.6

### CurveFrame

    typedef struct _CurveFrame CurveFrame;

An opaque structure defining a CurveFrame widget.

Since 3.6

### CurveFrameClass

    typedef struct _CurveFrameClass CurveFrameClass;

An opaque structure defining the class of a CurveFrame widget.

Since 3.6

### curveFrame_get_type ()

    GType               curveFrame_get_type                 (void);

Internal routine to get CURVE_FRAME_TYPE value.

Since 3.6

### curveFrameNew ()

    GtkWidget *         curveFrameNew                       (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 CurveFrame widget.

Since 3.6

### curveFrameRedraw ()

    void                curveFrameRedraw                    (CurveFrame *curve);

Forces to redraw the widget.

`curve` : | a CurveFrame widget.

Since 3.6

### curveFrameSet_span ()

    gboolean            curveFrameSet_span                  (CurveFrame *curve,
                                                             float span[2]);

Changes the distance range that is displayed on the curve.

`curve` : | a CurveFrame widget.
`span` : | two floats.
Returns : | TRUE if the distance displayed is actually changed.

Since 3.6

### curveFrameGet_span ()

    void                curveFrameGet_span                  (CurveFrame *curve,
                                                             float span[2]);

Retrieves the distances inside which the distribution is displayed.

`curve` : | a CurveFrame widget.
`span` : | a location for two floats.

Since 3.6

### curveFrameHas_data ()

    gboolean            curveFrameHas_data                  (CurveFrame *curve);

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

`curve` : | a CurveFrame widget.
Returns : | TRUE if the `curve` has some data associated.

Since 3.6

### curveFrameSet_data ()

    void                curveFrameSet_data                  (CurveFrame *curve,
                                                             float step,
                                                             float min,
                                                             float max);

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

`curve` : | a CurveFrame widget.
`step` : | the stepping distance.
`min` : | the minimum distance for the distribution.
`max` : | the maximum distance for the distribution.

Since 3.6

### curveFrameAdd_data ()

    void                curveFrameAdd_data                  (CurveFrame *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 CurveFrame 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

### curveFrameSet_style ()

    gboolean            curveFrameSet_style                 (CurveFrame *curve,
                                                             CurveFrameStyle style);

Modify the rendering style of the graph.

`curve` : | a CurveFrame object.
`style` : | a style id.
Returns : | TRUE if the style is actually changed.

Since 3.5

### curveFrameSet_filter ()

    gboolean            curveFrameSet_filter                (CurveFrame *curve,
                                                             const gchar *filter);

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

`curve` : | a CurveFrame widget.
`filter` : | a string.
Returns : | TRUE if filter is actually changed.

Since 3.6

### curveFrameSet_highlightRange ()

    gboolean            curveFrameSet_highlightRange        (CurveFrame *curve,
                                                             float range[2]);

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

`curve` : | a CurveFrame widget.
`range` : | two floats.
Returns : | TRUE if range is actually changed.

Since 3.6

### curveFrameGet_highlightRange ()

    gboolean            curveFrameGet_highlightRange        (CurveFrame *curve,
                                                             float range[2]);

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

`curve` : | a CurveFrame widget.
`range` : | a location for two floats.
Returns : | TRUE if range has been set already.

Since 3.6

### curveFrameSet_nNodes ()

    void                curveFrameSet_nNodes                (CurveFrame *curve,
                                                             const gchar *ele,
                                                             guint n);

Modify the number of ... TODO

`curve` : | a CurveFrame widget.
`ele` : | a string.
`n` : | a number.

Since 3.6

### curveFrameGet_integralInRange ()

    float               curveFrameGet_integralInRange       (CurveFrame *curve,
                                                             gchar **label);

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

`curve` : | a CurveFrame widget.
`label` : | a location to a string.
Returns : | the integral.

Since 3.6

### curveFrameGet_meanInRange ()

    float               curveFrameGet_meanInRange           (CurveFrame *curve,
                                                             gchar **label);

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

`curve` : | a CurveFrame widget.
`label` : | a location to a string.
Returns : | the average distance value.

Since 3.6