VisuNodeArray

VisuNodeArray — Defines the elementary structure to store informations about an element in a box.

Synopsis

struct              VisuNode;
struct              VisuNodeArray;
struct              VisuNodeArrayClass;
void                (*VisuNodeArrayElementPropertyInit) (VisuElement *element,
                                                         GValue *value);
struct              VisuNodeArrayIter;
enum                VisuNodeArrayIterType;
typedef             VisuNodeInfo;
                    VisuNodeProperty;
void                visu_node_array_allocate            (VisuNodeArray *array,
                                                         GArray *elements,
                                                         GArray *nNodes);
void                visu_node_array_allocateByNames     (VisuNodeArray *array,
                                                         GArray *nNodesPerElement,
                                                         GArray *elementNames);
void                visu_node_array_allocateNodesForElement
                                                        (VisuNodeArray *array,
                                                         guint eleId,
                                                         guint nNodes);
gboolean            visu_node_array_askForShowHide      (VisuNodeArray *array);
gboolean            visu_node_array_compareElements     (VisuNodeArray *data1,
                                                         VisuNodeArray *data2);
void                visu_node_array_freeNodes           (VisuNodeArray *nodeArray);
void                visu_node_array_freeProperty        (VisuNodeArray *nodeArray,
                                                         const char *key);
VisuNode *          visu_node_array_getCopyNode         (VisuNodeArray *nodeArray,
                                                         VisuNode *node);
VisuElement *       visu_node_array_getElement          (VisuNodeArray *data,
                                                         VisuNode *node);
gint                visu_node_array_getElementId        (VisuNodeArray *array,
                                                         VisuElement *element);
GValueArray *       visu_node_array_getElementProperty  (VisuNodeArray *data,
                                                         const gchar *name);
VisuNode *          visu_node_array_getFromId           (VisuNodeArray *array,
                                                         guint number);
float               visu_node_array_getMaxElementSize   (VisuNodeArray *nodes);
guint               visu_node_array_getNElements        (VisuNodeArray *array,
                                                         gboolean physical);
guint               visu_node_array_getNNodes           (VisuNodeArray *array);
VisuNode *          visu_node_array_getNewNode          (VisuNodeArray *nodeArray,
                                                         guint iEle);
gint                visu_node_array_getOriginal         (VisuNodeArray *nodeArray,
                                                         guint nodeId);
VisuNodeProperty *  visu_node_array_getProperty         (VisuNodeArray *nodeArray,
                                                         const char *key);
#define             visu_node_array_getPropertyValue    (nodeArray,
                                                         node,
                                                         key,
                                                         value)
