visu_nodes

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

Synopsis

typedef             VisuNode;
void                visuNodeSet_newValues               (VisuNode *node,
                                                         double x,
                                                         double y,
                                                         double z,
                                                         int number,
                                                         int rendered,
                                                         int posEle,
                                                         int posNod);
gboolean            visuNodeGet_visibility              (VisuNode *node);
int                 visuNodeSet_visibility              (VisuNode *node,
                                                         gboolean visibility);

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), the node must be attached to a VisuData and then visuDataAdd_nodeProperty() can be used.

Details

VisuNode

typedef struct node_struct VisuNode;

Short way to address node_struct objects.


visuNodeSet_newValues ()

void                visuNodeSet_newValues               (VisuNode *node,
                                                         double x,
                                                         double y,
                                                         double z,
                                                         int number,
                                                         int rendered,
                                                         int posEle,
                                                         int posNod);

This method doesn't allocate the node it works on. It should be already allocated. Moreover it should not have been already initialised since nothing from the node is freed before giving the values.

node :

an allocated VisuNode object ;

x :

its x coordinate ;

y :

its y coordinate ;

z :

its z coordinate ;

number :

its position in the input file (or anything else that can uniqualy identify this new VisuNode) ;

rendered :

1 if draw, 0 otherwise ;

posEle :

an int corresponding the number of the VisuElement it is associated with ;

posNod :

an int corresponding to the position of the node in the node table of the VisuData in which it is allocated ;

visuNodeGet_visibility ()

gboolean            visuNodeGet_visibility              (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.

visuNodeSet_visibility ()

int                 visuNodeSet_visibility              (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 recreate the node list with a call to the visuData_createAllNodes() method.

See Also

See also VisuElement and VisuData.