Top | ![]() |
![]() |
![]() |
![]() |
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()
.
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.
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.
data |
a VisuData object ; |
|
commentary |
the message to be stored (null terminated) ; |
|
iSet |
an integer. |
gchar * visu_data_getDescription (VisuData *data
,gint iSet
);
Get the commentary associated to the given data
, for the given
node set.
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()
).
int
visu_data_getNSubset (VisuData *data
);
Retrieve the number of available sets of nodes for this VisuData,
see visu_data_setNSubset()
.
void visu_data_setISubset (VisuData *data
,int iSet
);
Change the current id of the set of data (ordered as in C, beginning at 0).
int
visu_data_getISubset (VisuData *data
);
Retrieve the id of the current set of data (ordered as in C, beginning at 0).
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.
Since: 3.7
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.
data |
||
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. |
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.
Since: 3.6
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.
data |
||
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. |
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()
.
gboolean visu_data_getNodeBoxFromNumber (VisuData *data
,guint nodeId
,int nodeBox[3]
);
This method retrieves the value of the box associated to a node (with respect to the unit cell).
data |
a VisuData object. |
|
nodeId |
the index of the node considered. |
|
nodeBox |
the array to store the box of the node. |
[in][array fixed-size=3] |
gboolean visu_data_getNodeBoxFromCoord (VisuData *data
,float xcart[3]
,int nodeBox[3]
);
This method retrieves the value of the box associated to the coordinates of the node (with respect to the unit cell).
data |
a VisuData object. |
|
xcart |
the coordinates of a node. |
[in][array fixed-size=3] |
nodeBox |
the array to store the box of the node. |
[in][array fixed-size=3] |
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.
Since: 3.6
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]
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]
Since: 3.7
gboolean visu_data_setNewBasisFromNodes (VisuData *data
,guint nO
,guint nA
,guint nB
,guint nC
);
Change the basis set by providing the new basis set from a list of
nodes. See also visu_data_setNewBasis()
. Nodes outside the new box
are killed.
data |
a VisuData object. |
|
nO |
the index of node as origin. |
|
nA |
the index of node on X axis. |
|
nB |
the index of node as Y axis. |
|
nC |
the index of node as Z axis. |
Since: 3.6
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.
Since: 3.6
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.
TRUE is the reordering is successfull (i.e. all nodes of
data
correspond to one of dataRef
).
Since: 3.6
gboolean visu_data_addNodeProperties (VisuData *data
,VisuNodeValues *values
);
Add values
as a known VisuNodeValues property of data
.
Since: 3.8
gboolean visu_data_removeNodeProperties (VisuData *data
,const gchar *label
);
Look for a VisuNodeValues object labelled by label
and remove it.
Since: 3.8
GList *
visu_data_getAllNodeProperties (VisuData *data
);
Retrieve all the VisuNodeValues objects attached to data
formatted as a list.
a newly created list of VisuNodeValues objects.
[transfer container][element-type VisuNodeValues]
Since: 3.8
VisuNodeValues * visu_data_getNodeProperties (VisuData *data
,const gchar *label
);
Look for the VisuNodeValues labelled by label
.
Since: 3.8
VisuNodeValuesString *
visu_data_getNodeLabels (VisuData *data
);
Retrieve the VisuNodeValuesString object that is used to store labels, creating it if necessary.
Since: 3.8
const gchar * visu_data_getNodeLabelAt (const VisuData *data
,const VisuNode *node
);
Retrieves the label associated to node
in data
.
Since: 3.8
struct VisuDataClass { VisuNodeArrayClass parent; };
A short way to identify _VisuDataClass structure.
“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
“node-properties-added”
signalvoid user_function (VisuData *dataObj, VisuNodeValues *values, gpointer user_data)
Gets emitted when values
node properties is added to dataObj
.
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
“node-properties-removed”
signalvoid user_function (VisuData *dataObj, VisuNodeValues *values, gpointer user_data)
Gets emitted when values
node properties is removed from dataObj
.
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