renderingAtomic

renderingAtomic — A rendering method to draw atoms positioned in a box.

Synopsis

#define             VISU_RENDERING_ATOMIC_FORCES
#define             VISU_RENDERING_ATOMIC_FORCES_ELE_MAX
#define             VISU_RENDERING_ATOMIC_NAME
                    VisuRenderingAtomic;
                    VisuRenderingAtomicClass;
enum                VisuRenderingAtomicShapeId;
const char **       visu_rendering_atomic_getAllShapes  ();
const char **       visu_rendering_atomic_getAllShapesI18n
                                                        ();
float               visu_rendering_atomic_getElipsoidPhi
                                                        (VisuElement *ele);
float               visu_rendering_atomic_getElipsoidRatio
                                                        (VisuElement *ele);
float               visu_rendering_atomic_getElipsoidTheta
                                                        (VisuElement *ele);
float               visu_rendering_atomic_getMaxForces  (VisuData *dataObj);
float               visu_rendering_atomic_getRadius     (VisuElement *ele);
float               visu_rendering_atomic_getRadiusDefault
                                                        ();
VisuRenderingAtomicShapeId visu_rendering_atomic_getShape
                                                        (VisuElement *ele);
VisuRenderingAtomicShapeId visu_rendering_atomic_getShapeDefault
                                                        ();
const char *        visu_rendering_atomic_getShapeName  (VisuRenderingAtomicShapeId shape);
const char *        visu_rendering_atomic_getShapeNameDefault
                                                        ();
VisuRenderingAtomic * visu_rendering_atomic_new         ();
gboolean            visu_rendering_atomic_setElipsoidParameters
                                                        (VisuElement *ele,
                                                         float ratio,
                                                         float phi,
                                                         float theta);
gboolean            visu_rendering_atomic_setElipsoidPhi
                                                        (VisuElement *ele,
                                                         float phi);
gboolean            visu_rendering_atomic_setElipsoidRatio
                                                        (VisuElement *ele,
                                                         float ratio);
gboolean            visu_rendering_atomic_setElipsoidTheta
                                                        (VisuElement *ele,
                                                         float theta);
void                visu_rendering_atomic_setForces     (VisuData *dataObj,
                                                         float *forces);
int                 visu_rendering_atomic_setRadius     (VisuElement *ele,
                                                         float value);
int                 visu_rendering_atomic_setShape      (VisuElement *ele,
                                                         VisuRenderingAtomicShapeId shape);
int                 visu_rendering_atomic_setShapeFromName
                                                        (VisuElement *ele,
                                                         const char *shape);

Object Hierarchy

  GObject
   +----VisuRendering
         +----VisuRenderingAtomic

Signals

  "ForcesChanged"                                  : No Recursion

Description

This the main part of a rendering method made to represent atomic positions. It draws either spheres or cubes depending of the elements properties. The radius (for the sphere) or the length of the sides of the cubes can be tuned.

Details

VISU_RENDERING_ATOMIC_FORCES

#define VISU_RENDERING_ATOMIC_FORCES "forces_id"

Public name of the VisuNodeProperty used to store forces on atoms.


VISU_RENDERING_ATOMIC_FORCES_ELE_MAX

#define VISU_RENDERING_ATOMIC_FORCES_ELE_MAX "max_ele_forces_id"

Public name of the VisuNodeProperty used to store the max of forces per element.


VISU_RENDERING_ATOMIC_NAME

#define VISU_RENDERING_ATOMIC_NAME "Atom visualisation"

Public name of the atomic rendering mode.


VisuRenderingAtomic

typedef struct _VisuRenderingAtomic VisuRenderingAtomic;

An opaque structure.


VisuRenderingAtomicClass

typedef struct _VisuRenderingAtomicClass VisuRenderingAtomicClass;

An opaque structure.


enum VisuRenderingAtomicShapeId

typedef enum {
  VISU_RENDERING_ATOMIC_SPHERE,
  VISU_RENDERING_ATOMIC_CUBE,
  VISU_RENDERING_ATOMIC_ELLIPSOID,
  VISU_RENDERING_ATOMIC_POINT,
  VISU_RENDERING_ATOMIC_TORUS,
  VISU_RENDERING_ATOMIC_N_SHAPES
} VisuRenderingAtomicShapeId;

