cylinder

cylinder — Gives methods to draw cylinders as OpenGl objects pairing two elements.

Synopsis

#define             VISU_GL_PAIRS_CYLINDER_RADIUS_MAX
#define             VISU_GL_PAIRS_CYLINDER_RADIUS_MIN
enum                VisuGlPairsCylinderColorId;
VisuGlPairsCylinderColorId visu_gl_pairs_cylinder_getColorType
                                                        ();
float               visu_gl_pairs_cylinder_getGeneralRadius
                                                        ();
float               visu_gl_pairs_cylinder_getRadius    (VisuPairLink *data);
VisuPairExtension * visu_gl_pairs_cylinder_getStatic    ();
VisuPairExtension * visu_gl_pairs_cylinder_init         ();
gboolean            visu_gl_pairs_cylinder_setColorType (VisuGlPairsCylinderColorId val);
gboolean            visu_gl_pairs_cylinder_setGeneralRadius
                                                        (float val);
gboolean            visu_gl_pairs_cylinder_setRadius    (VisuPairLink *data,
                                                         float val);

Description

The cylinders have two characteristics: their radius and their colour. Their radius are in the units of the rendered box. They can be specific to each kind of pairs (e.g. Si-Si) or they have a default value. Only the default value is stored in the resource file with the flag "pairCylinder_radius". Their color is herited by the colour of the pair. The lighting values (i.e. emi., shi., spe. ...) are not movable and are fixed to amb = 0.5, dif = 0.5, shi = 0, spe = 0, emi = 0.

Details

VISU_GL_PAIRS_CYLINDER_RADIUS_MAX

#define VISU_GL_PAIRS_CYLINDER_RADIUS_MAX 3.f

Maximum value for the radius of cylinder pairs.


VISU_GL_PAIRS_CYLINDER_RADIUS_MIN

#define VISU_GL_PAIRS_CYLINDER_RADIUS_MIN 0.01f

Minimum value for the radius of cylinder pairs.


enum VisuGlPairsCylinderColorId

typedef enum {
    VISU_GL_PAIRS_CYLINDER_COLOR_USER,
    VISU_GL_PAIRS_CYLINDER_COLOR_ELEMENT,
    VISU_GL_PAIRS_CYLINDER_N_COLOR
} VisuGlPairsCylinderColorId;

Possible flags to colourise the cylinder pairs.

VISU_GL_PAIRS_CYLINDER_COLOR_USER

color is chosen by the user.

VISU_GL_PAIRS_CYLINDER_COLOR_ELEMENT

color is chosen according to the color of the VisuElement the pair is linked to.

VISU_GL_PAIRS_CYLINDER_N_COLOR

number of choices for the colourisation.

visu_gl_pairs_cylinder_getColorType ()

VisuGlPairsCylinderColorId visu_gl_pairs_cylinder_getColorType
                                                        ();

Get the color scheme.

Returns :

an integer corresponding to the color scheme (0 or 1).

visu_gl_pairs_cylinder_getGeneralRadius ()

float               visu_gl_pairs_cylinder_getGeneralRadius
                                                        ();

Get the default value for cylinder radius.

Returns :

the default value for cylinder radius.

visu_gl_pairs_cylinder_getRadius ()

float               visu_gl_pairs_cylinder_getRadius    (VisuPairLink *data);

Get the radius value for the specified pair.

data :

a VisuPairLink object.

Returns :

the radius value.

visu_gl_pairs_cylinder_getStatic ()

VisuPairExtension * visu_gl_pairs_cylinder_getStatic    ();

Internal use only to get the cylinder extension.


visu_gl_pairs_cylinder_init ()

VisuPairExtension * visu_gl_pairs_cylinder_init         ();

This method is used by V_Sim on startup, don't use it on your own.

Returns :

the cylinder pair extension.

visu_gl_pairs_cylinder_setColorType ()

gboolean            visu_gl_pairs_cylinder_setColorType (VisuGlPairsCylinderColorId val);

It set the color scheme for cylinder pairs. It can be 0 or 1.

val :

a integer that identify the color scheme.

Returns :

TRUE if the calling method should take care of VisuGlExtPairs objects, FALSE if not.

visu_gl_pairs_cylinder_setGeneralRadius ()

gboolean            visu_gl_pairs_cylinder_setGeneralRadius
                                                        (float val);

This method allows to change the default value of radius for cylinder pairs. When a pair is rendered via a cylinder, it first checks if that pairs has a specific radius value. If not, it uses the default value set by this method. If the default value is indeed changed, all VisuGlExtPairs objects should redraw themselves.

val :

a float value.

Returns :

TRUE if the calling method should take care of VisuGlExtPairs objects, FALSE if not.

visu_gl_pairs_cylinder_setRadius ()

gboolean            visu_gl_pairs_cylinder_setRadius    (VisuPairLink *data,
                                                         float val);

This method allows to change the radius value of a specific pair. When a pair is rendered via a cylinder, it first checks if that pairs has a specific radius value set by this method. If not, it uses the default value.

data :

a VisuPairLink object ;

val :

a float value.

Returns :

TRUE if the value is changed.