scale

scale — Draw an arrow with a label.

Synopsis

#define             VISU_GLEXT_XYZ_MASK_X
#define             VISU_GLEXT_XYZ_MASK_Y
#define             VISU_GLEXT_XYZ_MASK_Z
#define             VISU_GLEXT_XYZ_MASK_ALL
#define             VISU_GLEXT_SCALE_TYPE
#define             VISU_GLEXT_SCALE                    (obj)
#define             VISU_GLEXT_SCALE_CLASS              (klass)
#define             VISU_GLEXT_IS_SCALE                 (obj)
#define             VISU_GLEXT_SCALE_GET_CLASS          (obj)
                    VisuGlExtScaleClass;
                    VisuGlExtScale;
gboolean            visu_glExt_scale_setDefaultRGBValues
                                                        (float rgba[4],
                                                         int mask);
gboolean            visu_glExt_scale_setDefaultLineWidth
                                                        (float width);
gboolean            visu_glExt_scale_setOn              (gboolean value);
gboolean            visu_glExt_scale_setDefaultStipple  (guint16 stipple);
float*              visu_glExt_scale_getDefaultRGBValues
                                                        ();
gboolean            visu_glExt_scale_getOn              ();
float               visu_glExt_scale_getDefaultLineWidth
                                                        ();
guint16             visu_glExt_scale_getDefaultStipple  ();
void                visu_glExt_scale_drawAll            (VisuOpenGLCamera *camera,
                                                         guint winSize);
GList*              visu_glExt_scale_getAll             ();
VisuGlExtScale*     visu_glExt_scale_new                (float origin[3],
                                                         float orientation[3],
                                                         float length,
                                                         const gchar *legend);
gboolean            visu_glExt_scale_setOrigin          (VisuGlExtScale *scale,
                                                         float xyz[3],
                                                         int mask);
gboolean            visu_glExt_scale_setOrientation     (VisuGlExtScale *scale,
                                                         float xyz[3],
                                                         int mask);
gboolean            visu_glExt_scale_setLength          (VisuGlExtScale *scale,
                                                         float lg);
gboolean            visu_glExt_scale_setLegend          (VisuGlExtScale *scale,
                                                         const gchar *value);
const gchar*        visu_glExt_scale_getLegend          (VisuGlExtScale *scale);
float               visu_glExt_scale_getLength          (VisuGlExtScale *scale);
float*              visu_glExt_scale_getOrigin          (VisuGlExtScale *scale);
float*              visu_glExt_scale_getOrientation     (VisuGlExtScale *scale);

Object Hierarchy

  GObject
   +----VisuGlExtScale

Description

This little extension is used to draw an arrow at a given position displaying a given length.

Details

VISU_GLEXT_XYZ_MASK_X

#define VISU_GLEXT_XYZ_MASK_X (1 << 0)

This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value actually correspond to the x direction.

Since 3.3


VISU_GLEXT_XYZ_MASK_Y

#define VISU_GLEXT_XYZ_MASK_Y (1 << 1)

This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value actually correspond to the y direction.

Since 3.3


VISU_GLEXT_XYZ_MASK_Z

#define VISU_GLEXT_XYZ_MASK_Z (1 << 2)

This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value actually correspond to the z direction.

Since 3.3


VISU_GLEXT_XYZ_MASK_ALL

#define VISU_GLEXT_XYZ_MASK_ALL (7)

This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value is a shortcut for VISU_GLEXT_XYZ_MASK_X | VISU_GLEXT_XYZ_MASK_Y | VISU_GLEXT_XYZ_MASK_Z.

Since 3.3


VISU_GLEXT_SCALE_TYPE

#define VISU_GLEXT_SCALE_TYPE	     (visu_glExt_scale_get_type ())

return the type of VisuGlExtScale.

Since 3.3


VISU_GLEXT_SCALE()

#define VISU_GLEXT_SCALE(obj)	     (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_GLEXT_SCALE_TYPE, VisuGlExtScale))

