![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define VISU_VIBRATION_ID gboolean visu_vibration_getCharacteristic (VisuData *data
,guint n
,float q[3]
,float *en
,float *omega
); guint visu_vibration_getCurrentMode (VisuData *data
); gboolean visu_vibration_getNPhonons (VisuData *data
,guint *n
); gboolean visu_vibration_init (VisuData *data
,guint n
,guint nNodes
); gboolean visu_vibration_isSet (VisuData *data
); guint visu_vibration_play (VisuData *data
); void visu_vibration_resetPosition (VisuData *data
); gboolean visu_vibration_setAmplitude (VisuData *data
,float ampl
); gboolean visu_vibration_setCharacteristic (VisuData *data
,guint n
,float q[3]
,float en
,float omega
); gboolean visu_vibration_setCurrentMode (VisuData *data
,guint iph
,GError **error
); gboolean visu_vibration_setDisplacements (VisuData *data
,guint iph
,float *vibes
,gboolean complex
); void visu_vibration_setUserFrequency (VisuData *data
,float freq
); void visu_vibration_setZeroTime (VisuData *data
); gboolean visu_vibration_stop (guint timeoutID
);
Define a way to store vibration or phonons to a VisuData
object. One can store several phonons in one object, each phonon is
them represented by its id. The phonons can be animated on screen,
using a user defined frequency (visu_vibration_setUserFrequency)
and amplitue (visu_vibration_setAmplitude), by calling
visu_vibration_play()
.
Phonons are set with visu_vibration_setCharacteristic()
and
VisuNode displacements are set with visu_vibration_setDisplacements()
.
#define VISU_VIBRATION_ID "Vibration"
The default name used for the VisuGlExt representing
vibrations, see visu_gl_ext_getFromName()
.
gboolean visu_vibration_getCharacteristic (VisuData *data
,guint n
,float q[3]
,float *en
,float *omega
);
This routine is used to get the characteristics of a given
phonon, see visu_vibration_setCharacteristic()
to set them.
|
a VisuData object. |
|
a phonon id. |
|
a location for the reciprocal vector. |
|
a locattion for the phonon energy. |
|
a location for the phonon frequency. |
Returns : |
TRUE on success. |
Since 3.5
guint visu_vibration_getCurrentMode (VisuData *data
);
Retrieves the phonon that is currently applied to data
.
|
a VisuData object. |
Returns : |
a phonon id. |
Since 3.5
gboolean visu_vibration_getNPhonons (VisuData *data
,guint *n
);
Retrieves if data
contains phonons or not. Number of stored
phonons is set in n
.
|
a VisuData object. |
|
a location. |
Returns : |
TRUE if data has phonons. |
Since 3.5
gboolean visu_vibration_init (VisuData *data
,guint n
,guint nNodes
);
Allocate (or reallocate) storage of phonons for data
. The
allocated memory will be automatically freed when data
is
destroyed.
|
a VisuData object. |
|
number of phonons to set. |
|
number of vibrating nodes. |
Returns : |
TRUE if data has no phonons before. |
Since 3.5
gboolean visu_vibration_isSet (VisuData *data
);
Retrieve if data
has some phonon attached to.
|
a VisuData object. |
Returns : |
TRUE if visu_vibration_init() has been called already. |
Since 3.5
guint visu_vibration_play (VisuData *data
);
Make the phonon displace the VisuNode of data
according to their
definitions (see visu_vibration_setDisplacements()
and
visu_vibration_setCurrentMode()
).
|
a VisuData object. |
Returns : |
the timer's ID |
Since 3.5
void visu_vibration_resetPosition (VisuData *data
);
Reset the node position of the given VisuData.
|
a VisuData object. |
Returns : |
a boolean |
Since 3.5
gboolean visu_vibration_setAmplitude (VisuData *data
,float ampl
);
Change the amplitude at which phonon are displayed on screen when
using visu_vibration_play()
.
|
a VisuData object. |
|
an amplitude. |
Returns : |
TRUE if amplitude is actually changed. |
Since 3.5
gboolean visu_vibration_setCharacteristic (VisuData *data
,guint n
,float q[3]
,float en
,float omega
);
This routine is used to define the characteristics of a given phonon.
|
a VisuData object. |
|
a phonon id. |
|
a reciprocal vector. |
|
the phonon energy. |
|
the phonon frequency. |
Returns : |
TRUE on success. |
Since 3.5
gboolean visu_vibration_setCurrentMode (VisuData *data
,guint iph
,GError **error
);
Set all node displacements to zero and setup the displacement
vector (u+iv) for each VisuNode. After this call,
visu_vibration_play()
will move the nodes according to their vibration.
|
a VisuData object. |
|
a phonon id. |
|
a location for a possible error. |
Returns : |
TRUE if its the first time VisuNodes are displaced. |
Since 3.5
gboolean visu_vibration_setDisplacements (VisuData *data
,guint iph
,float *vibes
,gboolean complex
);
visu_vibration_init()
must have been call before. This routine is
used to define a set of displacement vectors, corresponding to one
phonon. The displacement vectors can be complex
, in that case
vibes
contains 6 values for each VisuNode.
|
a VisuData object. |
|
a phonon id. |
|
a set of displacement vectors. |
|
a flag. |
Returns : |
TRUE on success. |
Since 3.5
void visu_vibration_setUserFrequency (VisuData *data
,float freq
);
Change the frequency at which phonons are played with visu_vibration_play()
.
|
a VisuData object. |
|
a frequency. |
Since 3.5
void visu_vibration_setZeroTime (VisuData *data
);
Reset the position of phonons to use position at time equals zero (so applying just the q vector displacement).
|
a VisuData object. |
Since 3.5