This enum is used as identifier for shapes managed by the attomic rendering method.

VISU_RENDERING_ATOMIC_SPHERE

draw sphere ;

VISU_RENDERING_ATOMIC_CUBE

draw cube ;

VISU_RENDERING_ATOMIC_ELLIPSOID

draw elipsoid ;

VISU_RENDERING_ATOMIC_POINT

draw square dot ;

VISU_RENDERING_ATOMIC_TORUS

draw torus ;

VISU_RENDERING_ATOMIC_N_SHAPES

number of shapes.

visu_rendering_atomic_getAllShapes ()

const char **       visu_rendering_atomic_getAllShapes  ();

This methods retrieve the whole list of shape names used by V_Sim for example in the resources file. These names are not translated. If internationalized names are required, use visu_rendering_atomic_getAllShapesI18n() instead.

Returns :

a pointer to a list of shape names (should not be modified or freed). [transfer none][array zero-terminated=1][element-type filename]

visu_rendering_atomic_getAllShapesI18n ()

const char **       visu_rendering_atomic_getAllShapesI18n
                                                        ();

This methods retrieve the whole list of shape names, translated strings.

Returns :

a pointer to a list of shape names (should not be modified or freed). [transfer none][array zero-terminated=1][element-type utf8]

visu_rendering_atomic_getElipsoidPhi ()

float               visu_rendering_atomic_getElipsoidPhi
                                                        (VisuElement *ele);

Retrieve the phi angle parameter of the elipsoid shape for the element ele.

ele :

a VisuElement object.

Returns :

the phi angle of the elipsoid.

visu_rendering_atomic_getElipsoidRatio ()

float               visu_rendering_atomic_getElipsoidRatio
                                                        (VisuElement *ele);

Retrieve the ratio parameter of the elipsoid shape for the element ele.

ele :

a VisuElement object.

Returns :

the ratio of the elipsoid.

visu_rendering_atomic_getElipsoidTheta ()

float               visu_rendering_atomic_getElipsoidTheta
                                                        (VisuElement *ele);

Retrieve the theta angle parameter of the elipsoid shape for the element ele.

ele :

a VisuElement object.

Returns :

the theta angle of the elipsoid.

visu_rendering_atomic_getMaxForces ()

float               visu_rendering_atomic_getMaxForces  (VisuData *dataObj);

If dataObj has forces associated to (see visu_rendering_atomic_setForces()), this routine provides the modulus of the biggest force.

dataObj :

a VisuData object.

Returns :

0 if no forces have been associated.

Since 3.7


visu_rendering_atomic_getRadius ()

float               visu_rendering_atomic_getRadius     (VisuElement *ele);

In the rendering atomic method, shapes are characterized by a radius. This method gets it for the specified element. If this element has no radius defined yet, the default value is associated and returned.

ele :

a VisuElement object.

Returns :

the radius of the specified element. A negative value if something goies wrong.

visu_rendering_atomic_getRadiusDefault ()

float               visu_rendering_atomic_getRadiusDefault
                                                        ();

This method gets the default radius of the rendering atomic method.

Returns :

the default value for radius resource.

visu_rendering_atomic_getShape ()

VisuRenderingAtomicShapeId visu_rendering_atomic_getShape
                                                        (VisuElement *ele);

In the rendering atomic method, shapes are multiple. This method gets it for the specified element. Shapes are characterized by their id, corresponding to an integer value. Use the enum VisuRenderingAtomicShapeId to associate an integer value to a specific shape.

ele :

a VisuElement object.

Returns :

the shape id of the element ele.

visu_rendering_atomic_getShapeDefault ()

VisuRenderingAtomicShapeId visu_rendering_atomic_getShapeDefault
                                                        ();

This method gets the default shape.

Returns :

the default shape id.

visu_rendering_atomic_getShapeName ()

const char *        visu_rendering_atomic_getShapeName  (VisuRenderingAtomicShapeId shape);