Cast the given obj into VisuGlExtScale type.

obj :

a GObject to cast.

Since 3.3


VISU_GLEXT_SCALE_CLASS()

#define VISU_GLEXT_SCALE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_GLEXT_SCALE_TYPE, VisuGlExtScaleClass))

Cast the given klass into VisuGlExtScaleClass.

klass :

a GObjectClass to cast.

Since 3.3


VISU_GLEXT_IS_SCALE()

#define VISU_GLEXT_IS_SCALE(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_GLEXT_SCALE_TYPE))

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

obj :

a GObject to test.

Since 3.3


VISU_GLEXT_SCALE_GET_CLASS()

#define VISU_GLEXT_SCALE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_GLEXT_SCALE_TYPE, VisuGlExtScaleClass))

It returns the class of the given obj.

obj :

a GObject to get the class of.

Since 3.3


VisuGlExtScaleClass

typedef struct _VisuGlExtScaleClass VisuGlExtScaleClass;

An opaque structure.

Since 3.3


VisuGlExtScale

typedef struct _VisuGlExtScale VisuGlExtScale;

All fields are private, use the access routines.

Since 3.3


visu_glExt_scale_setDefaultRGBValues ()

gboolean            visu_glExt_scale_setDefaultRGBValues
                                                        (float rgba[4],
                                                         int mask);

Method used to change the value of the private parameter scales_color. This affects all the drawn scales.

rgba :

a four floats array with values (0 <= values <= 1) for the red, the green, the blue and the alpha color. Only values specified by the mask are really relevant.

mask :

use TOOL_COLOR_MASK_R, TOOL_COLOR_MASK_G, TOOL_COLOR_MASK_B, TOOL_COLOR_MASK_RGBA or a combinaison to indicate what values in the rgb array must be taken into account.

Returns :

TRUE if scaleDraw() should be called and then 'OpenGLAskForReDraw' signal be emitted.

Since 3.3


visu_glExt_scale_setDefaultLineWidth ()

gboolean            visu_glExt_scale_setDefaultLineWidth
                                                        (float width);

Method used to change the value of the parameter scale_line_width. This affects all the drawn scales.

width :

value of the desired width.

Returns :

TRUE if scaleDraw() should be called and then 'OpenGLAskForReDraw' signal be emitted.

Since 3.3


visu_glExt_scale_setOn ()

gboolean            visu_glExt_scale_setOn              (gboolean value);

Method used to change the value of the parameter Scale_are_on.

value :

1 if a scale must be drawn, 0 otherwise.

Returns :

1 if scaleDraw() should be called. In all cases, 'OpenGLAskForReDraw' signal should then be emitted.

Since 3.3


visu_glExt_scale_setDefaultStipple ()

gboolean            visu_glExt_scale_setDefaultStipple  (guint16 stipple);

The scales share a line pattern for the stick of the arrow.

stipple :

a pattern for line.

Returns :

TRUE if scale are drawn, FALSE otherwise.

Since 3.3


visu_glExt_scale_getDefaultRGBValues ()

float*              visu_glExt_scale_getDefaultRGBValues
                                                        ();

All the scales shared a common colour.

Returns :

a four component array.

Since 3.3


visu_glExt_scale_getOn ()

gboolean            visu_glExt_scale_getOn              ();

The scales can be turned off or on.

Returns :

TRUE if scale are drawn, FALSE otherwise.

Since 3.3


visu_glExt_scale_getDefaultLineWidth ()

float               visu_glExt_scale_getDefaultLineWidth
                                                        ();

The scales share a line width for the stick of the arrow.

Returns :

the value of current width.

Since 3.3


visu_glExt_scale_getDefaultStipple ()

guint16             visu_glExt_scale_getDefaultStipple  ();

The scales share a line pattern for the stick of the arrow.

Returns :

the value of current stipple pattern.

Since 3.3


