renderingAtomic

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

Synopsis

enum                VisuAtomicShapeId;
#define             VISU_RENDERING_ATOMIC_TYPE
#define             VISU_RENDERING_ATOMIC               (obj)
#define             VISU_RENDERING_ATOMIC_CLASS         (klass)
#define             IS_VISU_RENDERING_ATOMIC_TYPE       (obj)
#define             IS_VISU_RENDERING_ATOMIC_CLASS      (klass)
#define             VISU_RENDERING_ATOMIC_GET_CLASS     (obj)
GType               visu_rendering_atomic_get_type      (void);
#define             VISU_RENDERING_ATOMIC_NAME
                    VisuRenderingAtomicClass;
                    VisuRenderingAtomic;
VisuRenderingAtomic* visu_rendering_atomic_new          ();
float               visu_renderingAtomic_getRadius      (VisuElement *ele);
float               visu_renderingAtomic_getRadiusDefault
                                                        ();
int                 visu_renderingAtomic_setRadius      (VisuElement *ele,
                                                         float value);
VisuAtomicShapeId   visu_renderingAtomic_getShape       (VisuElement *ele);
VisuAtomicShapeId   visu_renderingAtomic_getShapeDefault
                                                        ();
const char*         visu_renderingAtomic_getShapeName   (VisuAtomicShapeId shape);
const char*         visu_renderingAtomic_getShapeNameDefault
                                                        ();
int                 visu_renderingAtomic_setShape       (VisuElement *ele,
                                                         VisuAtomicShapeId shape);
int                 visu_renderingAtomic_setShapeFromName
                                                        (VisuElement *ele,
                                                         const char *shape);
const char**        visu_renderingAtomic_getAllShapes   ();
const char**        visu_renderingAtomic_getAllShapesI18n
                                                        ();
gboolean            visu_renderingAtomic_setElipsoidParameters
                                                        (VisuElement *ele,
                                                         float ratio,
                                                         float phi,
                                                         float theta);
float               visu_renderingAtomic_getElipsoidRatio
                                                        (VisuElement *ele);
float               visu_renderingAtomic_getElipsoidPhi (VisuElement *ele);
float               visu_renderingAtomic_getElipsoidTheta
                                                        (VisuElement *ele);
gboolean            visu_renderingAtomic_setElipsoidRatio
                                                        (VisuElement *ele,
                                                         float ratio);
gboolean            visu_renderingAtomic_setElipsoidPhi (VisuElement *ele,
                                                         float phi);
gboolean            visu_renderingAtomic_setElipsoidTheta
                                                        (VisuElement *ele,
                                                         float theta);

Object Hierarchy

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

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

enum VisuAtomicShapeId

typedef enum 
{
  VISU_RENDERING_ATOMIC_SPHERE,
  VISU_RENDERING_ATOMIC_CUBE,
  VISU_RENDERING_ATOMIC_ELLIPSOID,
  VISU_RENDERING_ATOMIC_POINT,
  VISU_RENDERING_ATOMIC_TORUS,
  nbAtomicShapes
} VisuAtomicShapeId;

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 ;

nbAtomicShapes

number of shapes.

VISU_RENDERING_ATOMIC_TYPE

#define VISU_RENDERING_ATOMIC_TYPE	     (visu_rendering_atomic_get_type ())

return the type of VisuRenderingAtomic.


VISU_RENDERING_ATOMIC()

#define VISU_RENDERING_ATOMIC(obj)	     (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_RENDERING_ATOMIC_TYPE, VisuRenderingAtomic))

Cast the given obj into VisuRenderingAtomic type.

obj :

a GObject to cast.

VISU_RENDERING_ATOMIC_CLASS()

#define VISU_RENDERING_ATOMIC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_RENDERING_ATOMIC_TYPE, VisuRenderingAtomicClass))

Cast the given klass into VisuRenderingAtomicClass.

klass :

a GObjectClass to cast.

IS_VISU_RENDERING_ATOMIC_TYPE()

#define IS_VISU_RENDERING_ATOMIC_TYPE(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_RENDERING_ATOMIC_TYPE))

Test if the given ogj is of the type of VisuRenderingAtomic object.

obj :

a GObject to test.

IS_VISU_RENDERING_ATOMIC_CLASS()

#define IS_VISU_RENDERING_ATOMIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, VISU_RENDERING_ATOMIC_TYPE))

Test if the given klass is of the type of VisuRenderingAtomicClass class.

klass :

a GObjectClass to test.

VISU_RENDERING_ATOMIC_GET_CLASS()

#define VISU_RENDERING_ATOMIC_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_RENDERING_ATOMIC_TYPE, VisuRenderingAtomicClass))

It returns the class of the given obj.

obj :

a GObject to get the class of.

visu_rendering_atomic_get_type ()

GType               visu_rendering_atomic_get_type      (void);

This method returns the type of VisuRenderingAtomic, use VISU_RENDERING_ATOMIC_TYPE instead.

Returns :

the type of VisuRenderingAtomic.

VISU_RENDERING_ATOMIC_NAME

#define VISU_RENDERING_ATOMIC_NAME "Atom visualisation"

Public name of the atomic rendering mode.


VisuRenderingAtomicClass

typedef struct _VisuRenderingAtomicClass VisuRenderingAtomicClass;

An opaque structure.


VisuRenderingAtomic

typedef struct _VisuRenderingAtomic VisuRenderingAtomic;

An opaque structure.


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_renderingAtomic_getRadius ()

float               visu_renderingAtomic_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_renderingAtomic_getRadiusDefault ()

float               visu_renderingAtomic_getRadiusDefault
                                                        ();

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

Returns :

the default value for radius resource.

visu_renderingAtomic_setRadius ()

int                 visu_renderingAtomic_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_renderingAtomic_getShape ()

VisuAtomicShapeId   visu_renderingAtomic_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 VisuAtomicShapeId to associate an integer value to a specific shape.

ele :

a VisuElement object.

Returns :

the shape id of the element ele.

visu_renderingAtomic_getShapeDefault ()

VisuAtomicShapeId   visu_renderingAtomic_getShapeDefault
                                                        ();

This method gets the default shape.

Returns :

the default shape id.

visu_renderingAtomic_getShapeName ()

const char*         visu_renderingAtomic_getShapeName   (VisuAtomicShapeId 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_renderingAtomic_getShapeNameDefault ()

const char*         visu_renderingAtomic_getShapeNameDefault
                                                        ();

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

Returns :

the name associated to the default shape.

visu_renderingAtomic_setShape ()

int                 visu_renderingAtomic_setShape       (VisuElement *ele,
                                                         VisuAtomicShapeId 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_renderingAtomic_setShapeFromName ()

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

This method is equivalent to visu_renderingAtomic_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.

visu_renderingAtomic_getAllShapes ()

const char**        visu_renderingAtomic_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_renderingAtomic_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_renderingAtomic_getAllShapesI18n ()

const char**        visu_renderingAtomic_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_renderingAtomic_setElipsoidParameters ()

gboolean            visu_renderingAtomic_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_renderingAtomic_getElipsoidRatio ()

float               visu_renderingAtomic_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_renderingAtomic_getElipsoidPhi ()

float               visu_renderingAtomic_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_renderingAtomic_getElipsoidTheta ()

float               visu_renderingAtomic_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_renderingAtomic_setElipsoidRatio ()

gboolean            visu_renderingAtomic_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_renderingAtomic_setElipsoidPhi ()

gboolean            visu_renderingAtomic_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_renderingAtomic_setElipsoidTheta ()

gboolean            visu_renderingAtomic_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.