VisuData

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

Functions

Properties

gdouble totalEnergy Read / Write / Construct

Signals

Types and Values

struct VisuData
struct VisuDataClass

Object Hierarchy

    GObject
    ╰── ToolDbgObj
        ╰── VisuNodeArray
            ╰── VisuData
                ╰── VisuDataLoadable

Implemented Interfaces

VisuData implements VisuMaskable, VisuBoxed and VisuPointset.

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 VisuNodeArrayIter) methods, like visu_node_array_iter_next().

Functions

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

Parameters

data

a VisuData to be freed.

 

visu_data_setDescription ()

void
visu_data_setDescription (VisuData *data,
                          const 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.

Parameters

data

a VisuData object ;

 

commentary

the message to be stored (null terminated) ;

 

iSet

an integer.

 

visu_data_getDescription ()

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

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

Parameters

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.

[transfer none]


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

Parameters

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

Parameters

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

Parameters

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

Parameters

data

a VisuData object.

 

Returns

the id of the set of nodes currently loaded, -1 if none.


visu_data_getAllNodeExtens ()

gfloat
visu_data_getAllNodeExtens (VisuData *dataObj,
                            VisuBox *box);

Calculate the longest distance between the surface of box (without extension) and all the nodes. If box is NULL, then the internal box of dataObj is used.

Parameters

dataObj

a VisuData object.

 

box

a VisuBox object.

[allow-none]

Returns

the longest distance between the surface of box (without extension) and all the nodes.

Since: 3.7


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 PopulationIncrease signal is triggered.

Parameters

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,
                                  const gchar *name,
                                  float xyz[3],
                                  gboolean reduced,
                                  gboolean emitSignal);

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

Parameters

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,
                            guint 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 PopulationIncrease signal is triggered.

Parameters

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

VisuBox *
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_box_setGeometry().

Parameters

data

a VisuData object.

 

Returns

a new VisuBox if data had not one before, or the modified box of data .

[transfer none]


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

Parameters

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

Parameters

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

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

Wrapper for the function visu_data_getNodePosition() in case of call from python. If user is TRUE, it wraps visu_data_getNodeUserPosition() instead.

Parameters

data

a VisuData object ;

 

node

a VisuNode object ;

 

user

a boolean.

 

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 (const VisuData *data,
                           const VisuNode *node,
                           float coord[3]);

Position of nodes are subject to various translations and different transformations. Their coordinates should not be access directly through node.[xyz]. This method is used to retrieve the given node position.

[skip]

Parameters

data

a VisuData object ;

 

node

a VisuNode object ;

 

coord

an array of 3 floating point values to store the position.

[array fixed-size=3][out caller-allocates]

visu_data_getNodeUserPosition ()

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

This routine is equivalent to visu_data_getNodePosition() except that it's not applying internal box translation for non periodic directions.

[skip]

Parameters

data

a VisuData object ;

 

node

a VisuNode object ;

 

coord

an array of 3 floating point values to store the position.

[array fixed-size=3][out caller-allocates]

Since: 3.7


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.

Parameters

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.

Parameters

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,
                   const VisuData *dataRef);

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

Parameters

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

gboolean
visu_data_addNodeProperties (VisuData *data,
                             VisuNodeValues *values);

Add values as a known VisuNodeValues property of data .

Parameters

data

a VisuData object.

 

values

a VisuNodeValues object.

[transfer full]

Returns

TRUE if values is added as a valid node property of data .

Since: 3.8


visu_data_removeNodeProperties ()

gboolean
visu_data_removeNodeProperties (VisuData *data,
                                const gchar *label);

Look for a VisuNodeValues object labelled by label and remove it.

Parameters

data

a VisuData object.

 

label

a string.

 

Returns

TRUE if label was indeed attached to data .

Since: 3.8


visu_data_getAllNodeProperties ()

GList *
visu_data_getAllNodeProperties (VisuData *data);

Retrieve all the VisuNodeValues objects attached to data formatted as a list.

Parameters

data

a VisuData object.

 

Returns

a newly created list of VisuNodeValues objects.

[transfer container][element-type VisuNodeValues]

Since: 3.8


visu_data_getNodeProperties ()

VisuNodeValues *
visu_data_getNodeProperties (VisuData *data,
                             const gchar *label);

Look for the VisuNodeValues labelled by label .

Parameters

data

a VisuData object.

 

label

a string.

 

Returns

the VisuNodeValues object attached to data with label , if any.

[transfer none]

Since: 3.8


visu_data_getNodeLabels ()

VisuNodeValuesString *
visu_data_getNodeLabels (VisuData *data);

Retrieve the VisuNodeValuesString object that is used to store labels, creating it if necessary.

Parameters

data

a VisuData object.

 

Returns

the VisuNodeValuesString object used to store labels.

[transfer none]

Since: 3.8


visu_data_getNodeLabelAt ()

const gchar *
visu_data_getNodeLabelAt (const VisuData *data,
                          const VisuNode *node);

Retrieves the label associated to node in data .

Parameters

data

a VisuData object.

 

node

a VisuNode from data .

 

Returns

a label.

Since: 3.8


visu_data_applyTransformationsFromCLI ()

gboolean
visu_data_applyTransformationsFromCLI (VisuData *data,
                                       GError **error);

Types and Values

struct VisuData

struct VisuData;

Opaque structure for VisuData objects.


struct VisuDataClass

struct VisuDataClass {
  VisuNodeArrayClass parent;
};

A short way to identify _VisuDataClass structure.

Members

VisuNodeArrayClass parent;

the parent class.

 

Property Details

The “totalEnergy” property

  “totalEnergy”              gdouble

Total energy of the system (eV).

Flags: Read / Write / Construct

Allowed values: [-G_MAXFLOAT,G_MAXFLOAT]

Default value: 3.40282e+38

Signal Details

The “node-properties-added” signal

void
user_function (VisuData       *dataObj,
               VisuNodeValues *values,
               gpointer        user_data)

Gets emitted when values node properties is added to dataObj .

Parameters

dataObj

the object which received the signal ;

 

values

a VisuNodeValues object.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8


The “node-properties-removed” signal

void
user_function (VisuData       *dataObj,
               VisuNodeValues *values,
               gpointer        user_data)

Gets emitted when values node properties is removed from dataObj .

Parameters

dataObj

the object which received the signal ;

 

values

a VisuNodeValues object.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8