visu_glExt_scale_drawAll ()

void                visu_glExt_scale_drawAll            (VisuOpenGLCamera *camera,
                                                         guint winSize);

This method creates a compile list that draw all scales.

camera :

a VisuOpenGLCamera object.

winSize :

the size of the rendering area.

Since 3.3


visu_glExt_scale_getAll ()

GList*              visu_glExt_scale_getAll             ();

All the available scales can be retrieve with this method.

Returns :

a private GList.

Since 3.3


visu_glExt_scale_new ()

VisuGlExtScale*     visu_glExt_scale_new                (float origin[3],
                                                         float orientation[3],
                                                         float length,
                                                         const gchar *legend);

Create a new arrow pointing somewhere in the box with a label. If legend is NULL, then the label will be the value of the length.

origin :

the origin ;

orientation :

the orientation in cartesian coordinates ;

length :

the length of the arrow ;

legend :

the text going with the arrow (can be NULL).

Returns :

a newly created VisuGlExtScale object.

Since 3.3


visu_glExt_scale_setOrigin ()

gboolean            visu_glExt_scale_setOrigin          (VisuGlExtScale *scale,
                                                         float xyz[3],
                                                         int mask);

Routine that changes the origin of the scale.

scale :

the VisuGlExtScale to modify ;

xyz :

a vector in cartesian coordinates ;

mask :

relevant values in xyz.

Returns :

TRUE if visu_glExt_scale_drawAll() should be called.

Since 3.3


visu_glExt_scale_setOrientation ()

gboolean            visu_glExt_scale_setOrientation     (VisuGlExtScale *scale,
                                                         float xyz[3],
                                                         int mask);

Routine that changes the direction of the scale.

scale :

the VisuGlExtScale to modify ;

xyz :

a vector in cartesian coordinates ;

mask :

relevant values in xyz.

Returns :

TRUE if visu_glExt_scale_drawAll() should be called.

Since 3.3


visu_glExt_scale_setLength ()

gboolean            visu_glExt_scale_setLength          (VisuGlExtScale *scale,
                                                         float lg);

Routine that changes the length of the scale.

scale :

the VisuGlExtScale to modify ;

lg :

a positive length.

Returns :

TRUE if visu_glExt_scale_drawAll() should be called.

Since 3.3


visu_glExt_scale_setLegend ()

gboolean            visu_glExt_scale_setLegend          (VisuGlExtScale *scale,
                                                         const gchar *value);

Routine that changes the legend of the scale. If value is NULL then the length of the scale is printed.

scale :

the VisuGlExtScale to modify ;

value :

a string (can be NULL).

Returns :

TRUE if visu_glExt_scale_drawAll() should be called.

Since 3.3


visu_glExt_scale_getLegend ()

const gchar*        visu_glExt_scale_getLegend          (VisuGlExtScale *scale);

A VisuGlExtScale can have a legend. This is not actualy the string printed on screen but the one used to generate it.

scale :

the VisuGlExtScale to poll.

Returns :

a string (private, do not free it).

Since 3.3


visu_glExt_scale_getLength ()

float               visu_glExt_scale_getLength          (VisuGlExtScale *scale);

A VisuGlExtScale is characterised by its length.

scale :

the VisuGlExtScale to poll.

Returns :

a positive floating point value.

Since 3.3


visu_glExt_scale_getOrigin ()

float*              visu_glExt_scale_getOrigin          (VisuGlExtScale *scale);

A VisuGlExtScale is characterised by its origin in cartesian coordinates.

scale :

the VisuGlExtScale to poll.

Returns :

three floating point values.

Since 3.3


visu_glExt_scale_getOrientation ()

float*              visu_glExt_scale_getOrientation     (VisuGlExtScale *scale);

A VisuGlExtScale is characterised by its orientation in cartesian coordinates.

scale :

the VisuGlExtScale to poll.

Returns :

three floating point values.

Since 3.3