VisuNodeArray

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

Functions

void visu_node_newValues ()
void visu_node_copy ()
gboolean visu_node_setVisibility ()
gboolean visu_node_getVisibility ()
gboolean visu_node_setCoordinates ()
void (*VisuNodeArrayElementPropertyInit) ()
void visu_node_array_allocate ()
void visu_node_array_allocateByNames ()
void visu_node_array_freeNodes ()
void visu_node_array_allocateNodesForElement ()
void visu_node_array_populationIncrease ()
void visu_node_array_removeNodes ()
void visu_node_array_removeNodesOfElement ()
gboolean visu_node_array_removeAllDuplicateNodes ()
gint visu_node_array_getOriginal ()
gboolean visu_node_array_setOriginal ()
gboolean visu_node_array_compareElements ()
VisuElement * visu_node_array_getElement ()
VisuNode * visu_node_array_setElement ()
gboolean visu_node_array_containsElement ()
gint visu_node_array_getElementId ()
guint visu_node_array_getNNodes ()
guint visu_node_array_getNOriginalNodes ()
guint visu_node_array_getNElements ()
GArray * visu_node_array_setElementProperty ()
GArray * visu_node_array_getElementProperty ()
VisuNode * visu_node_array_getNewNode ()
VisuNode * visu_node_array_getNewNodeForId ()
gboolean visu_node_array_switchNumber ()
VisuNode * visu_node_array_copyNode ()
VisuNode * visu_node_array_getFromId ()
gboolean visu_node_array_setNodeVisibility ()
void visu_node_array_shiftNodes ()
void visu_node_array_moveNodes ()
void visu_node_array_rotateNodes ()
VisuNodeProperty * visu_node_array_property_newPointer ()
VisuNodeProperty * visu_node_array_property_newFloatArray ()
VisuNodeProperty * visu_node_array_property_newInteger ()
void visu_node_array_freeProperty ()
void visu_node_array_traceProperty ()
VisuNodeProperty * visu_node_array_getProperty ()
#define visu_node_setpropertyValue()
void visu_node_property_setValue ()
#define visu_node_array_getPropertyValue()
GValue * visu_node_property_getValue ()
VisuNodeArray * visu_node_property_getArray ()
void visu_node_property_reset ()
gboolean (*VisuNodeArrayIterFunc) ()
void visu_node_array_iter_new ()
void visu_node_array_iterStart ()
void visu_node_array_iterStartVisible ()
void visu_node_array_iterStartNumber ()
void visu_node_array_iterStartList ()
void visu_node_array_iterStartArray ()
void visu_node_array_iterRestartNode ()
void visu_node_array_iterWhere ()
void visu_node_array_iterNext ()
void visu_node_array_iterNextNode ()
void visu_node_array_iterNextNodeNumber ()
void visu_node_array_iterNextNodeOriginal ()
void visu_node_array_iterNextList ()
void visu_node_array_iterNextArray ()
void visu_node_array_iterNextElement ()
void visu_node_array_iterNextVisible ()
gboolean visu_node_array_iter_next ()
gboolean visu_node_array_iter_next2 ()

Properties

Signals

Types and Values

Object Hierarchy

    GBoxed
    ╰── VisuNode
    GObject
    ╰── ToolDbgObj
        ╰── VisuNodeArray
            ╰── VisuData

Implemented Interfaces

VisuNodeArray implements VisuMaskable.

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

Functions

visu_node_newValues ()

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

Set the coordinates and set all other values to default.

Parameters

node

an allocated VisuNode object ;

 

xyz

the coordinates to set.

[in][array fixed-size=3]

visu_node_copy ()

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

Copy all attributes of the object nodeFrom to nodeTo .

Parameters

nodeTo

an allocated VisuNode object ;

 

nodeFrom

an allocated VisuNode object.

 

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.

Parameters

node

a VisuNode object ;

 

visibility

a boolean.

 

Returns

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


visu_node_getVisibility ()

gboolean
visu_node_getVisibility (VisuNode *node);

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

Parameters