void                visu_node_array_iterNew             (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNext            (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNextElement     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNextList        (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNextNode        (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNextNodeNumber  (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNextNodeOriginal
                                                        (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterNextVisible     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterRestartNode     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterStart           (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterStartList       (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter,
                                                         GList *lst);
void                visu_node_array_iterStartNumber     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
void                visu_node_array_iterStartVisible    (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);
gboolean            visu_node_array_iter_next           (VisuNodeArrayIter *iter);
gboolean            visu_node_array_iter_next2          (VisuNodeArrayIter *iter1,
                                                         VisuNodeArrayIter *iter2);
VisuNodeProperty *  visu_node_array_property_newInteger (VisuNodeArray *nodeArray,
                                                         const char *key);
VisuNodeProperty *  visu_node_array_property_newPointer (VisuNodeArray *nodeArray,
                                                         const char *key,
                                                         GFunc freeFunc,
                                                         GCopyFunc newAndCopyFunc,
                                                         gpointer user_data);
gboolean            visu_node_array_removeAllDuplicateNodes
                                                        (VisuNodeArray *nodeArray);
void                visu_node_array_removeNodes         (VisuNodeArray *nodeArray,
                                                         int *nodeNumbers);
void                visu_node_array_removeNodesOfElement
                                                        (VisuNodeArray *nodeArray,
                                                         VisuElement *element);
GValueArray *       visu_node_array_setElementProperty  (VisuNodeArray *data,
                                                         const gchar *name,
                                                         VisuNodeArrayElementPropertyInit init);
gboolean            visu_node_array_setOriginal         (VisuNodeArray *nodeArray,
                                                         guint nodeId);
gboolean            visu_node_array_switchNumber        (VisuNodeArray *nodeArray,
                                                         guint from,
                                                         guint to);
void                visu_node_array_traceProperty       (VisuNodeArray *array,
                                                         const gchar *id);
void                visu_node_copy                      (VisuNode *nodeTo,
                                                         VisuNode *nodeFrom);
gboolean            visu_node_getVisibility             (VisuNode *node);
void                visu_node_newValues                 (VisuNode *node,
                                                         float xyz[3]);
GValue *            visu_node_property_getValue         (VisuNodeProperty *nodeProp,
                                                         VisuNode *node,
                                                         GValue *value);
void                visu_node_property_setValue         (VisuNodeProperty *nodeProp,
                                                         VisuNode *node,
                                                         GValue *value);
gboolean            visu_node_setCoordinates            (VisuNode *node,
                                                         float xyz[3]);
gboolean            visu_node_setVisibility             (VisuNode *node,
                                                         gboolean visibility);
#define             visu_node_setpropertyValue          (nodeArray,
                                                         node,
                                                         key,
                                                         value)

Object Hierarchy

  GBoxed
   +----VisuNode
  GObject
   +----VisuNodeArray
         +----VisuData

Signals

  "AskForShowHide"                                 : No Hooks
  "ElementRenderingChanged"                        : No Hooks
  "MaterialChanged"                                : No Hooks
  "PopulationDecrease"                             : No Hooks
  "PopulationDefined"                              : No Hooks
  "PopulationIncrease"                             : No Hooks
  "PositionChanged"                                : No Hooks
  "RenderingChanged"                               : No Hooks
  "VisibilityChanged"                              : No Hooks

Description

In V_Sim, elements are drawn in a box. The VisuNode structure is used to represent an instance of an element position somewhere in the box. This element can have several characteristics such as its translation or its visibility.

All nodes are stored in a VisuData object in a two dimensional array. The first dimension is indexed by the VisuElement of the node and the second corresponds to the number of this node for this element. When a node is own by a VisuData, the two integers, that control the indexes in this array, are not negative. See the VisuNode structure for further explanations.

The only basic informations own by the VisuNode structure is basicaly its position. To add further informations (such as orientation for the spin), define a node property using visu_node_array_property_newPointer().

Details

struct VisuNode

struct VisuNode {
  /* coordinates of the node in cartesian coordinates. */
  float xyz[3];

  /* translation */
  float translation[3];

  /* Number of this element in the input file. */
  guint number;
  /* Position in the #VisuData structure. */
  guint posElement, posNode;

  /* A boolean to specify if this node is rendered or not. */
  gboolean rendered;
};

Structure to store primary data of a node.

float xyz[3];

an array of three floating point values that positions the node in (x, y, z) ;. [in][array fixed-size=3]

float translation[3];

an array of three floating point values that translates the node to its drawn position from (x, y, z) ;. [in][array fixed-size=3]

guint number;

an integer that corresponds to its position in the entry file, it references also the node itself in the array 'fromNumberToVisuNode' of the VisuData that contains the node ;

guint posElement;

an integer that is the position of the VisuElement of the node in the array 'fromIntToVisuElement' of the VisuData object that contains the node ;

guint posNode;

an integer that is the position of the node itself in the array 'nodes' of the VisuData object that contains the node ;

gboolean rendered;

a boolean to store if the node is drwn or not.

struct VisuNodeArray

struct VisuNodeArray;

Opaque structure to stores VisuNodeArray object.


struct VisuNodeArrayClass

struct VisuNodeArrayClass {
  GObjectClass parent;
};

Class structure of VisuNodeArray objects.

GObjectClass parent;

private.

VisuNodeArrayElementPropertyInit ()

void                (*VisuNodeArrayElementPropertyInit) (VisuElement *element,
                                                         GValue *value);

Prototype of routine used to initialise an element property.

element :

a VisuElement object ;

value :

a GValue.

Since 3.7


struct VisuNodeArrayIter

struct VisuNodeArrayIter {
  VisuNodeArray *array;

  guint idMax;
  guint nAllStoredNodes;
  guint nElements;


  guint iElement;
  guint nStoredNodes;
  VisuNode *node;
  VisuElement *element;

  VisuNodeArrayIterType type;
  gboolean init;
  GList *lst, *itLst;
};

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

VisuNodeArray *array;

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 iElement;

the index corresponding to element (or -1 if no set);

guint nStoredNodes;

the number of stored nodes for the current element ;

VisuNode *node;

a pointer on a current node ;

VisuElement *element;

a pointer on a current element.

VisuNodeArrayIterType type;

the kind of iterator, see VisuNodeArrayIterType.

gboolean init;

an internal flag.

GList *lst;

an internal list.

GList *itLst;

an internal list iterator.

enum VisuNodeArrayIterType

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

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


VisuNodeInfo

typedef struct VisuNodeInfo_struct VisuNodeInfo;

Some data.

Since 3.5


VisuNodeProperty

typedef struct _VisuNodeProperty VisuNodeProperty;

This structure defines a storage for one property for each node of a given VisuNodeArray. Use visu_node_array_property_newPointer() or visu_node_array_property_newInteger() to create one property.


visu_node_array_allocate ()

void                visu_node_array_allocate            (VisuNodeArray *array,
                                                         GArray *elements,
                                                         GArray *nNodes);

Reallocate the internal arrays to match elements and nNodes.

array :

a VisuNodeArray object.

elements :

the size of nNodes. [in][element-type VisuElement*]

nNodes :

an array giving the number of nodes per element. [in][element-type guint]

visu_node_array_allocateByNames ()

void                visu_node_array_allocateByNames     (VisuNodeArray *array,
                                                         GArray *nNodesPerElement,
                                                         GArray *elementNames);

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

array :

a VisuNodeArray object;

nNodesPerElement :

number of VisuNode per VisuElement;. [in][element-type guint]

elementNames :

names of elements;. [in][element-type utf8]

visu_node_array_allocateNodesForElement ()

void                visu_node_array_allocateNodesForElement
                                                        (VisuNodeArray *array,
                                                         guint eleId,
                                                         guint nNodes);

This routine is used to allocate space for nNodes of a VisuElement. This VisuElement is identified by its internal id, see visu_node_array_getElementId(). If this VisuElement has already enough space in this array, nothing is done, otherwise space is reallocated.

array :

a VisuNodeArray object ;

eleId :

an internal VisuElement id ;

nNodes :

a positive number of nodes.

Since 3.7


visu_node_array_askForShowHide ()

gboolean            visu_node_array_askForShowHide      (VisuNodeArray *array);

This function emits the "AskForShowHide" signal of array. This signal will make all the nodes visible and each hiding objects will have to switch off nodes.

array :

a VisuNodeArray object.

Returns :

TRUE if "VisibilityChanged" signal should be emitted.

Since 3.7


visu_node_array_compareElements ()

gboolean            visu_node_array_compareElements     (VisuNodeArray *data1,
                                                         VisuNodeArray *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_node_array_freeNodes ()

void                visu_node_array_freeNodes           (VisuNodeArray *nodeArray);

Deallocate all nodes of the object and related properties but keep the object alive.

nodeArray :

a VisuNodeArray object.

visu_node_array_freeProperty ()

void                visu_node_array_freeProperty        (VisuNodeArray *nodeArray,
                                                         const char *key);

This method free the given property and all associated data.

nodeArray :

a VisuNodeArray object.

key :

the name of the property to be removed.

visu_node_array_getCopyNode ()

VisuNode *          visu_node_array_getCopyNode         (VisuNodeArray *nodeArray,
                                                         VisuNode *node);

Return the location of an unstored node that is the deep copy of the given node. The returned node is then added in the list of used nodes.

nodeArray :

a VisuNodeArray object ;

node :

a node of the given VisuNodeArray.

Returns :

the location of a newly used node. [transfer none]

visu_node_array_getElement ()

VisuElement *       visu_node_array_getElement          (VisuNodeArray *data,
                                                         VisuNode *node);

This routine gets the VisuElement the node belongs to.

data :

a VisuNodeArray object ;

node :

a VisuNode of this array.

Returns :

a VisuElement, owned by V_Sim. [transfer none]

Since 3.7


visu_node_array_getElementId ()

gint                visu_node_array_getElementId        (VisuNodeArray *array,
                                                         VisuElement *element);

This routines returns the internal id used to represent element, or -1 if not found.

array :

a VisuNodeArray object ;

element :

a VisuElement object.

Returns :

a positive number or -1 if not found.

Since 3.7


visu_node_array_getElementProperty ()

GValueArray *       visu_node_array_getElementProperty  (VisuNodeArray *data,
                                                         const gchar *name);

This routine is used to retrieve an array of GValue for each element of the data array.

data :

a VisuNodeArray object ;

name :

an identifier string.

Returns :

an array of GValue, indexed by the id of each VisuElement of data. [transfer none]

Since 3.7


visu_node_array_getFromId ()

VisuNode *          visu_node_array_getFromId           (VisuNodeArray *array,
                                                         guint number);

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

array :

a VisuNodeArray structure which stores the nodes.

number :

an integer.

Returns :

the found VisuNode or NULL if none corresponds to number. [transfer none]

visu_node_array_getMaxElementSize ()

float               visu_node_array_getMaxElementSize   (VisuNodeArray *nodes);

Calculate the maximum size of all VisuElement used in these nodes.

nodes :

a VisuNodeArray object.

Returns :

a positive size.

visu_node_array_getNElements ()

guint               visu_node_array_getNElements        (VisuNodeArray *array,
                                                         gboolean physical);

The parameter array stores several VisuNode of VisuElement. This routine is used to get the number of VisuElement that are used by this array. Depending on physical value, the number of VisuElement representing physical element or not is retrieved. The actual returned number of VisuElement take into account only elements with a positive number of nodes.

array :

a VisuNodeArray object ;

physical :

a boolean.

Returns :

a positive number.

Since 3.7


visu_node_array_getNNodes ()

guint               visu_node_array_getNNodes           (VisuNodeArray *array);

This routines returns the number of VisuNode stored in array.

array :

a VisuNodeArray object.

Returns :

a positive number.

Since 3.7


visu_node_array_getNewNode ()

VisuNode *          visu_node_array_getNewNode          (VisuNodeArray *nodeArray,
                                                         guint iEle);

Return the location of an unstored node for the given VisuElement. The returned node is then added in the list of used nodes.

nodeArray :

a VisuNodeArray object ;

iEle :

an integer between 0 and nodeArray->priv->elements->lens - 1.

Returns :

the location of a newly used node. [transfer none]

visu_node_array_getOriginal ()

gint                visu_node_array_getOriginal         (VisuNodeArray *nodeArray,
                                                         guint nodeId);

Test if the given nodeId is an original or a replica for the periodisation.

nodeArray :

a VisuNodeArray object.

nodeId :

a node id.

Returns :

TRUE for an original node.

visu_node_array_getProperty ()

VisuNodeProperty *  visu_node_array_getProperty         (VisuNodeArray *nodeArray,
                                                         const char *key);

This method is used to retrieve the node property associated to the given key.

nodeArray :

a VisuNodeArray object ;

key :

a string.

Returns :

a VisuNodeProperty. [transfer none]

visu_node_array_getPropertyValue()

#define             visu_node_array_getPropertyValue(nodeArray, node, key, value)

This method is used to retrieve some data associated to the specified node, stored in the given data. These return data should not be freed after used. The read value is stored in the given GValue pointer. This GValue must be of the right type, depending on the creation of the VisuNodeProperty.

nodeArray :

a VisuNodeArray object ;

node :

a VisuNode object ;

key :

a string ;

value :

an initialise GValue location.

Returns :

some data associated to the key, stored the given GValue location.

visu_node_array_iterNew ()

void                visu_node_array_iterNew             (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

an alocated iterator. [out caller-allocates][transfer full]

visu_node_array_iterNext ()

void                visu_node_array_iterNext            (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterNextElement ()

void                visu_node_array_iterNextElement     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterNextList ()

void                visu_node_array_iterNextList        (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

Since 3.7


visu_node_array_iterNextNode ()

void                visu_node_array_iterNextNode        (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterNextNodeNumber ()

void                visu_node_array_iterNextNodeNumber  (VisuNodeArray *array,
                                                         VisuNodeArrayIter *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.

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterNextNodeOriginal ()

void                visu_node_array_iterNextNodeOriginal
                                                        (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

Since 3.6


visu_node_array_iterNextVisible ()

void                visu_node_array_iterNextVisible     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterRestartNode ()

void                visu_node_array_iterRestartNode     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterStart ()

void                visu_node_array_iterStart           (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterStartList ()

void                visu_node_array_iterStartList       (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter,
                                                         GList *lst);

Set values to a VisuNodeArrayIter object to iterate over nodes of the given list.

array :

a VisuNodeArray object ;

iter :

an alocated iterator. [out caller-allocates][transfer full]

lst :

a list of node ids to iterate on. [element-type guint][transfer full]

Since 3.7


visu_node_array_iterStartNumber ()

void                visu_node_array_iterStartNumber     (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iterStartVisible ()

void                visu_node_array_iterStartVisible    (VisuNodeArray *array,
                                                         VisuNodeArrayIter *iter);

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

array :

a VisuNodeArray object ;

iter :

a VisuNodeArrayIter object.

visu_node_array_iter_next ()

gboolean            visu_node_array_iter_next           (VisuNodeArrayIter *iter);

Run the iterator to go to next item.

iter :

a VisuNodeArrayIter object.

Returns :

TRUE if any item is found, FALSE otherwise.

Since 3.6


visu_node_array_iter_next2 ()

gboolean            visu_node_array_iter_next2          (VisuNodeArrayIter *iter1,
                                                         VisuNodeArrayIter *iter2);

Iterator to run on a pair of different nodes.

iter1 :

a VisuNodeArrayIter object.

iter2 :

a VisuNodeArrayIter object.

Returns :

TRUE if any item is found, FALSE otherwise.

Since 3.6


visu_node_array_property_newInteger ()

VisuNodeProperty *  visu_node_array_property_newInteger (VisuNodeArray *nodeArray,
                                                         const char *key);

This method creates and allocates a new area to store nodes associated integer values. This is the same than visu_node_array_property_newPointer() but for static integers instead of pointers as data.

nodeArray :

a VisuNodeArray object ;

key :

a string.

Returns :

the newly created VisuNodeProperty object. [transfer none]

visu_node_array_property_newPointer ()

VisuNodeProperty *  visu_node_array_property_newPointer (VisuNodeArray *nodeArray,
                                                         const char *key,
                                                         GFunc freeFunc,
                                                         GCopyFunc newAndCopyFunc,
                                                         gpointer user_data);

This method creates and allocates a new area to store nodes associated data that can be retrieve with the key. These data are pointers on allocated memory locations. When the property is removed with the visu_node_freePropertry (or the associated VisuNodeArray is free) the area is free and freeFunc is called for each token (or g_free() if freeFunc is NULL).

The method newAndCopyFunc is used when the number of nodes is increased, if the const gpointer of the GCopyFunc is not NULL, then we require a copy, if it is NULL, then the routine must create a new token with default values.

If the property already exists, it is returned.

nodeArray :

a VisuNodeArray object ;

key :

a string ;

freeFunc :

a method to free each token (can be NULL). [allow-none][scope call]

newAndCopyFunc :

a method to create or copy each token. [scope call]

user_data :

a user defined pointer that will be given to the free and copy routine. [closure]

Returns :

the newly created VisuNodeProperty object or the existing one. [transfer none]

visu_node_array_removeAllDuplicateNodes ()

gboolean            visu_node_array_removeAllDuplicateNodes
                                                        (VisuNodeArray *nodeArray);

Remove all nodes that are not original in the box.

nodeArray :

a VisuNodeArray object.

Returns :

TRUE if some nodes have been removed.

visu_node_array_removeNodes ()

void                visu_node_array_removeNodes         (VisuNodeArray *nodeArray,
                                                         int *nodeNumbers);

Remove the given VisuNode from the nodeArray. The properties are also updated.

nodeArray :

a VisuNodeArray object.

nodeNumbers :

an array of integers (negative terminated). [in][array]

visu_node_array_removeNodesOfElement ()

void                visu_node_array_removeNodesOfElement
                                                        (VisuNodeArray *nodeArray,
                                                         VisuElement *element);

Remove all the VisuNode from the element element. The properties are also updated.

nodeArray :

a VisuNodeArray object.

element :

a VisuElement object.

Since 3.7


visu_node_array_setElementProperty ()

GValueArray *       visu_node_array_setElementProperty  (VisuNodeArray *data,
                                                         const gchar *name,
                                                         VisuNodeArrayElementPropertyInit init);

Create a new array to stores properties related to elements. If the property name already exists the previous one is destroyed. The init routine is called for each VisuElement of the data.

data :

a VisuNodeArray object.

name :

a string to identify the property.

init :

an init routine. [scope call]

Returns :

a newly allocated array. [transfer none]

Since 3.7


visu_node_array_setOriginal ()

gboolean            visu_node_array_setOriginal         (VisuNodeArray *nodeArray,
                                                         guint nodeId);

Test if the given nodeId is an original or a replica for the periodisation.

nodeArray :

a VisuNodeArray object.

nodeId :

a node id.

Returns :

TRUE for an original node.

visu_node_array_switchNumber ()

gboolean            visu_node_array_switchNumber        (VisuNodeArray *nodeArray,
                                                         guint from,
                                                         guint to);

Two nodes of nodeArray switches their number.

nodeArray :

a VisuNodeArray object.

from :

a node id.

to :

another node id.

Returns :

TRUE if number is switched.

Since 3.6


visu_node_array_traceProperty ()

void                visu_node_array_traceProperty       (VisuNodeArray *array,
                                                         const gchar *id);

This is a debug method. It outputs on stderr the values for all nodes of the property id.

array :

a VisuNodeArray object ;

id :

a property name.

visu_node_copy ()

void                visu_node_copy                      (VisuNode *nodeTo,
                                                         VisuNode *nodeFrom);

Copy all attributes of the object nodeFrom to nodeTo.

nodeTo :

an allocated VisuNode object ;

nodeFrom :

an allocated VisuNode object.

visu_node_getVisibility ()

gboolean            visu_node_getVisibility             (VisuNode *node);

This method is used get the status of the drawing state of a node.

node :

a VisuNode object.

Returns :

true if the node is rendered, false otherwise.

visu_node_newValues ()

void                visu_node_newValues                 (VisuNode *node,
                                                         float xyz[3]);

Set the coordinates and set all other values to default.

node :

an allocated VisuNode object ;

xyz :

the coordinates to set. [in][array fixed-size=3]

visu_node_property_getValue ()

GValue *            visu_node_property_getValue         (VisuNodeProperty *nodeProp,
                                                         VisuNode *node,
                                                         GValue *value);

This method is used to retrieve some data associated to the specified node, stored in the given data. These return data should not be freed after used. The read value is stored in the given GValue pointer. This GValue must be of the right type, depending on the creation of the VisuNodeProperty.

nodeProp :

a VisuNodeArray object ;

node :

a VisuNode object ;

value :

an initialise GValue location.

Returns :

some data associated to the key, stored the given GValue location.

visu_node_property_setValue ()

void                visu_node_property_setValue         (VisuNodeProperty *nodeProp,
                                                         VisuNode *node,
                                                         GValue *value);

This method is used to store some values associated with the given node of the given nodeArray. These values can be pointers to anything allocated (will be free automatically when the property is deleted) or they can be static values. This depends on the construction of the node property. These values can be retrieved with the visu_node_property_getValue() method.

See visu_node_array_getProperty() to get a property by its name.

nodeProp :

a VisuNodeProperty object ;

node :

a VisuNode object ;

value :

A GValue pointer this the value to be stored.

visu_node_setCoordinates ()

gboolean            visu_node_setCoordinates            (VisuNode *node,
                                                         float xyz[3]);

This method is used to change coordinates of node.

node :

a VisuNode object ;

xyz :

new cartesian coordinates. [array fixed-size=3]

Returns :

TRUE if the calling method should emit "PositionChanged" signal.

Since 3.7


visu_node_setVisibility ()

gboolean            visu_node_setVisibility             (VisuNode *node,
                                                         gboolean visibility);

This method is used to turn on or off the drawing of the specified node.

node :

a VisuNode object ;

visibility :

a boolean.

Returns :

true if the calling method should emit the VisuNodeArray::VisibilityChanged signal.

visu_node_setpropertyValue()

#define             visu_node_setpropertyValue(nodeArray, node, key, value)

This method is used to store some values associated with the given node of the given nodeArray. These values can be pointers to anything allocated (will be free automatically when the property is deleted) or they can be static values. This depends on the construction of the node property. These values are described by the key, and can be retrieved with the visu_node_array_getPropertyValue() method.

See visu_node_property_setValue() to directly set a value associated to a node.

nodeArray :

a VisuNodeArray object ;

node :

a VisuNode object ;

key :

a string ;

value :

A GValue pointer this the value to be stored.

Signal Details

The "AskForShowHide" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        gpointer       redraw,
                                                        gpointer       user_data)      : 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.

nodes :

the object which received the signal ;

redraw :

a location on a boolean. [out caller-allocates][type gboolean]

user_data :

user data set when the signal handler was connected.

Since 3.2


The "ElementRenderingChanged" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        GObject       *ele,
                                                        gpointer       user_data)      : No Hooks

Gets emitted when the rendering characteristic of elements are changed, like their shape or specific colour.

nodes :

the object which received the signal ;

ele :

the VisuElement nodes have changed or NULL for all elements. [allow-none]

user_data :

user data set when the signal handler was connected.

Since 3.7


The "MaterialChanged" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        gpointer       user_data)      : No Hooks

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

nodes :

the object which received the signal ;

user_data :

user data set when the signal handler was connected.

Since 3.6


The "PopulationDecrease" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        gpointer       ids,
                                                        gpointer       user_data)      : 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.

nodes :

the object which received the signal ;

ids :

an array of VisuNode ids. [element-type gint][array]

user_data :

user data set when the signal handler was connected.

Since 3.4


The "PopulationDefined" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        guint          nEle,
                                                        gpointer       user_data)      : No Hooks

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

nodes :

the object which received the signal ;

nEle :

the actual allocated number of VisuElement of nodes.

user_data :

user data set when the signal handler was connected.

Since 3.5


The "PopulationIncrease" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        gpointer       ids,
                                                        gpointer       user_data)      : No Hooks

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

nodes :

the object which received the signal ;

ids :

an array of VisuNode ids. [element-type gint][array]

user_data :

user data set when the signal handler was connected.

Since 3.4


The "PositionChanged" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        GObject       *ele,
                                                        gpointer       user_data)      : No Hooks

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

nodes :

the object which received the signal ;

ele :

the VisuElement nodes have moved or NULL for all elements. [allow-none]

user_data :

user data set when the signal handler was connected.

Since 3.2


The "RenderingChanged" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        GObject       *ele,
                                                        gpointer       user_data)      : No Hooks

Gets emitted when the rendering characteristic of nodes are changed, like their shape or specific colour. For a signal on generic colours (like the inherited element colour), listen to VisuNodeArray::MaterialChanged signal instead.

nodes :

the object which received the signal ;

ele :

the VisuElement nodes have changed or NULL for all elements. [allow-none]

user_data :

user data set when the signal handler was connected.

Since 3.7


The "VisibilityChanged" signal

void                user_function                      (VisuNodeArray *nodes,
                                                        gpointer       user_data)      : No Hooks

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

nodes :

the object which received the signal ;

user_data :

user data set when the signal handler was connected.

Since 3.2