## marks marks — Draw features on nodes, like measurement marks or highlights. |

## Synopsis

    enum                VisuMarksStatus;
    #define             VISU_MARKS_TYPE
    #define             VISU_MARKS                          (obj)
    #define             VISU_MARKS_CLASS                    (obj)
    #define             IS_VISU_MARKS                       (obj)
    #define             IS_VISU_MARKS_CLASS                 (obj)
    #define             VISU_MARKS_GET_CLASS
                        VisuMarks;
                        VisuMarksClass;
    GType               visu_marks_get_type                 (void);
    VisuMarks*          visu_marks_new                      ();
    void                visu_marks_setVisuData              (VisuMarks *marks,
                                                             VisuData *data);
    gboolean            visu_marks_setHighlightedList       (VisuMarks *marks,
                                                             GList *lst,
                                                             VisuMarksStatus status);
    GList*              visu_marks_getHighlightedList       (VisuMarks *marks);
    gboolean            visu_marks_setInfos                 (VisuMarks *marks,
                                                             guint nodeId,
                                                             gboolean status);
    gboolean            visu_marks_getActive                (VisuMarks *marks,
                                                             guint nodeId);
    gboolean            visu_marks_setDrawValues            (VisuMarks *marks,
                                                             gboolean status);
    gboolean            visu_marks_removeMeasures           (VisuMarks *marks,
                                                             gint nodeId);
    gboolean            visu_marks_parseXMLFile             (VisuMarks *marks,
                                                             const gchar *filename,
                                                             GList **infos,
                                                             VisuGlExtInfosDrawId *drawingMode,
                                                             guint *drawingInfos,
                                                             GError **error);
    gboolean            visu_marks_exportXMLFile            (VisuMarks *marks,
                                                             const gchar *filename,
                                                             int *nodes,
                                                             VisuGlExtInfosDrawId drawingMode,
                                                             guint drawingInfos,
                                                             GError **error);
    gchar*              visu_marks_getMeasurementStrings    (VisuMarks *marks,
                                                             VisuData *dataObj);
    gchar*              visu_marks_getMeasurementLabels     (VisuMarks *marks);

## Object Hierarchy

      GObject
       +----VisuMarks

## Signals

      "highlightChanged"                               : Run Last / No Recursion / No Hooks
      "measurementChanged"                             : Run Last / No Recursion / No Hooks

## Description

VisuMarks is used to store a set of mark on a list of nodes. A mark can be a distance measurement, an angle measurement or an highlight. The measurement marks are automatically updated by listening to the "node-selection" signal. On the contrary, highlights are set, unset or toggled using `visu_marks_setHighlightedList()`.

In addition, VisuMarks can be export to or loaded from an XML file thanks to `visu_marks_exportXMLFile()` and `visu_marks_parseXMLFile()`.

## Details

### enum VisuMarksStatus

    typedef enum
      {
        MARKS_STATUS_TOGGLE,
        MARKS_STATUS_SET,
        MARKS_STATUS_UNSET
      } VisuMarksStatus;

Possible parameters to change mark status, see `visu_marks_setHighlightedList()` for instance.

`MARKS_STATUS_TOGGLE` | change the status of the mark ;
`MARKS_STATUS_SET` | set the mark on ;
`MARKS_STATUS_UNSET` | unset a mark.

Since 3.6

### VISU_MARKS_TYPE

    #define VISU_MARKS_TYPE          (visu_marks_get_type())

Return the associated GType to the VisuMarks objects.

Since 3.6

### VISU_MARKS()

    #define VISU_MARKS(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), VISU_MARKS_TYPE, VisuMarks))

Cast the given object to a VisuMarks object.

`obj` : | the widget to cast.

Since 3.6

### VISU_MARKS_CLASS()

    #define VISU_MARKS_CLASS(obj)    (G_TYPE_CHECK_CLASS_CAST((obj), VISU_MARKS, VisuMarksClass))

Cast the given class to a VisuMarks object.

`obj` : | the class to cast.

Since 3.6

### IS_VISU_MARKS()

    #define IS_VISU_MARKS(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj), VISU_MARKS_TYPE))

Return if the given object is a valid VisuMarks object.

`obj` : | the object to test.

Since 3.6

### IS_VISU_MARKS_CLASS()

    #define IS_VISU_MARKS_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((obj), VISU_MARKS_TYPE))

Return if the given class is a valid VisuMarksClass class.

`obj` : | the class to test.

Since 3.6

### VISU_MARKS_GET_CLASS

    #define VISU_MARKS_GET_CLASS     (G_TYPE_INSTANCE_GET_CLASS((obj), VISU_MARKS_TYPE, VisuMarksClass))

Get the class of the given object.

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

Since 3.6

### VisuMarks

    typedef struct _VisuMarks VisuMarks;

All fields are private.

Since 3.6

### VisuMarksClass

    typedef struct _VisuMarksClass VisuMarksClass;

An opaque structure defining the class of a VisuMarks objects.

Since 3.6

### visu_marks_get_type ()

    GType               visu_marks_get_type                 (void);

Internal routine to get VISU_MARKS_TYPE value.

Since 3.6

### visu_marks_new ()

    VisuMarks*          visu_marks_new                      ();

Create a new VisuMarks object. Make it listen to "node-selection" signal to update itself automatically.

Returns : | the newly created object.