node

a VisuNode object.

 

Returns

true if the node is rendered, false otherwise.


visu_node_setCoordinates ()

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

This method is used to change coordinates of node .

Parameters

node

a VisuNode object ;

 

xyz

new cartesian coordinates.

[array fixed-size=3]

Returns

TRUE if the calling method should emit “position-changed” signal.

Since: 3.7


VisuNodeArrayElementPropertyInit ()

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

Prototype of routine used to initialise an element property.

Parameters

element

a VisuElement object ;

 

value

a GValue.

 

Since: 3.7


visu_node_array_allocate ()

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

Reallocate the internal arrays to match elements and nNodes .

Parameters

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.

Parameters

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_freeNodes ()

void
visu_node_array_freeNodes (VisuNodeArray *nodeArray);

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

Parameters

nodeArray

a VisuNodeArray object.

 

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.

Parameters

array

a VisuNodeArray object ;

 

eleId

an internal VisuElement id ;

 

nNodes

a positive number of nodes.

 

Since: 3.7


visu_node_array_populationIncrease ()

void
visu_node_array_populationIncrease (VisuNodeArray *nodeArray,
                                    GArray *ids);

Emits the “PopulationIncrease” signal.

Parameters

nodeArray

a VisuNodeArray object.

 

ids

a list of node ids.

[element-type int][allow-none]

Since: 3.8


visu_node_array_removeNodes ()

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

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

Parameters

nodeArray

a VisuNodeArray object.

 

nodeNumbers

an array of integers (negative terminated).

[element-type guint]

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.

Parameters

nodeArray

a VisuNodeArray object.

 

element

a VisuElement object.

 

Since: 3.7


visu_node_array_removeAllDuplicateNodes ()

gboolean
visu_node_array_removeAllDuplicateNodes
                               (VisuNodeArray *nodeArray);

Remove all nodes that are not original in the box.

Parameters

nodeArray

a VisuNodeArray object.

 

Returns

TRUE if some nodes have been removed.


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.

Parameters

nodeArray

a VisuNodeArray object.

 

nodeId

a node id.

 

Returns

the original node index or -1 if nodeId is original.


visu_node_array_setOriginal ()

gboolean
visu_node_array_setOriginal (VisuNodeArray *nodeArray,
                             guint nodeId);

Make nodeId an original node.

Parameters

nodeArray

a VisuNodeArray object.

 

nodeId

a node id.

 

Returns

TRUE if nodeId was not original.


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.

Parameters

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_getElement ()

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

This routine gets the VisuElement the node belongs to.

Parameters

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_setElement ()

VisuNode *
visu_node_array_setElement (VisuNodeArray *data,
                            VisuNode *node,
                            const VisuElement *element);

Change the nature of the VisuElement of node to be element .

Parameters

data

a VisuNodeArray object.

 

node

a VisuNode pointer.

 

element

a VisuElement object.

 

Returns

the new location of the VisuNode.

[transfer none]

Since: 3.8


visu_node_array_containsElement ()

gboolean
visu_node_array_containsElement (const VisuNodeArray *array,
                                 const VisuElement *element);

Tests if element is contained in array . element may be part of array but without nodes.

Parameters

array

a VisuNodeArray object.

 

element

a VisuElement object.

 

Returns

TRUE, if array contains element .

Since: 3.8


visu_node_array_getElementId ()

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

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

Parameters

array

a VisuNodeArray object ;

 

element

a VisuElement object.

 

Returns

a positive number or -1 if not found.

Since: 3.7


visu_node_array_getNNodes ()

guint
visu_node_array_getNNodes (const VisuNodeArray *array);

This routines returns the number of VisuNode stored in array .

Parameters

array

a VisuNodeArray object.

 

Returns

a positive number.

Since: 3.7


visu_node_array_getNOriginalNodes ()

guint
visu_node_array_getNOriginalNodes (const VisuNodeArray *array);

This routines returns the number of original VisuNode stored in array .

Parameters

array

a VisuNodeArray object.

 

Returns

