## visu_data

visu_data — Give methods to store and manage data from input file(s).

## Synopsis

    #include <visu_nodes.h>

    #define             VISU_DATA_TYPE
    #define             VISU_DATA                           (obj)
    #define             VISU_DATA_CLASS                     (klass)
    #define             IS_VISU_DATA_TYPE                   (obj)
    #define             IS_VISU_DATA_CLASS                  (klass)
    #define             VISU_DATA_GET_CLASS                 (obj)
                        VisuDataPrivate;
                        VisuData;
                        VisuDataClass;
    void                (*VisuDataColorFunc)                (VisuData *visuData,
                                                             float rgba[4],
                                                             VisuElement *ele,
                                                             VisuNode *node);
    float               (*VisuDataScalingFunc)              (VisuData *visuData,
                                                             VisuNode *node);
    GType               visu_data_get_type                  (void);
    VisuData*           visu_data_new                       (void);
    VisuData*           visu_data_newWithSize               (guint w,
                                                             guint h);
    VisuData*           visu_data_newWithView               (VisuOpenGLView *view,
                                                             gboolean autoAdjust);
    int                 visu_data_getObjectList             (VisuData *data);
    #define             EXT_VISU_DATA_ID
    enum                VisuDataBoxBoundaries;
    int                 visu_data_setPopulation             (VisuData *data,
                                                             unsigned int nbOfTypes,
                                                             unsigned int *nbOfNodesPerVisuElement,
                                                             VisuElement **visu_element_Used);
    gboolean            visu_data_allocatePopulation        (VisuData *data,
                                                             GArray *nNodesPerElement,
                                                             GArray *elements);
    gboolean            visu_data_allocatePopulationByNames (VisuData *data,
                                                             GArray *nNodesPerElement,
                                                             GArray *elementNames);
    void                visu_data_freePopulation            (VisuData *data);
    void                visu_data_addFile                   (VisuData *data,
                                                             gchar *file,
                                                             int kind,
                                                             ToolFileFormat *format);
    void                visu_data_removeAllFiles            (VisuData *data);
    gchar*              visu_data_getFile                   (VisuData *data,
                                                             int kind,
                                                             ToolFileFormat **format);
    gchar*              visu_data_getFilesAsLabel           (VisuData *data);
    void                visu_data_setFileCommentary         (VisuData *data,
                                                             gchar *commentary,
                                                             gint iSet);
    gchar*              visu_data_getFileCommentary         (VisuData *data,
                                                             gint iSet);
    void                visu_data_setNSubset                (VisuData *data,
                                                             int nSet);
    int                 visu_data_getNSubset                (VisuData *data);
    void                visu_data_setISubset                (VisuData *data,
                                                             int iSet);
    int                 visu_data_getISubset                (VisuData *data);
    gboolean            visu_data_compareElements           (VisuData *data1,
                                                             VisuData *data2);
    void                visu_data_setChangeElementFlag      (VisuData *data,
                                                             gboolean changeElement);
    gboolean            visu_data_getChangeElementFlag      (VisuData *data);
    float               visu_data_getAllElementExtens       (VisuData *dataObj);
    VisuNode*           visu_data_addNodeFromElement        (VisuData *data,
                                                             VisuElement *ele,
                                                             float xyz[3],
                                                             gboolean reduced,
                                                             gboolean emitSignal);
    VisuNode*           visu_data_addNodeFromElementName    (VisuData *data,
                                                             gchar *name,
                                                             float xyz[3],
                                                             gboolean reduced,
                                                             gboolean emitSignal);
    VisuNode*           visu_data_addNodeFromIndex          (VisuData *data,
                                                             unsigned int position,
                                                             float xyz[3],
                                                             gboolean reduced,
                                                             gboolean emitSignal);
    VisuNode*           visu_data_getNodeFromNumber         (VisuData *data,
                                                             unsigned int number);
    VisuNodeArray*      visu_data_getNodeArray              (VisuData *data);
    void                visu_data_setColorFunc              (VisuData *data,
                                                             VisuDataColorFunc func);
    gboolean            visu_data_hasUserColorFunc          (VisuData *data);
    gboolean            visu_data_getUserColor              (VisuData *data,
                                                             VisuElement *ele,
                                                             VisuNode *node,
                                                             float rgba[4]);
    float*              visu_data_getXYZtranslation         (VisuData *data);
    gboolean            visu_data_setXYZtranslation         (VisuData *data,
                                                             float xyz[3]);
    void                visu_data_convertXYZToReduced       (VisuData *data,
                                                             GArray *xyz,
                                                             float *u,
                                                             float *v,
                                                             float *w);
    void                visu_data_convertReducedToXYZ       (VisuData *data,
                                                             GArray *red,
                                                             float *x,
                                                             float *y,
                                                             float *z);
    void                visu_data_convertXYZtoBoxCoordinates
                                                            (VisuData *data,
                                                             float boxCoord[3],
                                                             float xyz[3]);
    void                visu_data_convertBoxCoordinatestoXYZ
                                                            (VisuData *data,
                                                             float xyz[3],
                                                             float boxCoord[3]);
    void                visu_data_convertFullCartesianToSpherical
                                                            (VisuData *data,
                                                             float sph[3],
                                                             float xyz[3]);
    void                visu_data_getBoxMatrix              (VisuData *data,
                                                             float matrix[3][3]);
    void                visu_data_getBoxMatrixD0            (VisuData *data,
                                                             double matrix[3][3]);
    void                visu_data_setBoxGeometry            (VisuData *data,
                                                             double geometry[6],
                                                             VisuDataBoxBoundaries bc);
    gboolean            visu_data_setBoxGeometryFull        (VisuData *data,
                                                             double geometry[3][3],
                                                             VisuDataBoxBoundaries bc);
    void                visu_data_applyBoxGeometry          (VisuData *data);
    float               visu_data_getBoxGeometry            (VisuData *data,
                                                             int vector);
    gboolean            visu_data_getNodeBoxFromNumber      (VisuData *data,
                                                             guint nodeId,
                                                             int nodeBox[3]);
    gboolean            visu_data_getNodeBoxFromCoord       (VisuData *data,
                                                             float xcart[3],
                                                             int nodeBox[3]);
    void                visu_data_getBoxVertices            (VisuData *data,
                                                             float v[8][3],
                                                             gboolean withExtension);
    void                visu_data_getBoxSpan                (VisuData *data,
                                                             float span[2]);
    ToolUnits           visu_data_getUnit                   (VisuData *data);
    gboolean            visu_data_setUnit                   (VisuData *data,
                                                             ToolUnits unit);
    VisuDataBoxBoundaries  visu_data_getBoundaryConditions  (VisuData *data);
    void                visu_data_setTightBox               (VisuData *data);
    gboolean            visu_data_constrainedElementInTheBox
                                                            (VisuData *data,
                                                             VisuElement *element);
    gboolean            visu_data_constrainedInTheBox       (VisuData *data);
    gboolean            visu_data_constrainedFree           (VisuData *data);
    gboolean            visu_data_getTranslationStatus      (VisuData *data);
    gboolean            visu_data_replicate                 (VisuData *data,
                                                             float extension[3],
                                                             gboolean *rebuild);
    gboolean            visu_data_restore                   (VisuData *data);
    void                visu_data_getExtension              (VisuData *dataObj,
                                                             float extension[3]);
    float*              visu_data_getBoxExtens              (VisuData *dataObj);
    void                visu_data_getBoxLengths             (VisuData *dataObj,
                                                             float *ext1,
                                                             float *ext2);
    void                visu_data_getBoxCentre              (VisuData *dataObj,
                                                             float centre[3]);
    void                visu_data_getNodeCoordinates        (VisuData *data,
                                                             VisuNode *node,
                                                             float *x,
                                                             float *y,
                                                             float *z);
    void                visu_data_getNodePosition           (VisuData *data,
                                                             VisuNode *node,
                                                             float coord[3]);
    void                visu_data_getReducedNodePosition    (VisuData *data,
                                                             VisuNode *node,
                                                             float red[3]);
    VisuNodeInfo*       visu_data_getDistanceList           (VisuData *data,
                                                             guint nodeId,
                                                             float *minVal);
    gboolean            visu_data_setNewBasisFromNodes      (VisuData *data,
                                                             guint nO,
                                                             guint nA,
                                                             guint nB,
                                                             guint nC);
    gboolean            visu_data_setNewBasis               (VisuData *data,
                                                             float matA[3][3],
                                                             float O[3]);
    gboolean            visu_data_reorder                   (VisuData *data,
                                                             VisuData *dataRef);
    void                visu_data_createNodes               (VisuData *data,
                                                             VisuElement *ele);
    void                visu_data_createNode                (VisuData *data,
                                                             VisuNode *node);
    void                visu_data_createAllNodes            (VisuData *data);
    void                visu_data_createAllElements         (VisuData *data);
    void                visu_data_emitAskForShowHideNodes   (VisuData *data,
                                                             gboolean *redraw);
    void                visu_data_emitNodePositionChanged   (VisuData *data);
    void                visu_data_emitNodeRenderedChange    (VisuData *data);
    guint               visu_data_addTimeout                (VisuData *data,
                                                             guint time,
                                                             GSourceFunc func,
                                                             gpointer user_data);
    gboolean            visu_data_removeTimeout             (VisuData *data,
                                                             guint timeoutId);
    VisuOpenGLView*     visu_data_getOpenGLView             (VisuData *data);
    gboolean            visu_data_setAngleOfView            (VisuData *data,
                                                             float valueTheta,
                                                             float valuePhi,
                                                             float valueOmega,
                                                             int mask);
    gboolean            visu_data_setPositionOfView         (VisuData *data,
                                                             float valueX,
                                                             float valueY,
                                                             int mask);
    gboolean            visu_data_setZoomOfView             (VisuData *data,
                                                             float value);
    int                 visu_data_setPerspectiveOfView      (VisuData *data,
                                                             float value);
    int                 visu_data_setSizeOfView             (VisuData *data,
                                                             guint width,
                                                             guint height);
    void                visu_data_emitFacettesChanged       (VisuData *data);
    void                visu_data_setNodeScalingFunc        (VisuData *data,
                                                             VisuDataScalingFunc scaling);
    float               visu_data_getNodeScalingFactor      (VisuData *data,
                                                             VisuNode *node);
    GList*              visu_data_getAllObjects             (void);
    void                visu_data_removeNodes               (VisuData *data,
                                                             int *nodeNumbers);
    enum                VisuDataIterType;
                        VisuDataIter;
    void                visu_data_iterNew                   (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterStart                 (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterStartVisible          (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterStartNumber           (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterRestartNode           (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterNext                  (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterNextNode              (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterNextNodeNumber        (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterNextNodeOriginal      (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterNextElement           (VisuData *data,
                                                             VisuDataIter *iter);
    void                visu_data_iterNextVisible           (VisuData *data,
                                                             VisuDataIter *iter);
    gboolean            visu_data_iter_next                 (VisuDataIter *dataIter);
    gboolean            visu_data_iter_next2                (VisuDataIter *iter1,
                                                             VisuDataIter *iter2);

## Object Hierarchy

      GObject
       +----VisuData

## Properties

      "totalEnergy"              gdouble               : Read / Write / Construct

## Signals

      "BoxSizeChanged"                                 : Run Last / No Recursion / No Hooks
      "NodeAskForShowHide"                             : Run Last / No Recursion / No Hooks
      "NodeMaterialChanged"                            : Run Last / No Recursion / No Hooks
      "NodePopulationDecrease"                         : Run Last / No Recursion / No Hooks
      "NodePopulationDefined"                          : Run Last / No Recursion / No Hooks
      "NodePopulationIncrease"                         : Run Last / No Recursion / No Hooks
      "NodePositionChanged"                            : Run Last / No Recursion / No Hooks
      "NodeRenderedChanged"                            : Run Last / No Recursion / No Hooks
      "OpenGLFacetteChanged"                           : Run Last / No Recursion / No Hooks
      "OpenGLGross"                                    : Run Last / No Recursion / No Hooks
      "OpenGLNearFar"                                  : Run Last / No Recursion / No Hooks
      "OpenGLPersp"                                    : Run Last / No Recursion / No Hooks
      "OpenGLThetaPhiOmega"                            : Run Last / No Recursion / No Hooks
      "OpenGLWidthHeight"                              : Run Last / No Recursion / No Hooks
      "OpenGLXsYs"                                     : Run Last / No Recursion / No Hooks
      "UnitChanged"                                    : Run Last / No Recursion / No Hooks
      "objectFreed"                                    : Run Last / No Recursion / No Hooks

## Description

The main goal of V_Sim is to draw lists of elements. For example, when used to render atoms, a box that contains 24 silicon atoms and 46 germanium atoms is a box with two elements (silicon and germanium) where the silicon element has 24 nodes and the germanium element has 46 nodes. This module gives then methods to create nodes (see VisuElement to create and managed elements).

All nodes are stored in a structure called VisuNodes and VisuNodes is encapsulated in a VisuData for all not-node related information. V_Sim uses one VisuData per input file(s). This structure contains a list of pointers on all the VisuElement used in this file.

To iterate on nodes, one should use the provided iterators (see VisuDataIter) methods, like `visu_data_iter_next()`.

## Details

### VISU_DATA_TYPE

    #define VISU_DATA_TYPE	     (visu_data_get_type ())

return the type of VisuData.

### VISU_DATA()

    #define VISU_DATA(obj)	     (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_DATA_TYPE, VisuData))

Cast the given `obj` into VisuData type.

`obj` : | a GObject to cast.

### VISU_DATA_CLASS()

    #define VISU_DATA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_DATA_TYPE, VisuDataClass))

Cast the given `klass` into VisuDataClass.

`klass` : | a GObjectClass to cast.

### IS_VISU_DATA_TYPE()

    #define IS_VISU_DATA_TYPE(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_DATA_TYPE))

Test if the given `ogj` is of the type of VisuData object.

`obj` : | a GObject to test.

### IS_VISU_DATA_CLASS()

    #define IS_VISU_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, VISU_DATA_TYPE))

Test if the given `klass` is of the type of VisuDataClass class.

`klass` : | a GObjectClass to test.

### VISU_DATA_GET_CLASS()

    #define VISU_DATA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_DATA_TYPE, VisuDataClass))

It returns the class of the given `obj`.

`obj` : | a GObject to get the class of.

### VisuDataPrivate

    typedef struct _VisuDataPrivate VisuDataPrivate;

Private fields for VisuData objects.

### VisuData

    typedef struct _VisuData VisuData;

This structure describes a VisuData object.

### VisuDataClass

    typedef struct _VisuDataClass VisuDataClass;

A short way to identify _VisuDataClass structure.

### VisuDataColorFunc ()

    void                (*VisuDataColorFunc)                (VisuData *visuData,
                                                             float rgba[4],
                                                             VisuElement *ele,
                                                             VisuNode *node);

This prototype is used to specify an optional method to associate a color with external values to each node.

`visuData` : | a pointer to the calling object ;
`ele` : | a VisuElement ;
`node` : | a VisuNode ;
`rgba` : | an 4 allocated float area to store the return values.. in. array fixed-size=4.

### VisuDataScalingFunc ()

    float               (*VisuDataScalingFunc)              (VisuData *visuData,
                                                             VisuNode *node);

Interface for routine that need to rescale `node` before drawing them.

`visuData` : | a pointer to the calling object ;
`node` : | a VisuNode ;
Returns : | the scaling factor.

### visu_data_get_type ()

    GType               visu_data_get_type                  (void);

This method returns the type of VisuData, use VISU_DATA_TYPE instead.

Returns : | the type of VisuData.

### visu_data_new ()

    VisuData*           visu_data_new                       (void);

This creates an empty VisuData object.

Returns : | a newly created VisuData object (its ref count is set to 1).

### visu_data_newWithSize ()

    VisuData*           visu_data_newWithSize               (guint w,
                                                             guint h);

Create a new VisuData object with a given size for the view.

`w` : | the width size ;
`h` : | the height size.
Returns : | a newly created object.. transfer full.

### visu_data_newWithView ()

    VisuData*           visu_data_newWithView               (VisuOpenGLView *view,
                                                             gboolean autoAdjust);

This creates an empty VisuData object with values for its view taken from the given `view` argument (the argument is indeed copied). If `autoAdjust` is TRUE, the zoom level is automaticaly adjusted for the object to be full size at zoom level 1.

`view` : | an VisuOpenGLView object.
`autoAdjust` : | a boolean.
Returns : | a newly created VisuData object (its ref count is set to 1).. transfer full.

### visu_data_getObjectList ()

    int                 visu_data_getObjectList             (VisuData *data);

All the drawned nodes are stored in an OpenGL list. The identifier of this list can be access with the present method.

`data` : | a valid VisuObject ;
Returns : | an integer that identifies the OpenGL list of all drawn nodes.

### EXT_VISU_DATA_ID

    #define EXT_VISU_DATA_ID "AllElements"

The id used to identify this extension, see `visuExtensions_rebuildList()` for instance.

### enum VisuDataBoxBoundaries

    typedef enum
      {
        VISU_DATA_BOX_PERIODIC,
        VISU_DATA_BOX_SURFACE_XY,
        VISU_DATA_BOX_SURFACE_YZ,
        VISU_DATA_BOX_SURFACE_ZX,
        VISU_DATA_BOX_FREE
      } VisuDataBoxBoundaries;

This describes the periodicity of the bounding box in the three directions.

`VISU_DATA_BOX_PERIODIC` | the full 3D periodicity ;
`VISU_DATA_BOX_SURFACE_XY` | the Z axis is a free axis ;
`VISU_DATA_BOX_SURFACE_YZ` | the X axis is a free axis ;
`VISU_DATA_BOX_SURFACE_ZX` | the Y axis is a free axis ;
`VISU_DATA_BOX_FREE` | the system is isolated.

### visu_data_setPopulation ()

    int                 visu_data_setPopulation             (VisuData *data,
                                                             unsigned int nbOfTypes,
                                                             unsigned int *nbOfNodesPerVisuElement,
                                                             VisuElement **visu_element_Used);

### visu_data_allocatePopulation ()

    gboolean            visu_data_allocatePopulation        (VisuData *data,
                                                             GArray *nNodesPerElement,
                                                             GArray *elements);

This method allocates the storing part of the given VisuData structure and store all the VisuNodes.

`data` : | a VisuData object;
`nNodesPerElement` : | number of VisuNode per VisuElement;. in. element-type guint.
`elements` : | pointers to VisuElement in the same order that `nNodesPerElement`;. in. element-type VisuElement*.
Returns : | TRUE if everything goes right.

### visu_data_allocatePopulationByNames ()

    gboolean            visu_data_allocatePopulationByNames (VisuData *data,
                                                             GArray *nNodesPerElement,
                                                             GArray *elementNames);

This method allocates the storing part of the given VisuData structure and store all the VisuNodes.

`data` : | a VisuData object;
`nNodesPerElement` : | number of VisuNode per VisuElement;. in. element-type guint.
`elementNames` : | names of elements;. in. element-type utf8.
Returns : | TRUE if everything goes right.

### visu_data_freePopulation ()

    void                visu_data_freePopulation            (VisuData *data);

This method frees only the allocated memory that deals with the nodes (i.e. everything except the data of the files, the properties and the setColor method.

`data` : | a VisuData to be freed.

### visu_data_addFile ()

    void                visu_data_addFile                   (VisuData *data,
                                                             gchar *file,
                                                             int kind,
                                                             ToolFileFormat *format);

This method is used to add files of type `kind` to the `data`. The `file` attribute is copied. The `format` argument can be null.

`data` : | a VisuData object ;
`file` : | a string that points to a file ;
`kind` : | an integer to qualify the file to add ;
`format` : | a file format.. allow-none.

### visu_data_removeAllFiles ()

    void                visu_data_removeAllFiles            (VisuData *data);

This method is used to empty the list of known file from the given `data`.

`data` : | a VisuData object.

### visu_data_getFile ()

    gchar*              visu_data_getFile                   (VisuData *data,
                                                             int kind,
                                                             ToolFileFormat **format);

This prototype is used to retrieve stored files identify by their `kind`.

`data` : | a VisuData object.
`kind` : | an integer to qualify the required file ;
`format` : | a location for a file format (can be NULL).
Returns : | the name of a file (it should not be deleted).

### visu_data_getFilesAsLabel ()

    gchar*              visu_data_getFilesAsLabel           (VisuData *data);

Creates a label using the list of files used to defined this `data` separated by dashes.

`data` : | a VisuData object.
Returns : | a newly created string with the filenames. If no filename were used to defined `data`, the function returns NULL.

Since 3.6

### visu_data_setFileCommentary ()

    void                visu_data_setFileCommentary         (VisuData *data,
                                                             gchar *commentary,
                                                             gint iSet);

This method is used to store a description of the given `data`. This string is copied and `commentary` can be freed. Before using this method, the number of possible node sets must have been defined using `visu_data_setNSubset()`, if not, only iSet == 0 is allowed.

`data` : | a VisuData object ;
`commentary` : | the message to be stored (null terminated) ;
`iSet` : | an integer.

### visu_data_getFileCommentary ()

    gchar*              visu_data_getFileCommentary         (VisuData *data,
                                                             gint iSet);

Get the commentary associated to the given `data`, for the given node set.

`data` : | a VisuData object ;
`iSet` : | an integer (>= 0).
Returns : | a string description (possibly empty). This string is own by V_Sim and should not be freed.

### visu_data_setNSubset ()

    void                visu_data_setNSubset                (VisuData *data,
                                                             int nSet);

Change the number of available sets of nodes for this VisuData. This has a side effect to delete all previously saved file commentaries (see `visu_data_setFileCommentary()`).

`data` : | a VisuData object ;
`nSet` : | an integer.

### visu_data_getNSubset ()

    int                 visu_data_getNSubset                (VisuData *data);

Retrieve the number of available sets of nodes for this VisuData, see `visu_data_setNSubset()`.

`data` : | a VisuData object.
Returns : | the number of set of nodes (1 is default).

### visu_data_setISubset ()

    void                visu_data_setISubset                (VisuData *data,
                                                             int iSet);

Change the current id of the set of data (ordered as in C, beginning at 0).

`data` : | a VisuData object ;
`iSet` : | an integer.

### visu_data_getISubset ()

    int                 visu_data_getISubset                (VisuData *data);

Retrieve the id of the current set of data (ordered as in C, beginning at 0).

`data` : | a VisuData object.
Returns : | the id of the set of nodes currently loaded, -1 if none.

### visu_data_compareElements ()

    gboolean            visu_data_compareElements           (VisuData *data1,
                                                             VisuData *data2);

This method is used to compare the composition of the given two VisuData objects. The test is only done on VisuElement lists.

`data1` : | a VisuData object ;
`data2` : | an other VisuData object.
Returns : | TRUE if the two objects contains exactly the same VisuElement objects (not one more or one less or one different), FALSE otherwise.

### visu_data_setChangeElementFlag ()

    void                visu_data_setChangeElementFlag      (VisuData *data,
                                                             gboolean changeElement);

This method is mainly used by internal gears to set a flag. This flag control if the `data` object has the same VisuElement objects than the previously rendered one.

`data` : | a VisuData object ;
`changeElement` : | a boolean.

### visu_data_getChangeElementFlag ()

    gboolean            visu_data_getChangeElementFlag      (VisuData *data);

V_Sim can use a flag set on `data` object to know if `data` has exactly the same VisuElement list than the previously rendered one.

`data` : | a VisuData object.
Returns : | TRUE if the previously rendered VisuData object has had the same VisuElement list than the given one, FALSE otherwise.

### visu_data_getAllElementExtens ()

    float               visu_data_getAllElementExtens       (VisuData *dataObj);

Calculate the maximum size of all VisuElement used in this `dataObj`.

`dataObj` : | a VisuData object.
Returns : | a positive size.

### visu_data_addNodeFromElement ()

    VisuNode*           visu_data_addNodeFromElement        (VisuData *data,
                                                             VisuElement *ele,
                                                             float xyz[3],
                                                             gboolean reduced,
                                                             gboolean emitSignal);

This method adds a new VisuNode to the specified VisuData. If `emitSignal` is TRUE, then NodePopulationIncrease signal is triggered.

`data` : | the VisuData where to add the new VisuNode ;
`ele` : | the VisuElement kind of the new VisuNode ;
`xyz` : | its coordinates ;. in. array fixed-size=3.
`reduced` : | coordinates are in reduced coordinates ;
`emitSignal` : | a boolean.
Returns : | a pointer to the newly created node.. transfer none.

### visu_data_addNodeFromElementName ()

    VisuNode*           visu_data_addNodeFromElementName    (VisuData *data,
                                                             gchar *name,
                                                             float xyz[3],
                                                             gboolean reduced,
                                                             gboolean emitSignal);

This method adds a new VisuNode to the specified VisuData. If `emitSignal` is TRUE, then NodePopulationIncrease signal is triggered.

`data` : | the VisuData where to add the new VisuNode ;
`name` : | the name of the element ;
`xyz` : | its coordinates ;. in. array fixed-size=3.
`reduced` : | coordinates are in reduced coordinates ;
`emitSignal` : | a boolean.
Returns : | a pointer to the newly created node. . transfer none.

Since 3.6

### visu_data_addNodeFromIndex ()

    VisuNode*           visu_data_addNodeFromIndex          (VisuData *data,
                                                             unsigned int position,
                                                             float xyz[3],
                                                             gboolean reduced,
                                                             gboolean emitSignal);

This method adds a new VisuNode to the specified VisuData. Position must be chosen between 0 and (ntype - 1) and corresponds to the position of the array of VisuNodes of a VisuElement. If `emitSignal` is TRUE, then NodePopulationIncrease signal is triggered.

`data` : | the VisuData where to add the new VisuNode ;
`position` : | a integer corresponding to the position of a VisuElement in the array **nodes in the structure;
`xyz` : | its coordinates ;. in. array fixed-size=3.
`reduced` : | coordinates are in reduced coordinates ;
`emitSignal` : | a boolean.
Returns : | a pointer to the newly created node.. transfer none.

### visu_data_getNodeFromNumber ()

    VisuNode*           visu_data_getNodeFromNumber         (VisuData *data,
                                                             unsigned int number);

This methods retrieves the VisuNode identified by the integer `number`. The number must be strictly positive. No eror is raised if no node corresponds to the given number.

`data` : | a `VisuData` structure which stores the nodes.
`number` : | an integer.
Returns : | the found VisuNode or NULL if none corresponds to number.. transfer none.

### visu_data_getNodeArray ()

    VisuNodeArray*      visu_data_getNodeArray              (VisuData *data);

This method retrieve the VisuNodeArray associated to the given `data`.

`data` : | a VisuData object.
Returns : | the associated VisuNodeArray.. transfer none.

### visu_data_setColorFunc ()

    void                visu_data_setColorFunc              (VisuData *data,
                                                             VisuDataColorFunc func);

This is a little trick to colorized the nodes. It should not be used since it will probably be different in future release.

`data` : | a VisuData object ;
`func` : | a method that colorize the nodes.. scope call

### visu_data_hasUserColorFunc ()

    gboolean            visu_data_hasUserColorFunc          (VisuData *data);

Test the existence of a user defined colourisation function.

`data` : | a VisuData object.
Returns : | TRUE if a user color function has been defined with `visu_data_setColorFunc()`.

Since 3.6

### visu_data_getUserColor ()

    gboolean            visu_data_getUserColor              (VisuData *data,
                                                             VisuElement *ele,
                                                             VisuNode *node,
                                                             float rgba[4]);

If a user defined color has been set (see `visu_data_setColorFunc()`), then call this method to obtain a color for the given node.

`data` : | a VisuData object ;
`ele` : | a VisuElement object ;
`node` : | a VisuNode object ;
`rgba` : | a location to store the color.. array fixed-size=4.
Returns : | TRUE if a user color has been defined.

Since 3.6

### visu_data_getXYZtranslation ()

    float*              visu_data_getXYZtranslation         (VisuData *data);

The nodes are rendered at thier coordinates plus a translation. This method allows to retrieve that translation.

`data` : | a VisuData object.
Returns : | a newly allocated array of 3 floats. It should be freed with a call to `free()` after use.. array fixed-size=3.

### visu_data_setXYZtranslation ()

    gboolean            visu_data_setXYZtranslation         (VisuData *data,
                                                             float xyz[3]);

This set the translations of the specified VisuData whatever previous values. The translation is done in the orthonormal referential, not the referential of the box.

`data` : | a VisuData object ;
`xyz` : | an array of floating point values.. in. array fixed-size=3.
Returns : | if returns TRUE, `visu_data_createAllNodes()` should be called and the 'NodePositionChanged' should be emitted.

### visu_data_convertXYZToReduced ()

    void                visu_data_convertXYZToReduced       (VisuData *data,
                                                             GArray *xyz,
                                                             float *u,
                                                             float *v,
                                                             float *w);

Use this method to transform cartesian into box coordinates.

`data` : | a VisuData object ;
`xyz` : | floating point values that describes the cartesian coordinates.. in. array fixed-size=3. element-type gfloat.
`u` : | the x coordinate.. out caller-allocates.
`v` : | the y coordinate.. out caller-allocates.
`w` : | the z coordinate.. out caller-allocates.

Since 3.6

### visu_data_convertReducedToXYZ ()

    void                visu_data_convertReducedToXYZ       (VisuData *data,
                                                             GArray *red,
                                                             float *x,
                                                             float *y,
                                                             float *z);

Use this method to transform box coordinates into cartesian.

`data` : | a VisuData object ;
`red` : | floating point values that describes the cartesian coordinates.. in. array fixed-size=3. element-type gfloat.
`x` : | the x coordinate.. out caller-allocates.
`y` : | the y coordinate.. out caller-allocates.
`z` : | the z coordinate.. out caller-allocates.

Since 3.6

### visu_data_convertXYZtoBoxCoordinates ()

    void                visu_data_convertXYZtoBoxCoordinates
                                                            (VisuData *data,
                                                             float boxCoord[3],
                                                             float xyz[3]);

### visu_data_convertBoxCoordinatestoXYZ ()

    void                visu_data_convertBoxCoordinatestoXYZ
                                                            (VisuData *data,
                                                             float xyz[3],
                                                             float boxCoord[3]);

Use this method to transform box coordinates into cartesian.

`data` : | a VisuData object ;
`xyz` : | an array of floating point values to store the result ;. out caller-allocates. array fixed-size=3.
`boxCoord` : | an array of floating point values that describes the box coordinates.. in. array fixed-size=3.

### visu_data_convertFullCartesianToSpherical ()

    void                visu_data_convertFullCartesianToSpherical
                                                            (VisuData *data,
                                                             float sph[3],
                                                             float xyz[3]);

Convert given cartesian coordinates to spherical ones. If the box has been rotated (see `visu_data_setBoxGeometryFull()`), then the cartesian coordinates should be the one before the rotation.

`data` : | a VisuData object.
`sph` : | . out caller-allocates. array fixed-size=3.
`xyz` : | . in. array fixed-size=3.

Since 3.6

### visu_data_getBoxMatrix ()

    void                visu_data_getBoxMatrix              (VisuData *data,
                                                             float matrix[3][3]);

This method is used when the box matrix is required. This matrix can transform a vector given in box coordinates into a cartesian vector. If a simple vector multication is required, then the use of `visu_data_convertBoxCoordinatestoXYZ()` should be prefered.

`data` : | a VisuData object ;
`matrix` : | an area to store the matrix.. inout. array fixed-size=3. transfer full fixed-size=3.

### visu_data_getBoxMatrixD0 ()

    void                visu_data_getBoxMatrixD0            (VisuData *data,
                                                             double matrix[3][3]);

Same as `visu_data_getBoxMatrix()` but with a double precision matrix.

`data` : | a VisuData object ;
`matrix` : | an area to store the matrix.. inout. array fixed-size=3. transfer full fixed-size=3.

### visu_data_setBoxGeometry ()

    void                visu_data_setBoxGeometry            (VisuData *data,
                                                             double geometry[6],
                                                             VisuDataBoxBoundaries bc);

This methods set the size of the box. The boundary conditions can be specified thanks to `bc`.

`data` : | a VisuData object ;
`geometry` : | a 6 floating point array ;. in. array fixed-size=6.
`bc` : | define the boundary conditions.

### visu_data_setBoxGeometryFull ()

    gboolean            visu_data_setBoxGeometryFull        (VisuData *data,
                                                             double geometry[3][3],
                                                             VisuDataBoxBoundaries bc);

This methods set the size of the box. The boundary conditions can be specified thanks to `bc`. The basis set will be rotated by V_Sim to align the given first axis with X, and put the second axis in the XY plane. Further inclusion of nodes with `visu_data_addNodeFromElement()` and friends will automatically apply the rotation if coordinates are given in cartesian. This rotation will stop after any call to `visu_data_applyBoxGeometry()`.

`data` : | a VisuData object ;
`geometry` : | a 9 floating point array ;. in. array fixed-size=9.
`bc` : | define the boundary conditions.
Returns : | FALSE if the given box is planar.

Since 3.6

### visu_data_applyBoxGeometry ()

    void                visu_data_applyBoxGeometry          (VisuData *data);

The box expansion is calculated. From this call, all cartesian coordinates are treated in V_Sim box definition and not a possible full definition.

`data` : | a VisuData object.

### visu_data_getBoxGeometry ()

    float               visu_data_getBoxGeometry            (VisuData *data,
                                                             int vector);

Retrieve the value of a vector defining the bounding box. The vector is chosen with an int, see the visu_data_boxVector enum for more details.

`data` : | a VisuData object ;
`vector` : | an int corresponding to a vector of the box.
Returns : | the value of the required vector (always a positive value for vector = 0, 2 or 5 !).

### visu_data_getNodeBoxFromNumber ()

    gboolean            visu_data_getNodeBoxFromNumber      (VisuData *data,
                                                             guint nodeId,
                                                             int nodeBox[3]);

This method retrieves the value of the box associated to a node (with respect to the unit cell).

`data` : | a VisuData object.
`nodeId` : | the index of the node considered.
`nodeBox` : | the array to store the box of the node.. in. array fixed-size=3.
Returns : | TRUE if everything went well, FALSE otherwise. The box is stored in the nodeBox array.

### visu_data_getNodeBoxFromCoord ()

    gboolean            visu_data_getNodeBoxFromCoord       (VisuData *data,
                                                             float xcart[3],
                                                             int nodeBox[3]);

This method retrieves the value of the box associated to the coordinates of the node (with respect to the unit cell).

`data` : | a VisuData object.
`xcart` : | the coordinates of a node.. in. array fixed-size=3.
`nodeBox` : | the array to store the box of the node.. in. array fixed-size=3.
Returns : | TRUE if everything went well, FALSE otherwise. The box is stored in the nodeBox array.

### visu_data_getBoxVertices ()

    void                visu_data_getBoxVertices            (VisuData *data,
                                                             float v[8][3],
                                                             gboolean withExtension);

All nodes are rendered inside a bounding box, this method can be used to retrieve it. This box is not the drawn box but the box containing all the nodes, included possible extension. To get the box itself, use `visu_data_getBoxMatrix()` instead. One can also get the vertices of the box itself using FALSE as `withExtension` argument.

`data` : | a VisuData object.
`v` : | the position of the eight vertices of the bounding box.. in. array.
`withExtension` : | a boolean.

### visu_data_getBoxSpan ()

    void                visu_data_getBoxSpan                (VisuData *data,
                                                             float span[2]);

Compute the two most far distance from origin in the box. The first is the negative one and the second, the positive one.

`data` : | an VisuData object;
`span` : | a location to store two floats.. in. array fixed-size=2.

### visu_data_getUnit ()

    ToolUnits           visu_data_getUnit                   (VisuData *data);

The lengths of `data` may be given in a certain unit using `visu_data_setUnit()`.

`data` : | a VisuData object.
Returns : | the ToolUnits of `data` or unit_undefined.

Since 3.5

### visu_data_setUnit ()

    gboolean            visu_data_setUnit                   (VisuData *data,
                                                             ToolUnits unit);

The lengths of `data` may be given in a certain unit by calling this routine. If the unit is different from the previously defined, the coordinate are scaled accordingly.

`data` : | a VisuData object.
`unit` : | a ToolUnits flag.
Returns : | TRUE if the unit has been changed.

Since 3.5

### visu_data_getBoundaryConditions ()

    VisuDataBoxBoundaries  visu_data_getBoundaryConditions  (VisuData *data);

Get the boundary conditions defined for `data`.

`data` : | a VisuData object.
Returns : | a VisuDataBoxBoundaries flag.

Since 3.5

### visu_data_setTightBox ()

    void                visu_data_setTightBox               (VisuData *data);

Calculate the box geometry to have a tight box in directions that are not periodic. If some directions are still periodic, the box size in these directions should be setup first with `visu_data_setBoxGeometry()`.

`data` : | a VisuData object.

### visu_data_constrainedElementInTheBox ()

    gboolean            visu_data_constrainedElementInTheBox
                                                            (VisuData *data,
                                                             VisuElement *element);

Check all the nodes of the specified `element` and change their coordinates if they are out of the bounding box. The position of each node is the result of the sum of their own position and of the box translation.

`data` : | a VisuData object ;
`element` : | a VisuElement object.
Returns : | TRUE if `visu_data_createAllNodes()` should be called and the 'NodePositionChanged' should be emitted.

### visu_data_constrainedInTheBox ()

    gboolean            visu_data_constrainedInTheBox       (VisuData *data);

It does the same things that `visu_data_constrainedElementInTheBox()` but for all the VisuElement of the given `data`. I.e. it checks all the nodes and changes their coordinates if they are out of the bounding box. The position of each node is the result of the sum of their own position and of the box translation.

`data` : | a VisuData object.
Returns : | TRUE if `visu_data_createAllNodes()` should be called and the 'NodePositionChanged' should be emitted.

### visu_data_constrainedFree ()

    gboolean            visu_data_constrainedFree           (VisuData *data);

Return all the nodes to their original position, except for the global translation.

`data` : | a VisuData object.
Returns : | TRUE if `visu_data_createAllNodes()` should be called and the 'NodePositionChanged' should be emitted.

### visu_data_getTranslationStatus ()

    gboolean            visu_data_getTranslationStatus      (VisuData *data);

When a translation is applied (even with a [0,0,0] vector), the nodes are shifted to be in the box. This routine returns the translation status of all nodes. If one of them is translated, then return value is TRUE.

`data` : | a VisuData object.
Returns : | if one of the nodes is shifted.

### visu_data_replicate ()

    gboolean            visu_data_replicate                 (VisuData *data,
                                                             float extension[3],
                                                             gboolean *rebuild);

This routine will create (or remove) nodes to expand the initial box to the required size. An extension of 0 means no extension, i.e. the initial box. The extension is done symmetrically in each direction toward negative and positive direction.

If the `rebuild` argument is TRUE, the nodes should be rebuilt (with `visu_data_createAllNodes()`).

To remove added nodes, see `visu_data_restore()`.

`data` : | a VisuData object ;
`extension` : | three floating point values ;. in. array fixed-size=3.
`rebuild` : | a location to store a flag.
Returns : | TRUE if the redraw should be done.

### visu_data_restore ()

    gboolean            visu_data_restore                   (VisuData *data);

Remove all nodes that have been added by a `visu_data_replicate()` call.

`data` : | a VisuData object.
Returns : | TRUE if some nodes has been indeed removed.

### visu_data_getExtension ()

    void                visu_data_getExtension              (VisuData *dataObj,
                                                             float extension[3]);

Using `visu_data_replicate()`, it is possible to duplicate the primitive box in each directions. Use this method to know the current extension. Returned values are positive floating point values. An extension of 0. means that only the primitive box exists, while a value of one means a duplication of one box in each direction of the coordinate.

`dataObj` : | a VisuData object ;
`extension` : | an allocated array to store the values.. in. array fixed-size=3.

### visu_data_getBoxExtens ()

    float*              visu_data_getBoxExtens              (VisuData *dataObj);

This routines returns two float values giving the longest length of the bounding box, with or without extension applied.

`dataObj` : | a VisuData object.
Returns : | two floating point values.

### visu_data_getBoxLengths ()

    void                visu_data_getBoxLengths             (VisuData *dataObj,
                                                             float *ext1,
                                                             float *ext2);

Equivalent function to `visu_data_getBoxExtens()`.

`dataObj` : | a VisuData object ;
`ext1` : | the length scale ;. out caller-allocates.
`ext2` : | .... out caller-allocates.

Since 3.6

### visu_data_getBoxCentre ()

    void                visu_data_getBoxCentre              (VisuData *dataObj,
                                                             float centre[3]);

`centre` contains on output the cartesian coordinates of the centre of the bounding box.

`dataObj` : | a VisuData object ;
`centre` : | coordinates of the centre.. in. array fixed-size=3.

### visu_data_getNodeCoordinates ()

    void                visu_data_getNodeCoordinates        (VisuData *data,
                                                             VisuNode *node,
                                                             float *x,
                                                             float *y,
                                                             float *z);

Wrapper for the function `visu_data_getNodePosition()` in case of call from python.

`data` : | a VisuData object ;
`node` : | a VisuNode object ;
`x` : | the x coordinate.. out caller-allocates.
`y` : | the y coordinate.. out caller-allocates.
`z` : | the z coordinate.. out caller-allocates.

Since 3.6

### visu_data_getNodePosition ()

    void                visu_data_getNodePosition           (VisuData *data,
                                                             VisuNode *node,
                                                             float coord[3]);

### visu_data_getReducedNodePosition ()

    void                visu_data_getReducedNodePosition    (VisuData *data,
                                                             VisuNode *node,
                                                             float red[3]);

### visu_data_getDistanceList ()

    VisuNodeInfo*       visu_data_getDistanceList           (VisuData *data,
                                                             guint nodeId,
                                                             float *minVal);

This routine creates an array of VisuNodeInfo, storing for each node its node id and its distance to `nodeId`. The periodicity is NOT taken into account. The array is not distance sorted, but if `minVal` is provided, it will contain the minimal distance between `nodeId` and the other nodes.

`data` : | a VisuData object ;
`nodeId` : | a node id.
`minVal` : | a location for a float.
Returns : | an array of VisuNodeInfo of size the number of nodes. It is terminated by `nodeId` value itself.

Since 3.5

### visu_data_setNewBasisFromNodes ()

    gboolean            visu_data_setNewBasisFromNodes      (VisuData *data,
                                                             guint nO,
                                                             guint nA,
                                                             guint nB,
                                                             guint nC);

Change the basis set by providing the new basis set from a list of nodes. See also `visu_data_setNewBasis()`. Nodes outside the new box are killed.

`data` : | a VisuData object.
`nO` : | the index of node as origin.
`nA` : | the index of node on X axis.
`nB` : | the index of node as Y axis.
`nC` : | the index of node as Z axis.
Returns : | TRUE if the new basis set is valid.

Since 3.6

### visu_data_setNewBasis ()

    gboolean            visu_data_setNewBasis               (VisuData *data,
                                                             float matA[3][3],
                                                             float O[3]);

Change the basis set of `data` according to the new definition given by `matA` and `O`. Nodes outside the new box are killed. See also `visu_data_setNewBasisFromNodes()` for a convenient function using nodes as basis set definition.

`data` : | a VisuData object.
`matA` : | a basis set definition.
`O` : | the origin cartesian coordinates.
Returns : | TRUE if the new basis set is valid.

Since 3.6

### visu_data_reorder ()

    gboolean            visu_data_reorder                   (VisuData *data,
                                                             VisuData *dataRef);

This routine modifies the node ordering of `data` using the order in `dataRef`. The association is done by nearest neigbours conditions.

`data` : | a VisuData object, to reorder.
`dataRef` : | a VisuData object, to take the order from.
Returns : | TRUE is the reordering is successfull (i.e. all nodes of `data` correspond to one of `dataRef`).

Since 3.6

### visu_data_createNodes ()

    void                visu_data_createNodes               (VisuData *data,
                                                             VisuElement *ele);

This creates the glObjectList that contains all the nodes of the given VisuElement.

`data` : | a VisuData object ;
`ele` : | a VisuElement object.

### visu_data_createNode ()

    void                visu_data_createNode                (VisuData *data,
                                                             VisuNode *node);

This method call the createNode method of the current rendering method for the given node. It also calls the list of the material associated to the given node.

`data` : | a VisuData object ;
`node` : | a VisuNode object.

### visu_data_createAllNodes ()

    void                visu_data_createAllNodes            (VisuData *data);

This create the glObjectList registered that contains all the nodes. This glObjectList is made of all nodes of all element whose attribute rendered is TRUE and translated to their own positions.

This method doesn't ask for redraw and VISU_ADD_REDRAW macro should be called by caller.

`data` : | a VisuData object.

### visu_data_createAllElements ()

    void                visu_data_createAllElements         (VisuData *data);

This method will call the `createOpenGLElementFunc()` method of the current RenderingMethod on all the nodes of the given VisuData.

`data` : | a VisuData object.

### visu_data_emitAskForShowHideNodes ()

    void                visu_data_emitAskForShowHideNodes   (VisuData *data,
                                                             gboolean *redraw);

This methods is used to emit the 'NodeAskForShowHide' signal. This signal asks all modules that may hide nodes to recompute their hiding scheme and put in `redraw` if they have changed something. Since all listeners write in `redraw`, they should modify it with an union. `redraw` is initialised at FALSE before the signal is emitted.

`data` : | a valid VisuData object ;
`redraw` : | a pointer to a location to store if redraw is needed after all listeners have modified the nodes of the given `data`.

### visu_data_emitNodePositionChanged ()

    void                visu_data_emitNodePositionChanged   (VisuData *data);

This method is used to emit the 'NodePositionChanged' signal. This signal asks all modules that are dependent of the nodes' positions to recompute their OpenGL lists.

`data` : | a valid VisuData object.

### visu_data_emitNodeRenderedChange ()

    void                visu_data_emitNodeRenderedChange    (VisuData *data);

This method is used to emit the 'NodeRenderedChanged' signal. This signal asks all modules that are dependent of the nodes' visibility to recompute their OpenGL lists. This signal is usualy emitted after a call to `visu_data_emitAskForShowHideNodes()`.

`data` : | a valid VisuData object.

### visu_data_addTimeout ()

    guint               visu_data_addTimeout                (VisuData *data,
                                                             guint time,
                                                             GSourceFunc func,
                                                             gpointer user_data);

This method is used to add the `func` method to be called regularly at the period `time`. This methos calls in fact `g_timeout_add()` with the given arguments. But the source id is stored internaly and the timeout function is removed automatically when the object `data` is destroyed. It is convienient to add a method working on the VisuData object that is called periodically during the life of te object.

`data` : | a valid VisuData object ;
`time` : | the period of call in milliseconds ;
`func` : | the callback function to be called ;. scope call
`user_data` : | a pointer to some user defined informations.. closure
Returns : | the source id if the calling method need to work with it. To remove the callback, don't use `g_source_remove()` but `visu_data_removeTimeout()` to inform the VisuData object that this source has been removed and not to remove it when the object will be destroyed.

### visu_data_removeTimeout ()

    gboolean            visu_data_removeTimeout             (VisuData *data,
                                                             guint timeoutId);

This method is used to remove a timeout that has been associated to the given `data` (see `visu_data_addTimeout()`).

`data` : | a valid VisuData object ;
`timeoutId` : | a source id.
Returns : | TRUE if the source has been found and removed.

### visu_data_getOpenGLView ()

    VisuOpenGLView*     visu_data_getOpenGLView             (VisuData *data);

Once the object `data` has been initialised, an VisuOpenGLView object is automattically attached and this method can be used to retrieve it.

`data` : | a VisuData object.
Returns : | the VisuOpenGLView attached to the given `data`.. transfer none.

### visu_data_setAngleOfView ()

    gboolean            visu_data_setAngleOfView            (VisuData *data,
                                                             float valueTheta,
                                                             float valuePhi,
                                                             float valueOmega,
                                                             int mask);

This method is used to change the camera orientation for the given `data`. If necessary, this method will emit the 'OpenGLThetaPhiOmega' signal.

`data` : | a VisuData object ;
`valueTheta` : | a floatinf point value in degrees ;
`valuePhi` : | a floating point value in degrees ;
`valueOmega` : | a floating point value in degrees ;
`mask` : | to specified what values will be changed.
Returns : | 1 if the 'OpenGLAskForReDraw' signal should be emitted.

### visu_data_setPositionOfView ()

    gboolean            visu_data_setPositionOfView         (VisuData *data,
                                                             float valueX,
                                                             float valueY,
                                                             int mask);

This method is used to change the camera position for the given `data`. If necessary, this method will emit the 'OpenGLXsYs' signal.

`data` : | a VisuData object ;
`valueX` : | a floatinf point value in the bounding box scale (1 is the size of the bounding box) ;
`valueY` : | a floating point value in bounding box scale ;
`mask` : | to specified what values will be changed.
Returns : | 1 if the 'OpenGLAskForReDraw' signal should be emitted.

### visu_data_setZoomOfView ()

    gboolean            visu_data_setZoomOfView             (VisuData *data,
                                                             float value);

This method is used to change the camera zoom for the given `data`. If necessary, this method will emit the 'OpenGLGross' signal and the 'OpenGLFacetteChanged' signal.

`data` : | a VisuData object ;
`value` : | a positive floating point value.
Returns : | 1 if the 'OpenGLAskForReDraw' signal should be emitted.

### visu_data_setPerspectiveOfView ()

    int                 visu_data_setPerspectiveOfView      (VisuData *data,
                                                             float value);

This method is used to change the camera perspective for the given `data`. If necessary, this method will emit the 'OpenGLPersp' signal and the 'OpenGLFacetteChanged' signal.

`data` : | a VisuData object ;
`value` : | a positive floating point value (> 1.1).
Returns : | 1 if the 'OpenGLAskForReDraw' signal should be emitted.

### visu_data_setSizeOfView ()

    int                 visu_data_setSizeOfView             (VisuData *data,
                                                             guint width,
                                                             guint height);

It changes the size of the OpenGl area and reccompute the OpenGL viewport. Warning : it doesn't change the size of the window.

`data` : | a valid VisuData object ;
`width` : | the new horizontal size ;
`height` : | the new vertical size.
Returns : | 1 if the 'OpenGLAskForReDraw' signal should be emitted.

### visu_data_emitFacettesChanged ()

    void                visu_data_emitFacettesChanged       (VisuData *data);

Emit the 'OpenGLFacetteChanged' signal.

`data` : | a valid VisuData object.

### visu_data_setNodeScalingFunc ()

    void                visu_data_setNodeScalingFunc        (VisuData *data,
                                                             VisuDataScalingFunc scaling);

Change the scaling routine when nodes are drawn.

`data` : | a VisuData object ;
`scaling` : | a scaling routine.. scope call

Since 3.5

### visu_data_getNodeScalingFactor ()

    float               visu_data_getNodeScalingFactor      (VisuData *data,
                                                             VisuNode *node);

One can modify the size of a given node using a routine set by `visu_data_setNodeScalingFunc()`. By default the scaling is 1.

`data` : | a VisuData object.
`node` : | a VisuNode object.
Returns : | the scaling factor to be applied to node `node`.

Since 3.5

### visu_data_getAllObjects ()

    GList*              visu_data_getAllObjects             (void);

This methods is used to retrieve all VisuObject currently allocated in V_Sim. It is usefull to apply some changes on all objects (resources for example).

Returns : | a list of V_Sim own VisuData objects.. transfer none.

### visu_data_removeNodes ()

    void                visu_data_removeNodes               (VisuData *data,
                                                             int *nodeNumbers);

Delete some nodes using this method. The nodes are identified by their number and have not to be of the same element. This routine raises the "NodePopulationDecrease" signal. The `nodeNumbers` argument must be terminated with a negative value.

`data` : | a VisuData object ;
`nodeNumbers` : | an allocated int array with number identifying nodes.. in. array.

### enum VisuDataIterType

    typedef enum
      {
        ITER_NODES_BY_TYPE,
        ITER_NODES_BY_NUMBER,
        ITER_NODES_VISIBLE,
        ITER_NODES_ORIGINAL,
        ITER_ELEMENTS
      } VisuDataIterType;

The kind of iterator to be used on VisuData objects.

`ITER_NODES_BY_TYPE` | run on nodes, as V_Sim internal storage, fastest.
`ITER_NODES_BY_NUMBER` | run on nodes as entered in the input file.
`ITER_NODES_VISIBLE` | run on visible nodes only (internal sort).
`ITER_NODES_ORIGINAL` | run on original nodes only (internal sort).
`ITER_ELEMENTS` | run on elements only.

Since 3.6

### VisuDataIter

    typedef struct {
      VisuData *data;

      guint idMax;
      guint nAllStoredNodes;
      guint nElements;
      guint *nStoredNodes;

      guint iElement;
      VisuNode *node;
      VisuElement *element;

      VisuDataIterType type;
      gboolean init;
    } VisuDataIter;

This structure is an iterator over the nodes of a VisuData object. Create it with `visu_data_iterNew()`. Then the numbers are allocated and correspond to the value of the VisuData object. Use `visu_data_iterStart()` to initialise the iterator for a run over the nodes, `visu_data_iterNext()` to associate `node` and `element` to the next node, or NULL if there is no more node to run over.

VisuData *`data`; | a pointer the iterator is associated to ;
guint `idMax`; | current higher id used to identified nodes.
guint `nAllStoredNodes`; | the total number of stored nodes for the associated VisuData ;
guint `nElements`; | the number of VisuElement for the associated VisuData ;
guint *`nStoredNodes`; | the number of stored nodes for each element ;
guint `iElement`; | the index corresponding to `element` (or -1 if no set);
VisuNode *`node`; | a pointer on a current node ;
VisuElement *`element`; | a pointer on a current element.
VisuDataIterType `type`; | the kind of iterator, see VisuDataIterType.
gboolean `init`; | an internal flag.

### visu_data_iterNew ()

    void                visu_data_iterNew                   (VisuData *data,
                                                             VisuDataIter *iter);

Set values to a VisuDataIter object to iterate over nodes. Its contain is initialised with the data size (number of elements, number of nodes per element...).

`data` : | a VisuData object ;
`iter` : | an alocated iterator.. out caller-allocates. transfer full caller-allocates.

### visu_data_iterStart ()

    void                visu_data_iterStart                 (VisuData *data,
                                                             VisuDataIter *iter);

Initialise the node and element internal pointers for a run over the nodes.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterStartVisible ()

    void                visu_data_iterStartVisible          (VisuData *data,
                                                             VisuDataIter *iter);

Initialise the node and element internal pointers for a run over the visible nodes (see visu_data_iterNextVisible).

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterStartNumber ()

    void                visu_data_iterStartNumber           (VisuData *data,
                                                             VisuDataIter *iter);

Initialise the node and element internal pointers for a run following the node oder.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterRestartNode ()

    void                visu_data_iterRestartNode           (VisuData *data,
                                                             VisuDataIter *iter);

The element internal pointer must be associated. Then, it returns the node pointer to the first node for this element.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterNext ()

    void                visu_data_iterNext                  (VisuData *data,
                                                             VisuDataIter *iter);

Modify node and element internal pointers to the next node, or NULL if none remains.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterNextNode ()

    void                visu_data_iterNextNode              (VisuData *data,
                                                             VisuDataIter *iter);

Modify node internal pointer to the next node, or NULL if none remains. Contrary to `visu_data_iterNext()` it does not go to the next element if one exists.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterNextNodeNumber ()

    void                visu_data_iterNextNodeNumber        (VisuData *data,
                                                             VisuDataIter *iter);

Modify node internal pointer to the next node, increasing the id of the current node. The element internal pointer is also updated accordingly. If no more nodes exist after the given one, node and element internal pointers are set to NULL.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterNextNodeOriginal ()

    void                visu_data_iterNextNodeOriginal      (VisuData *data,
                                                             VisuDataIter *iter);

Modify node internal pointer to the next original node, or NULL if none remains. Contrary to `visu_data_iterNext()` it does not go to the next element if one exists.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

Since 3.6

### visu_data_iterNextElement ()

    void                visu_data_iterNextElement           (VisuData *data,
                                                             VisuDataIter *iter);

Modify element internal pointer to the next element and set node to the first one, or NULL if none remains.

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iterNextVisible ()

    void                visu_data_iterNextVisible           (VisuData *data,
                                                             VisuDataIter *iter);

Go to the next rendered node (changing element if required).

`data` : | a VisuData object ;
`iter` : | a VisuDataIter object.

### visu_data_iter_next ()

    gboolean            visu_data_iter_next                 (VisuDataIter *dataIter);

Run the iterator to go to next item.

`dataIter` : | a VisuDataIter object.
Returns : | TRUE if any item is found, FALSE otherwise.

Since 3.6

### visu_data_iter_next2 ()

    gboolean            visu_data_iter_next2                (VisuDataIter *iter1,
                                                             VisuDataIter *iter2);

Iterator to run on a pair of different nodes.

`iter1` : | a VisuDataIter object.
`iter2` : | a VisuDataIter object.
Returns : | TRUE if any item is found, FALSE otherwise.

Since 3.6

## Property Details

### The `"totalEnergy"` property

      "totalEnergy"              gdouble               : Read / Write / Construct

Total energy of the system (eV).

Allowed values: [-G_MAXFLOAT,G_MAXFLOAT]

Default value: 3.40282e+38

## Signal Details

### The `"BoxSizeChanged"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the box size is changed (because of box duplication for instance).

`dataObj` : | the object which received the signal ;
`user_data` : | user data set when the signal handler was connected.

Since 3.4

### The `"NodeAskForShowHide"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  redraw,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when external modules should recompute their masking effect on nodes. Location pointed by `redraw` must be set to TRUE if the visibility of at least one node is changed.

`dataObj` : | the object which received the signal ;
`redraw` : | a location on a boolean.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"NodeMaterialChanged"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when one or more nodes have changed of color or material.

`dataObj` : | the object which received the signal ;
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"NodePopulationDecrease"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  ids,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the number of nodes has changed, decreasing. `ids` contains all removed ids and is -1 terminated. When emitted, nodes have already been removed, so no external routines should keep pointers on these nodes.

`dataObj` : | the object which received the signal ;
`ids` : | an array of VisuNode ids.
`user_data` : | user data set when the signal handler was connected.

Since 3.4

### The `"NodePopulationDefined"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  nodes,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the population of nodes is created or destroyed. It is possible then to associate new VisuNodeProperty for instance.

`dataObj` : | the object which received the signal ;
`nodes` : | a VisuNodeArray object or NULL.
`user_data` : | user data set when the signal handler was connected.

Since 3.5

### The `"NodePopulationIncrease"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  ids,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the number of nodes has changed, increasing. `ids` contains all new ids and is -1 terminated.

`dataObj` : | the object which received the signal ;
`ids` : | an array of VisuNode ids.
`user_data` : | user data set when the signal handler was connected.

Since 3.4

### The `"NodePositionChanged"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when one or more nodes have moved, because of translations or because the user has moved them manually.

`dataObj` : | the object which received the signal ;
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"NodeRenderedChanged"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when one or more nodes have changed of visibility. Some may have appeared, some may have disappeared.

`dataObj` : | the object which received the signal ;
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLFacetteChanged"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when precision of the drawn object has been changed.

`dataObj` : | the object which received the signal ;
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLGross"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  view,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the camera zoom factor has been changed.

`dataObj` : | the object which received the signal ;
`view` : | the new VisuOpenGLView.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLNearFar"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  view,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the viewing field has been changed.

`dataObj` : | the object which received the signal ;
`view` : | the new VisuOpenGLView.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLPersp"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  view,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the camera perspective factor has been changed.

`dataObj` : | the object which received the signal ;
`view` : | the new VisuOpenGLView.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLThetaPhiOmega"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  view,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the camera angles have been changed.

`dataObj` : | the object which received the signal ;
`view` : | the new VisuOpenGLView.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLWidthHeight"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  view,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the viewing frame has been changed.

`dataObj` : | the object which received the signal ;
`view` : | the new VisuOpenGLView.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"OpenGLXsYs"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  view,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the camera position has been changed.

`dataObj` : | the object which received the signal ;
`view` : | the new VisuOpenGLView.
`user_data` : | user data set when the signal handler was connected.

Since 3.2

### The `"UnitChanged"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gfloat    factor,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the units are changed.

`dataObj` : | the object which received the signal ;
`factor` : | the factor that has been applied.
`user_data` : | user data set when the signal handler was connected.

Since 3.6

### The `"objectFreed"` signal

    void                user_function                      (VisuData *dataObj,
                                                            gpointer  user_data)      : Run Last / No Recursion / No Hooks

Gets emitted when the object is been destroyed. All external objects having a reference on this VisuData should clean it.

`dataObj` : | the object which received the signal ;
`user_data` : | user data set when the signal handler was connected.

Since 3.3