### visu_marks_setVisuData ()

    void                visu_marks_setVisuData              (VisuMarks *marks,
                                                             VisuData *data);

Attach the given `marks` to `data`. `marks` will be updated if `data` is changed and internal list of marks is updated with the new nodes of `data`.

`marks` : | a VisuMarks object.
`data` : | a VisuData object.

### visu_marks_setHighlightedList ()

    gboolean            visu_marks_setHighlightedList       (VisuMarks *marks,
                                                             GList *lst,
                                                             VisuMarksStatus status);

`marks` has a list of mark for some nodes. These marks can be highlight (or distance, angles...). Depending on `status` values, the mark may be switch on or off.

`marks` : | a VisuMarks object ;
`lst` : | a set of node ids (0 started) ;. element-type guint32.
`status` : | changing command.
Returns : | TRUE if redraw needed.

Since 3.6

### visu_marks_getHighlightedList ()

    GList*              visu_marks_getHighlightedList       (VisuMarks *marks);

`marks` has a list of mark for some nodes. These marks can be highlight (or distance, angles...).

`marks` : | a VisuMarks object ;
Returns : | list of highlighted nodes (starting from 0), should freed with `g_list_free()`. . element-type guint32. transfer container guint32.

Since 3.6

### visu_marks_setInfos ()

    gboolean            visu_marks_setInfos                 (VisuMarks *marks,
                                                             guint nodeId,
                                                             gboolean status);

Depending on `status`, it removes all measurements from `nodeId` or it calculate all first neighbour relations of `nodeId`.

Return: TRUE if `marks` is changed.

`marks` : | a VisuMarks object.
`nodeId` : | a node id.
`status` : | a boolean.

### visu_marks_getActive ()

    gboolean            visu_marks_getActive                (VisuMarks *marks,
                                                             guint nodeId);

Retrieve if `nodeId` is implied any measurement marks stored in `mark`.

`marks` : | a VisuMarks object.
`nodeId` : | a node id.
Returns : | TRUE if `nodeId` participate to any mark (distance, angle...).

### visu_marks_setDrawValues ()

    gboolean            visu_marks_setDrawValues            (VisuMarks *marks,
                                                             gboolean status);

Change if the measurements are printed or not (distance length, or angles...).

`marks` : | a VisuMarks object.
`status` : | a boolean.
Returns : | TRUE if `marks` is modified.

### visu_marks_removeMeasures ()

    gboolean            visu_marks_removeMeasures           (VisuMarks *marks,
                                                             gint nodeId);

This routine scans the `mark` to remove all marks of distance or angle where `nodeId` is implied in.

`marks` : | a VisuMarks object.
`nodeId` : | a node id.
Returns : | TRUE is `mark` is changed.

### visu_marks_parseXMLFile ()

    gboolean            visu_marks_parseXMLFile             (VisuMarks *marks,
                                                             const gchar *filename,
                                                             GList **infos,
                                                             VisuGlExtInfosDrawId *drawingMode,
                                                             guint *drawingInfos,
                                                             GError **error);

This routines read from an XML file the description of selected nodes, `mark` is updated accordingly.

`marks` : | a VisuMarks object.
`filename` : | a location to save to.
`infos` : | a location to a GList.
`drawingMode` : | a location to a flag.
`drawingInfos` : | a location to a flag.
`error` : | a location to store an error.
Returns : | TRUE if no error.

Since 3.5

### visu_marks_exportXMLFile ()

    gboolean            visu_marks_exportXMLFile            (VisuMarks *marks,
                                                             const gchar *filename,
                                                             int *nodes,
                                                             VisuGlExtInfosDrawId drawingMode,
                                                             guint drawingInfos,
                                                             GError **error);

This routines export to an XML file a description of selected `nodes`. If `nodes` is NULL, the nodes stored in the `mark` will be used instead.

`marks` : | a VisuMarks object.
`filename` : | a location to save to.
`nodes` : | an array of nodes, -1 terminated (can be NULL).
`drawingMode` : | a flag.
`drawingInfos` : | a flag.
`error` : | a location to store an error.
Returns : | TRUE if no error.

Since 3.5

### visu_marks_getMeasurementStrings ()

    gchar*              visu_marks_getMeasurementStrings    (VisuMarks *marks,
                                                             VisuData *dataObj);

Exports as a string all measurements stored in `marks`.

`marks` : | a VisuMarks object.
`dataObj` : | the VisuData to apply the measurements to.
Returns : | a newly allocated string.

Since 3.6

### visu_marks_getMeasurementLabels ()

    gchar*              visu_marks_getMeasurementLabels     (VisuMarks *marks);

Exports as a string the ids of nodes for measurement marks.

`marks` : | a VisuMarks object.
Returns : | a newly allocated string.

Since 3.6

## Signal Details

### The `"highlightChanged"` signal

    void                user_function                      (VisuMarks *marks,
                                                            gpointer   lst,
                                                            gpointer   user_data)      : Run Last / No Recursion / No Hooks

The list of highlighted nodes has been modified.

`marks` : | the object emitting the signal.
`lst` : | a list of node ids (starting from 0).
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"measurementChanged"` signal

    void                user_function                      (VisuMarks *marks,
                                                            gpointer   user_data)      : Run Last / No Recursion / No Hooks

The list of measurements has been changed.

`marks` : | the object emitting the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.6