a positive number.

Since: 3.7


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.

Parameters

array

a VisuNodeArray object ;

 

physical

a boolean.

 

Returns

a positive number.

Since: 3.7


visu_node_array_setElementProperty ()

GArray *
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 .

Parameters

data

a VisuNodeArray object.

 

name

a string to identify the property.

 

init

an init routine.

[scope call]

Returns

a newly allocated array.

[transfer none][element-type GLib.Value]

Since: 3.7


visu_node_array_getElementProperty ()

GArray *
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.

Parameters

data

a VisuNodeArray object ;

 

name

an identifier string.

 

Returns

an array of GValue, indexed by the id of each VisuElement of data .

[transfer none][element-type GLib.Value]

Since: 3.7


visu_node_array_getNewNode ()

VisuNode *
visu_node_array_getNewNode (VisuNodeArray *nodeArray,
                            const VisuElement *element);

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

Parameters

nodeArray

a VisuNodeArray object ;

 

element

a VisuElement object.

 

Returns

the location of a newly used node.

[transfer none]

Since: 3.8


visu_node_array_getNewNodeForId ()

VisuNode *
visu_node_array_getNewNodeForId (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.

Parameters

nodeArray

a VisuNodeArray object ;

 

iEle

the id used in nodeArray to index a VisuElement.

 

Returns

the location of a newly used node.

[transfer none]


visu_node_array_switchNumber ()

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

Two nodes of nodeArray switches their number.

Parameters

nodeArray

a VisuNodeArray object.

 

from

a node id.

 

to

another node id.

 

Returns

TRUE if number is switched.

Since: 3.6


visu_node_array_copyNode ()

VisuNode *
visu_node_array_copyNode (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.

Parameters

nodeArray

a VisuNodeArray object ;

 

node

a node of the given VisuNodeArray.

 

Returns

the location of a newly used node.

[transfer none]


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.

Parameters

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_setNodeVisibility ()

gboolean
visu_node_array_setNodeVisibility (VisuNodeArray *nodeArray,
                                   guint id,
                                   gboolean status);

Change the visibility of node id in nodeArray . If id is out of bound, nothing is done and no error raised. If visibility is indeed changed, then “VisibilityChanged” signal is emitted.

Parameters

nodeArray

a VisuNodeArray object.

 

id

a node id.

 

status

a boolean.

 

Returns

TRUE if visibility of node id is indeed changed.

Since: 3.8


visu_node_array_shiftNodes ()

void
visu_node_array_shiftNodes (VisuNodeArray *array,
                            const GArray *ids,
                            const float delta[3]);

Apply delta on the coordinates of every nodes in ids .

Parameters

array

a VisuNodeArray object.

 

ids

a set of VisuNode ids.

[element-type uint]

delta

a shift in cartesian coordinates.

[array fixed-size=3]

Since: 3.8


visu_node_array_moveNodes ()

void
visu_node_array_moveNodes (VisuNodeArray *array,
                           const GArray *ids,
                           const GArray *xyz);

Apply translations on all nodes defined by ids . Displacements are read from xyz which is an array containing as many float triplets as nodes in ids.

Parameters

array

a VisuNodeArray object.

 

ids

a set of VisuNode ids.

[element-type uint]

xyz

a set of cartesian displacements.

[element-type float]

Since: 3.8


visu_node_array_rotateNodes ()

void
visu_node_array_rotateNodes (VisuNodeArray *array,
                             const GArray *ids,
                             const float axis[3],
                             const float center[3],
                             float angle);

Apply the rotation defined by angle along axis passing by center to all nodes referenced in ids .

Parameters

array

a VisuNodeArray object.

 

ids

a set of VisuNode ids.

[element-type uint]

axis

an axis orientation.

[array fixed-size=3]

center

point coordinates.

[array fixed-size=3]

angle

an angle in degrees.

 

Since: 3.8


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.

Parameters

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_property_newFloatArray ()

VisuNodeProperty *
visu_node_array_property_newFloatArray
                               (VisuNodeArray *nodeArray,
                                const char *key,
                                guint len);

This method creates and allocates a new area to store nodes associated data that can be retrieve with the key . These data are constant float arrays of length len .

If the property already exists, it is returned.

Parameters

nodeArray

a VisuNodeArray object ;

 

key

a string ;

 

len

the number of floats to be stored per node.

 

Returns

the newly created VisuNodeProperty object or the existing one.

[transfer none]

Since: 3.8


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.

Parameters

nodeArray

a VisuNodeArray object ;

 

key

a string.

 

Returns

the newly created VisuNodeProperty object.

[transfer none]


visu_node_array_freeProperty ()

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

This method free the given property and all associated data.

Parameters

nodeArray

a VisuNodeArray object.

 

key

the name of the property to be removed.

 

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 .

Parameters

array

a VisuNodeArray object ;

 

id

a property name.

 

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 .

Parameters

nodeArray

a VisuNodeArray object ;

 

key

a string.

 

Returns

a VisuNodeProperty.

[transfer none]


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.

Parameters

nodeArray

a VisuNodeArray object ;

 

node

a VisuNode object ;

 

key

a string ;

 

value

A GValue pointer this the value to be stored.

 

visu_node_property_setValue ()

void
visu_node_property_setValue (VisuNodeProperty *nodeProp,
                             const VisuNode *node,
                             const 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.

Parameters

nodeProp

a VisuNodeProperty object ;

 

node

a VisuNode object ;

 

value

A GValue pointer this the value to be stored.

 

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.

Parameters

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_property_getValue ()

GValue *
visu_node_property_getValue (const VisuNodeProperty *nodeProp,
                             const 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.

Parameters

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_getArray ()

VisuNodeArray *
visu_node_property_getArray (const VisuNodeProperty *nodeProp);

Retrieve the VisuNodeArray nodeProp is attached to.

Parameters

nodeProp

a VisuNodeProperty structure.

 

Returns

the VisuNodeArray nodeProp is attached to.

[transfer none]

Since: 3.8


visu_node_property_reset ()

void
visu_node_property_reset (VisuNodeProperty *prop);

Reset to zero all values, deallocating allocated memory, if any.

Parameters

prop

A VisuNodeProperty object.

 

Since: 3.8


VisuNodeArrayIterFunc ()

gboolean
(*VisuNodeArrayIterFunc) (VisuNodeArray *array,
                          const VisuNodeArrayIter *iter,
                          gpointer data);

Prototype of function that evaluates a boolean condition on a given node in a node iteration.

Parameters

array

the VisuNodeArray object the function deals with.

[transfer full]

iter

the VisuNodeArrayIter object the function works on.

 

data

some user data.

[closure]

Since: 3.8


visu_node_array_iter_new ()

void
visu_node_array_iter_new (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...).

Parameters

array

a VisuNodeArray object ;

 

iter

an alocated iterator.

[out caller-allocates][transfer full]

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.

Parameters

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

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object.

 

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.

Parameters

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.

Parameters

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 none]

Since: 3.7


visu_node_array_iterStartArray ()

void
visu_node_array_iterStartArray (VisuNodeArray *array,
                                VisuNodeArrayIter *iter,
                                GArray *arr);

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

Parameters

array

a VisuNodeArray object ;

 

iter

an alocated iterator.

[out caller-allocates][transfer full]

arr

an array of node ids to iterate on.

[element-type guint][transfer full]

Since: 3.8


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.

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object.

 

visu_node_array_iterWhere ()

void
visu_node_array_iterWhere (VisuNodeArray *array,
                           VisuNodeArrayIter *iter,
                           VisuNodeArrayIterFunc where,
                           gpointer data);

Starts iter to iterate on nodes of array , when the condition defined by where evaluates to TRUE. iter is then to be used with visu_node_array_iterNextArray().

Parameters

array

a VisuNodeArray object ;

 

iter

an alocated iterator.

[out caller-allocates][transfer full]

where

the function to evaluate on each node.

[closure data][scope call]

data

user data.

[closure][allow-none]

Since: 3.8


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.

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object.

 

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.

Parameters

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.

Parameters

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.

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object.

 

Since: 3.6


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.

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object.

 

Since: 3.7


visu_node_array_iterNextArray ()

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

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

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object.

 

Since: 3.8


visu_node_array_iterNextElement ()

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

Modify element internal pointer to the next element and set node to the first one, or NULL if none remains. If allowEmpty is TRUE, this iterator may return an element with no nodes, otherwise, it skips elements with no nodes.

Parameters

array

a VisuNodeArray object ;

 

iter

a VisuNodeArrayIter object ;

 

allowEmpty

a boolean.

 

visu_node_array_iterNextVisible ()

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

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

Parameters

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.

Parameters

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.

Parameters

iter1

a VisuNodeArrayIter object.

 

iter2

a VisuNodeArrayIter object.

 

Returns

TRUE if any item is found, FALSE otherwise.

Since: 3.6

Types and Values

struct VisuNodeArray

struct VisuNodeArray;

Opaque structure to stores VisuNodeArray object.


struct VisuNodeArrayClass

struct VisuNodeArrayClass {
  VisuObjectClass parent;
};

Class structure of VisuNodeArray objects.

Members

VisuObjectClass parent;

private.

 

enum VisuNodeArrayIterType

The kind of iterator to be used on VisuData objects.

Members

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_FROM_LIST

run on nodes as given in a GList.

 

ITER_NODES_FROM_ARRAY

run on nodes as given in a GArray.

 

ITER_NODES_VISIBLE

run on visible nodes only (internal sort).

 

ITER_NODES_ORIGINAL

run on original nodes only (internal sort).

 

ITER_NODES_FOR_ELEMENT

run on all nodes of a specific element.

 

ITER_ELEMENTS

run on elements only.

 

Since: 3.6


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 *itLst;
  GArray *arr;
  guint itArr;
};

This structure is an iterator over the nodes of a VisuData object. Create it with visu_node_array_iter_new(). 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.

Members

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 *itLst;

an internal list iterator.

 

GArray *arr;

an iternal list of nodes to iterate on.

 

guint itArr;

an internal iterator on array.

 

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.

Property Details

The “elements” property

  “elements”                 GArray *

all elements.

Flags: Read


The “n-nodes” property

  “n-nodes”                  guint

total number of nodes.

Flags: Read

Default value: 0


The “n-original-nodes” property

  “n-original-nodes”         guint

total number of original nodes.

Flags: Read

Default value: 0

Signal Details

The “ElementMaskableChanged” signal

void
user_function (VisuNodeArray *nodes,
               VisuElement   *ele,
               gpointer       user_data)

Gets emitted when the maskable characteristic of one element changes.

Parameters

nodes

the object which received the signal ;

 

ele

the VisuElement that has its visibility changed

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8


The “ElementVisibilityChanged” signal

void
user_function (VisuNodeArray *nodes,
               VisuElement   *ele,
               gpointer       user_data)

Gets emitted when the visibility characteristic of one element changes.

Parameters

nodes

the object which received the signal ;

 

ele

the VisuElement that has its visibility changed

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8


The “PopulationDecrease” signal

void
user_function (VisuNodeArray *nodes,
               GArray        *ids,
               gpointer       user_data)

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

Parameters

nodes

the object which received the signal ;

 

ids

an array of VisuNode ids.

[element-type guint][array]

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.4


The “PopulationIncrease” signal

void
user_function (VisuNodeArray *nodes,
               GArray        *ids,
               gpointer       user_data)

Gets emitted when the number of nodes has changed, increasing. ids contains all new ids.

Parameters

nodes

the object which received the signal ;

 

ids

an array of VisuNode ids.

[element-type guint][array]

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.4


The “position-changed” signal

void
user_function (VisuNodeArray *nodes,
               GArray        *ids,
               gpointer       user_data)

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

Parameters

nodes

the object which received the signal ;

 

ids

ids of moved nodes.

[allow-none][element-type guint]

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.2