![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
struct VisuBox; enum VisuBoxBoundaries; struct VisuBoxCell; struct VisuBoxClass; enum VisuBoxVector; struct VisuBoxVertices; gboolean visu_box_constrainInside (VisuBox *box
,float translat[3]
,float xyz[3]
,gboolean withExt
); void visu_box_convertBoxCoordinatestoXYZ (VisuBox *box
,float xyz[3]
,float boxCoord[3]
); void visu_box_convertFullToCell (VisuBox *box
,float cell[3]
,float full[3]
); void visu_box_convertReducedToXYZ (VisuBox *box
,GArray *red
,float *x
,float *y
,float *z
); void visu_box_convertXYZToReduced (VisuBox *box
,GArray *xyz
,float *u
,float *v
,float *w
); void visu_box_convertXYZtoBoxCoordinates (VisuBox *box
,float boxCoord[3]
,float xyz[3]
); VisuBoxBoundaries visu_box_getBoundary (VisuBox *box
); void visu_box_getCellMatrix (VisuBox *box
,double matrix[3][3]
); void visu_box_getCellMatrixv (VisuBox *box
,double *m11
,double *m12
,double *m13
,double *m21
,double *m22
,double *m23
,double *m31
,double *m32
,double *m33
); void visu_box_getCentre (VisuBox *box
,float centre[3]
); void visu_box_getExtension (const VisuBox *boxObj
,float extension[3]
); double visu_box_getGeometry (VisuBox *box
,VisuBoxVector vector
); float visu_box_getGlobalSize (VisuBox *box
,gboolean withExt
); void visu_box_getInvMatrix (VisuBox *box
,double matrix[3][3]
); void visu_box_getPeriodicArray (VisuBox *box
,float *array
,guint nEle
); void visu_box_getPeriodicVector (VisuBox *box
,float vect[3]
); void visu_box_getPeriodicVectorv (VisuBox *box
,float *x
,float *y
,float *z
,float vect[3]
); void visu_box_getPeriodicity (VisuBox *box
,gboolean per[3]
); ToolUnits visu_box_getUnit (VisuBox *box
); void visu_box_getVertices (VisuBox *box
,float v[8][3]
,gboolean withExtension
); VisuBox * visu_box_new (double geometry[VISU_BOX_N_VECTORS]
,VisuBoxBoundaries bc
); VisuBox * visu_box_new_full (double full[3][3]
,VisuBoxBoundaries bc
); gboolean visu_box_setBoundary (VisuBox *box
,VisuBoxBoundaries bc
); gboolean visu_box_setExtension (VisuBox *boxObj
,float extension[3]
); gboolean visu_box_setGeometry (VisuBox *box
,double geometry[VISU_BOX_N_VECTORS]
); gboolean visu_box_setGeometryFull (VisuBox *box
,double full[3][3]
); gboolean visu_box_setMargin (VisuBox *box
,gfloat margin
,gboolean emit
); gboolean visu_box_setUnit (VisuBox *box
,ToolUnits unit
);
"BoundaryChanged" :No Hooks
"ExtensionChanged" :No Hooks
"SizeChanged" :No Hooks
"UnitChanged" :No Hooks
typedef enum { VISU_BOX_PERIODIC, VISU_BOX_SURFACE_XY, VISU_BOX_SURFACE_YZ, VISU_BOX_SURFACE_ZX, VISU_BOX_WIRE_X, VISU_BOX_WIRE_Y, VISU_BOX_WIRE_Z, VISU_BOX_FREE } VisuBoxBoundaries;
This describes the periodicity of the bounding box in the three directions.
the full 3D periodicity ; | |
the Z axis is a free axis ; | |
the X axis is a free axis ; | |
the Y axis is a free axis ; | |
the periodicity is along X axis only ; | |
the periodicity is along Y axis only ; | |
the periodicity is along Z axis only ; | |
the system is isolated. |
struct VisuBoxCell { double box[VISU_BOX_N_VECTORS]; };
Structure used for bindings.
Since 3.7
struct VisuBoxClass { GObjectClass parent; };
Class structure of VisuBox objects.
GObjectClass |
private. |
typedef enum { VISU_BOX_DXX, VISU_BOX_DYX, VISU_BOX_DYY, VISU_BOX_DZX, VISU_BOX_DZY, VISU_BOX_DZZ, VISU_BOX_N_VECTORS } VisuBoxVector;
Identifier of every projection of the box super-cell on an orthogonal basis-set.
x box vector along X; | |
y box vector along X; | |
y box vector along Y; | |
z box vector along X; | |
z box vector along Y; | |
z box vector along Z; | |
number of elements. |
Since 3.7
struct VisuBoxVertices { float vertices[8][3]; };
Structure used for bindings.
Since 3.7
gboolean visu_box_constrainInside (VisuBox *box
,float translat[3]
,float xyz[3]
,gboolean withExt
);
Given the box defintion box
and the initial xyz
cartesian coordinates, it
returns the translation translat
to be applied to xyz
to move the
node into the box.
|
a VisuBox object. |
|
a translation in cartesian coordinates (out values). |
|
a set of cartesian coordinates. |
|
TRUE to take into account the box expansions. |
Returns : |
TRUE if translat is not (0;0;0). |
Since 3.7
void visu_box_convertBoxCoordinatestoXYZ (VisuBox *box
,float xyz[3]
,float boxCoord[3]
);
Use this method to transform box coordinates into cartesian.
|
a VisuBox object ; |
|
an array of floating point values to store the result ; |
|
an array of floating point values that describes the box coordinates. |
Since 3.7
void visu_box_convertFullToCell (VisuBox *box
,float cell[3]
,float full[3]
);
Convert given cartesian coordinates of a full matrix definition
(see visu_box_setGeometryFull()
) to cartesian coordinates in the
cell definition used by V_Sim. It corresponds to two applied rotations.
|
a VisuBox object. |
|
. [out caller-allocates][array fixed-size=3] |
|
. [in][array fixed-size=3] |
Since 3.7
void visu_box_convertReducedToXYZ (VisuBox *box
,GArray *red
,float *x
,float *y
,float *z
);
Use this method to transform box coordinates into cartesian.
|
a VisuBox object ; |
|
floating point values that describes the cartesian coordinates. [in][array fixed-size=3][element-type gfloat] |
|
the x coordinate. [out caller-allocates] |
|
the y coordinate. [out caller-allocates] |
|
the z coordinate. [out caller-allocates] |
Since 3.7
void visu_box_convertXYZToReduced (VisuBox *box
,GArray *xyz
,float *u
,float *v
,float *w
);
Use this method to transform cartesian into box coordinates.
|
a VisuBox object ; |
|
floating point values that describes the cartesian coordinates. [in][array fixed-size=3][element-type gfloat] |
|
the x coordinate. [out caller-allocates] |
|
the y coordinate. [out caller-allocates] |
|
the z coordinate. [out caller-allocates] |
Since 3.7
void visu_box_convertXYZtoBoxCoordinates (VisuBox *box
,float boxCoord[3]
,float xyz[3]
);
Use this method to transform cartesian coordinates to the box coordinates.
|
a VisuBox object ; |
|
an array of floating point values to store the result ; |
|
an array of floating point values describing coordinates in cartesian. |
Since 3.7
VisuBoxBoundaries visu_box_getBoundary (VisuBox *box
);
Get the boundary conditions defined for box
.
|
a VisuBox object. |
Returns : |
a VisuBoxBoundaries flag. |
Since 3.7
void visu_box_getCellMatrix (VisuBox *box
,double matrix[3][3]
);
This method is used when the box matrix is required. This matrix can transform
a vector given in box coordinates into a cartesian vector. If a simple vector
multication is required, then the use of visu_box_convertBoxCoordinatestoXYZ()
should be prefered.
|
a VisuBox object ; |
|
an area to store the matrix. |
Since 3.7
void visu_box_getCellMatrixv (VisuBox *box
,double *m11
,double *m12
,double *m13
,double *m21
,double *m22
,double *m23
,double *m31
,double *m32
,double *m33
);
This method is a binding method for visu_box_getCellMatrix()
.
Rename to: visu_box_getCellMatrix
|
a VisuBox object ; |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
|
an area to store the matrix. [out] |
Since 3.7
void visu_box_getCentre (VisuBox *box
,float centre[3]
);
centre
contains on output the cartesian coordinates of the centre
of the bounding box.
|
a VisuBox object ; |
|
coordinates of the centre. [out][array fixed-size=3] |
Since 3.7
void visu_box_getExtension (const VisuBox *boxObj
,float extension[3]
);
Using visu_data_replicate()
, it is possible to duplicate the primitive box
in each directions. Use this method to know the current extension. Returned
values are positive floating point values. An extension of 0. means that
only the primitive box exists, while a value of one means a duplication of
one box in each direction of the coordinate.
|
a VisuBox object ; |
|
an allocated array to store the values. [out][array fixed-size=3] |
Since 3.7
double visu_box_getGeometry (VisuBox *box
,VisuBoxVector vector
);
Retrieve the value of a vector defining the bounding box. The vector is chosen with an int, see the VisuBoxVector enum for more details.
|
a VisuBox object ; |
|
an int corresponding to a vector of the box. |
Returns : |
the value of the required vector (always a positive value for vector = 0, 2 or 5 !), or G_MAXFLOAT if the box has not been initialised. |
Since 3.7
float visu_box_getGlobalSize (VisuBox *box
,gboolean withExt
);
The box has a whole size that contains it (including margin, see
visu_box_setMargin()
), this size can be retrieve taking into
account the extension of the box, or not.
|
a VisuBox object. |
|
a boolean. |
Returns : |
G_MAXFLOAT on failure, otherwise a length for the biggest diagonal distance of the box, with or without extension. |
Since 3.7
void visu_box_getInvMatrix (VisuBox *box
,double matrix[3][3]
);
This method is used when the inverse box matrix is required. This matrix can transform
a vector given in cartesian coordinates into a box vector. If a simple vector
multication is required, then the use of visu_box_convertXYZtoBoxCoordinates()
should be prefered.
|
a VisuBox object ; |
|
an area to store the matrix. |
Since 3.7
void visu_box_getPeriodicArray (VisuBox *box
,float *array
,guint nEle
);
Used for bindings.
|
a VisuBox object. |
|
an array of nEle * 3 floats. [type gint64]
|
|
number of elements in array
|
Since 3.7
void visu_box_getPeriodicVector (VisuBox *box
,float vect[3]
);
Modify vect
to get the shortest equivalent vector, taking into
account the periodicity.
|
a VisuBox object. |
|
a vector. [inout][array fixed-size=3] |
Since 3.7
void visu_box_getPeriodicVectorv (VisuBox *box
,float *x
,float *y
,float *z
,float vect[3]
);
Equivalent of visu_box_getPeriodicVector()
used for bindings.
Rename to: visu_box_getPeriodicVector
|
a VisuBox object. |
|
the new x part. [out] |
|
the new y part. [out] |
|
the new z part. [out] |
|
a vector. [array fixed-size=3] |
Since 3.7
void visu_box_getPeriodicity (VisuBox *box
,gboolean per[3]
);
Get for each {x, y, z} directions if the box
is periodic.
|
a VisuBox object. |
|
a location to store three periodicties. [out caller-allocates][array fixed-size=3] |
Since 3.7
ToolUnits visu_box_getUnit (VisuBox *box
);
The lengths of box
may be given in a certain unit using
visu_box_setUnit()
.
|
a VisuBox object. |
Returns : |
the ToolUnits of box or TOOL_UNITS_UNDEFINED. |
Since 3.7
void visu_box_getVertices (VisuBox *box
,float v[8][3]
,gboolean withExtension
);
All nodes are rendered inside a bounding box, this method can be used to retrieve
it. This box is not the drawn box but the box containing all the
nodes, included possible extension. To get the box itself, use
visu_box_getCellMatrix()
instead. One can also get the vertices of
the box itself using FALSE as withExtension
argument.
|
a VisuBox object. |
|
the position of the eight vertices of the bounding box. [out caller-allocates][type VisuBoxVertices*] |
|
a boolean. |
VisuBox * visu_box_new (double geometry[VISU_BOX_N_VECTORS]
,VisuBoxBoundaries bc
);
A VisuBox object store the definition of a cell.
|
a cell definition. [array fixed-size=6] |
|
a boundary condition. |
Returns : |
create a new VisuBox object. [transfer full] |
Since 3.7
VisuBox * visu_box_new_full (double full[3][3]
,VisuBoxBoundaries bc
);
A VisuBox object store the definition of a cell.
|
a cell definition (full matrix). [array fixed-size=9] |
|
a boundary condition. |
Returns : |
create a new VisuBox object. [transfer full] |
Since 3.7
gboolean visu_box_setBoundary (VisuBox *box
,VisuBoxBoundaries bc
);
Set up the boundary conditions of box
.
|
a VisuBox object. |
|
a boundary condition. |
Returns : |
TRUE if the boundary conditions of box are changed. |
Since 3.7
gboolean visu_box_setExtension (VisuBox *boxObj
,float extension[3]
);
Using visu_data_replicate()
, it is possible to duplicate the primitive box
in each directions. Use this method to know the current extension. Returned
values are positive floating point values. An extension of 0. means that
only the primitive box exists, while a value of one means a duplication of
one box in each direction of the coordinate.
|
a VisuBox object ; |
|
an allocated array to store the values. [in][array fixed-size=3] |
Returns : |
TRUE if the extension of box is actually changed. |
Since 3.7
gboolean visu_box_setGeometry (VisuBox *box
,double geometry[VISU_BOX_N_VECTORS]
);
This methods set the size of the box.
|
a VisuBox object ; |
|
a 6 floating point array ;. [in][array fixed-size=6] |
Returns : |
TRUE if the geometry is indeed changed. |
Since 3.7
gboolean visu_box_setGeometryFull (VisuBox *box
,double full[3][3]
);
As visu_box_setGeometry()
, but using a full matrix.
|
a VisuBox object. |
|
a matrix defining a basis-set. |
Returns : |
TRUE if the geometry is valid and changed. |
Since 3.7
gboolean visu_box_setMargin (VisuBox *box
,gfloat margin
,gboolean emit
);
This routine add some margin to defined the OpenGL rendering zone
of box
.
|
a VisuBox object. |
|
a float value. |
|
TRUE to emit "SizeChanged" signal. |
Returns : |
TRUE if the margin is actually changed. |
Since 3.7
"BoundaryChanged"
signalvoid user_function (VisuBox *box,
gpointer user_data) : No Hooks
Gets emitted when the boundary conditions are changed.
|
the object which received the signal ; |
|
user data set when the signal handler was connected. |
Since 3.7
"ExtensionChanged"
signalvoid user_function (VisuBox *box,
gpointer user_data) : No Hooks
Gets emitted when the extension of the box is changed. The new size of the box is not yet computed, listen to VisuBox::SizeChanged instead.
|
the object which received the signal ; |
|
user data set when the signal handler was connected. |
Since 3.7
"SizeChanged"
signalvoid user_function (VisuBox *box,
gfloat extens,
gpointer user_data) : No Hooks
Gets emitted when the box size is changed (because of box duplication for instance).
|
the object which received the signal ; |
|
the new longuest distance in the box taking into account the extension. |
|
user data set when the signal handler was connected. |
Since 3.7
"UnitChanged"
signalvoid user_function (VisuBox *box,
gfloat factor,
gpointer user_data) : No Hooks
Gets emitted when the units are changed.
|
the object which received the signal ; |
|
the factor that has been applied. |
|
user data set when the signal handler was connected. |
Since 3.7