![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
#define SPINMAXMODULUS_ID #define SPINVALUES_ID #define SPIN_MODULUS #define SPIN_PHI #define SPIN_THETA enum SpinGlobalResources; enum SpinElementResources; enum SpinDrawingPolicy; enum SpinModulusPolicy; void rspin_addLoadMethod (RenderingFormatLoad *meth); gboolean rspin_load (VisuData *data, FileFormat *format, int nSet, GError **error); gboolean rspin_setGlobalResource_boolean (SpinGlobalResources property, gboolean value); gboolean rspin_getGlobalResource_boolean (SpinGlobalResources property); gboolean rspin_setGlobalResource_float (SpinGlobalResources property, gfloat value); gfloat rspin_getGlobalResource_float (SpinGlobalResources property); gboolean rspin_setGlobalResource_uint (SpinGlobalResources property, guint value); guint rspin_getGlobalResource_uint (SpinGlobalResources property); gpointer rspin_getGlobalResource (SpinGlobalResources property, GType *type); guint rspin_getElementResource_uint (VisuElement *ele, SpinElementResources property); gboolean rspin_setElementResource_uint (VisuElement *ele, SpinElementResources property, guint value); gfloat rspin_getElementResource_float (VisuElement *ele, SpinElementResources property); gboolean rspin_setElementResource_float (VisuElement *ele, SpinElementResources property, gfloat value); gboolean rspin_setElementResource_boolean (VisuElement *ele, SpinElementResources property, gboolean value); gboolean rspin_getElementResource_boolean (VisuElement *ele, SpinElementResources property); gpointer rspin_getElementResource (VisuElement *ele, SpinElementResources property, GType *type); const char* rspin_shape_number_to_translated_name (SpinArrowShape n); const char* rspin_hiding_number_to_name (int n); const char* rspin_hiding_number_to_translated_name (int n); int rspin_hiding_name_to_number (const char *name);
This method draws arrows to represent atoms. Each arrow has a given orientation which is set acording to parameters. This is one way to represent the spin of an atom. These arrows direction are determined by the spin of each atom. It is designed to read two separate files : one containing the position of the atoms, the other containing the spin of each atom. Of course these two files need to have the exact same number of atoms and also need to sort atoms in the same order.
#define SPINMAXMODULUS_ID "spinRendering_maxModulus"
This flag should be used when creating a new spin rendering method
as the flag for the max modulus values as a VisuData property (see
visuDataSet_property()
).
#define SPINVALUES_ID "spinRendering_values"
This flag should be used when creating a new spin rendering method
as the flag for the spin values as node properties (see
visuNodeNew_pointerProperty()
).
typedef enum { spin_globalConeTheta, spin_globalConePhi, spin_globalColorWheel, spin_globalHidingMode, spin_globalAtomic, spin_globalModulus, spin_nbGlobalResources } SpinGlobalResources;
These are resources that impact the entire rendering spin method. They can be accessed
through rspin_getGlobalResource()
or rspin_setGlobalResource_boolean()
and other
similar methods.
the theta angle to set the color cone ; | |
the phi angle to set the color cone ; | |
an angle to set the color origin around the z axis of the cone ; | |
an id used to define the policy used to draw spin with null modulus (see SpinDrawingPolicy) ; | |
if TRUE, atoms are drawn with spins ; | |
an id used to define the policy used to draw spin depending on modulus (see SpinModulusPolicy) ; | |
number of global resources. |
typedef enum { spin_elementHatLength, spin_elementTailLength, spin_elementHatRadius, spin_elementTailRadius, spin_elementHatColor, spin_elementTailColor, spin_elementAAxis, spin_elementBAxis, spin_elementElipsoidColor, spin_elementShape, spin_nbElementResources } SpinElementResources;
These are resources defined for each element. They can be accessed with
rspin_getElementResource()
or rspin_getElementResource_boolean()
and other
methods of the same kind.
the length of the pointing element ; | |
the length of the tail ; | |
the raidus of the pointing element ; | |
the radius of the tail ; | |
if TRUE, the pointing part use the color of the element ; | |
if TRUE, the tail uses the color of the element ; | |
the size of the A axis (elipsoid shape) ; | |
the size of the B axis (elipsoid shape) ; | |
if TRUE, the elipsoid uses the color of the element ; | |
an id to defined the shape (rounded arrow, elipsoid...) ; | |
number of resources per element. |
typedef enum { policyAlwaysSpin, policyHideNullSpin, policyAtomicNullSpin, policyNbModes } SpinDrawingPolicy;
Different policy to render the spin when the modulus is null. This policy is applied for all VisuElement.
typedef enum { policyNoneModulus, policyPerTypeModulus, policyGlobalModulus, policyNbModulusModes } SpinModulusPolicy;
Different policy to render the spin depending on the modulus.
void rspin_addLoadMethod (RenderingFormatLoad *meth);
This routine is used to register a new load method with its description (file formats, name...). The list of all known load methods is automatically resorted after a call to this method to reflect the priorities.
|
a new load method. |
gboolean rspin_load (VisuData *data, FileFormat *format, int nSet, GError **error);
Try to load the spin file declared in the data
. It tries all formats added with
rspin_addLoadMethod()
.
|
a VisuData object ; |
|
a pointer on a format (can be NULL if format is to be guessed) ; |
|
an integer ; |
|
a pointer to store a possible error. |
Returns : |
FALSE if the file can't be loaded. |
gboolean rspin_setGlobalResource_boolean (SpinGlobalResources property, gboolean value);
This method is used to change global resources that are boolean.
|
the id of the property to set ; |
|
its value. |
Returns : |
TRUE if the value was changed. |
gboolean rspin_getGlobalResource_boolean (SpinGlobalResources property);
This is the specific method to retrieve value of boolean global resources.
|
the id of the property to get. |
Returns : |
the boolean value. |
gboolean rspin_setGlobalResource_float (SpinGlobalResources property, gfloat value);
This method is used to change global resources that are floating point.
|
the id of the property to set ; |
|
its value. |
Returns : |
TRUE if the value was changed. |
gfloat rspin_getGlobalResource_float (SpinGlobalResources property);
This is the specific method to retrieve value of floating point global resources.
|
the id of the property to get. |
Returns : |
the floating point value. |
gboolean rspin_setGlobalResource_uint (SpinGlobalResources property, guint value);
This method is used to change global resources that are unsigned int.
|
the id of the property to set ; |
|
its value. |
Returns : |
TRUE if the value was changed. |
guint rspin_getGlobalResource_uint (SpinGlobalResources property);
This is the specific method to retrieve value of unsigned int global resources.
|
the id of the property to get. |
Returns : |
the unsigned int value. |
gpointer rspin_getGlobalResource (SpinGlobalResources property, GType *type);
This is a generic method to access global resources. Use rspin_setGlobalResource_boolean()
is favored if the type of the value is known. If the returned value is not NULL
the argument type
contains the type of the returned value.
|
the name of the resource ; |
|
a location to store the type. |
Returns : |
a pointer to the location where the value for the given global resource is stored. |
guint rspin_getElementResource_uint (VisuElement *ele, SpinElementResources property);
This is the specific method to retrieve value of unsigned int element resources.
|
a pointer to a VisuElement object ; |
|
the id of the property to get. |
Returns : |
the unsigned int value. |
gboolean rspin_setElementResource_uint (VisuElement *ele, SpinElementResources property, guint value);
This method is used to change element resources that are unsigned int.
|
a pointer to a VisuElement object ; |
|
the id of the property to set ; |
|
its value. |
Returns : |
TRUE if the value was changed. |
gfloat rspin_getElementResource_float (VisuElement *ele, SpinElementResources property);
This is the specific method to retrieve value of floating point element resources.
|
a pointer to a VisuElement object ; |
|
the id of the property to get. |
Returns : |
the floating point value. |
gboolean rspin_setElementResource_float (VisuElement *ele, SpinElementResources property, gfloat value);
This method is used to change element resources that are floating point.
|
a pointer to a VisuElement object ; |
|
the id of the property to set ; |
|
its value. |
Returns : |
TRUE if the value was changed. |
gboolean rspin_setElementResource_boolean (VisuElement *ele, SpinElementResources property, gboolean value);
This method is used to change element resources that are boolean.
|
a pointer to a VisuElement object ; |
|
the id of the property to set ; |
|
its value. |
Returns : |
TRUE if the value was changed. |
gboolean rspin_getElementResource_boolean (VisuElement *ele, SpinElementResources property);
This is the specific method to retrieve value of boolean element resources.
|
a pointer to a VisuElement object ; |
|
the id of the property to get. |
Returns : |
the boolean value. |
gpointer rspin_getElementResource (VisuElement *ele, SpinElementResources property, GType *type);
This is a generic method to access resources per element. Use rspin_setElementResource_boolean()
is favored if the type of the value is known (boolean in this exemple).
If the returned value is not NULL the argument type
contains the type of the returned value.
|
a pointer to a VisuElement object ; |
|
the id of the resource (see SpinElementResources) ; |
|
a location to store the type. |
Returns : |
a pointer to the location where the value for the given global resource is stored. |
const char* rspin_shape_number_to_translated_name (SpinArrowShape n);
This routine returnes the translated name in UTF-8 corresponding to the given shape id.
|
an id for spin shape. |
Returns : |
a string owned by V_Sim. |
const char* rspin_hiding_number_to_name (int n);
Transform ids to untranslated names.
|
an id for hiding policy. |
Returns : |
the name associated to the id. |
const char* rspin_hiding_number_to_translated_name (int n);
Transform ids to translated names.
|
an id for hiding policy. |
Returns : |
the name associated to the id in UTF-8. |