This method does the corresponding between a shape id and its name (a string value).

shape :

an integer.

Returns :

the name associated to a shape.

visu_rendering_atomic_getShapeNameDefault ()

const char *        visu_rendering_atomic_getShapeNameDefault
                                                        ();

This method is used to retrieve the default name for shapes.

Returns :

the name associated to the default shape.

visu_rendering_atomic_new ()

VisuRenderingAtomic * visu_rendering_atomic_new         ();

Create the structure and initialise its values.

Returns :

a newly allocate VisuRenderingAtomic object.

Since 3.6


visu_rendering_atomic_setElipsoidParameters ()

gboolean            visu_rendering_atomic_setElipsoidParameters
                                                        (VisuElement *ele,
                                                         float ratio,
                                                         float phi,
                                                         float theta);

Change the parameters for the elipsoid shape for the given ele. These parameters include a ratio which is the ratio of the long axis on the short one. Thus ratio is always equal or greater than 1. Arguments theta and phi are the direction of the long axis.

ele :

a VisuElement object ;

ratio :

a float ;

phi :

a float ;

theta :

a float.

Returns :

TRUE if visu_rendering_createElement() should be called.

visu_rendering_atomic_setElipsoidPhi ()

gboolean            visu_rendering_atomic_setElipsoidPhi
                                                        (VisuElement *ele,
                                                         float phi);

Set the phi angle parameter of the elipsoid shape for the element ele.

ele :

a VisuElement object.

phi :

a float ;

Returns :

TRUE if visu_rendering_createElement() should be called.

visu_rendering_atomic_setElipsoidRatio ()

gboolean            visu_rendering_atomic_setElipsoidRatio
                                                        (VisuElement *ele,
                                                         float ratio);

Set the ratio parameter of the elipsoid shape for the element ele.

ele :

a VisuElement object.

ratio :

a float ;

Returns :

TRUE if visu_rendering_createElement() should be called.

visu_rendering_atomic_setElipsoidTheta ()

gboolean            visu_rendering_atomic_setElipsoidTheta
                                                        (VisuElement *ele,
                                                         float theta);

Set the theta angle parameter of the elipsoid shape for the element ele.

ele :

a VisuElement object.

theta :

a float.

Returns :

TRUE if visu_rendering_createElement() should be called.

visu_rendering_atomic_setForces ()

void                visu_rendering_atomic_setForces     (VisuData *dataObj,
                                                         float *forces);

Forces can be associated to nodes of dataObj. The array forces must have the size of the number of nodes of dataObj times three. Forces are given in cartesian coordinates.

dataObj :

a VisuData object.

forces :

an array of forces. [array]

Since 3.7


visu_rendering_atomic_setRadius ()

int                 visu_rendering_atomic_setRadius     (VisuElement *ele,
                                                         float value);

This change the radius value of element ele to value.

ele :

a VisuElement object ;

value :

a positive floating point value.

Returns :

1 if a call to visu_rendering_createElement() is required, 0 if not.

visu_rendering_atomic_setShape ()

int                 visu_rendering_atomic_setShape      (VisuElement *ele,
                                                         VisuRenderingAtomicShapeId shape);

This changes the shape of the element ele to the shape defined by its id.

ele :

a VisuElement object ;

shape :

an integer.

Returns :

1 if a call to visu_rendering_createElement() is required, 0 if not.

visu_rendering_atomic_setShapeFromName ()

int                 visu_rendering_atomic_setShapeFromName
                                                        (VisuElement *ele,
                                                         const char *shape);

This method is equivalent to visu_rendering_atomic_setShape() but the shape is defined by its name.

ele :

a VisuElement object ;

shape :

a string.

Returns :

1 if a call to visu_rendering_createElement() is required, 0 if not.

Signal Details

The "ForcesChanged" signal

void                user_function                      (VisuRenderingAtomic *obj,
                                                        GObject             *dataObj,
                                                        gpointer             user_data)      : No Recursion

Emitted each time forces are updated.

obj :

the object emitting the signal.

dataObj :

the VisuData forces are applied on.

user_data :

user data set when the signal handler was connected.

Since 3.7