VisuGlExtScale

VisuGlExtScale — Draw an arrow with a label.

Synopsis

struct              VisuGlExtScale;
struct              VisuGlExtScaleClass;
guint               visu_gl_ext_scale_add               (VisuGlExtScale *scale,
                                                         float origin[3],
                                                         float orientation[3],
                                                         float length,
                                                         const gchar *legend);
void                visu_gl_ext_scale_draw              (VisuGlExtScale *scale);
VisuGlExtScale *    visu_gl_ext_scale_getDefault        ();
float               visu_gl_ext_scale_getDefaultLineWidth
                                                        ();
float *             visu_gl_ext_scale_getDefaultRGB     ();
guint16             visu_gl_ext_scale_getDefaultStipple ();
const gchar *       visu_gl_ext_scale_getLegend         (VisuGlExtScale *scale,
                                                         guint i);
float               visu_gl_ext_scale_getLength         (VisuGlExtScale *scale,
                                                         guint i);
guint               visu_gl_ext_scale_getNArrows        (VisuGlExtScale *scale);
float *             visu_gl_ext_scale_getOrientation    (VisuGlExtScale *scale,
                                                         guint i);
float *             visu_gl_ext_scale_getOrigin         (VisuGlExtScale *scale,
                                                         guint i);
gboolean            visu_gl_ext_scale_setDefaultLineWidth
                                                        (float width);
gboolean            visu_gl_ext_scale_setDefaultRGB     (float rgba[4],
                                                         int mask);
gboolean            visu_gl_ext_scale_setDefaultStipple (guint16 stipple);
gboolean            visu_gl_ext_scale_setGlView         (VisuGlExtScale *scale,
                                                         VisuGlView *view);
gboolean            visu_gl_ext_scale_setLegend         (VisuGlExtScale *scale,
                                                         guint i,
                                                         const gchar *value);
gboolean            visu_gl_ext_scale_setLength         (VisuGlExtScale *scale,
                                                         guint i,
                                                         float lg);
gboolean            visu_gl_ext_scale_setOrientation    (VisuGlExtScale *scale,
                                                         guint i,
                                                         float xyz[3],
                                                         int mask);
gboolean            visu_gl_ext_scale_setOrigin         (VisuGlExtScale *scale,
                                                         guint i,
                                                         float xyz[3],
                                                         int mask);

Object Hierarchy

  GObject
   +----VisuGlExt
         +----VisuGlExtScale

Description

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

Details

struct VisuGlExtScale

struct VisuGlExtScale;

All fields are private, use the access routines.

Since 3.3


struct VisuGlExtScaleClass

struct VisuGlExtScaleClass {
  VisuGlExtClass parent;
};

An opaque structure.

VisuGlExtClass parent;

parent structure.

Since 3.3


visu_gl_ext_scale_add ()

guint               visu_gl_ext_scale_add               (VisuGlExtScale *scale,
                                                         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.

scale :

the VisuGlExtScale object to add to.

origin :

the origin ;. [array fixed-size=3]

orientation :

the orientation in cartesian coordinates ;. [array fixed-size=3]

length :

the length of the arrow ;

legend :

the text going with the arrow (can be NULL). [allow-none]

Returns :

the id of the newly added arrow.

Since 3.7


visu_gl_ext_scale_draw ()

void                visu_gl_ext_scale_draw              (VisuGlExtScale *scale);

This method creates a compile list that draw all arrow of a scale.

scale :

the VisuGlExtScale object to draw.

Since 3.3


visu_gl_ext_scale_getDefault ()

VisuGlExtScale *    visu_gl_ext_scale_getDefault        ();

The default VisuGlExtScale object used by V_Sim.

Returns :

a VisuGlExtScale object. [transfer none]

Since 3.7


visu_gl_ext_scale_getDefaultLineWidth ()

float               visu_gl_ext_scale_getDefaultLineWidth
                                                        ();

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

Returns :

the value of current width.

Since 3.3


visu_gl_ext_scale_getDefaultRGB ()

float *             visu_gl_ext_scale_getDefaultRGB     ();

All the scales shared a common colour.

Returns :

a four component array. [array fixed-size=4][transfer none]

Since 3.3


visu_gl_ext_scale_getDefaultStipple ()

guint16             visu_gl_ext_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_gl_ext_scale_getLegend ()

const gchar *       visu_gl_ext_scale_getLegend         (VisuGlExtScale *scale,
                                                         guint i);

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.

i :

the ith arrow.

Returns :

a string (private, do not free it). [allow-none]

Since 3.3


visu_gl_ext_scale_getLength ()

float               visu_gl_ext_scale_getLength         (VisuGlExtScale *scale,
                                                         guint i);

A VisuGlExtScale is characterised by its length.

scale :

the VisuGlExtScale to poll.

i :

the ith arrow.

Returns :

a positive floating point value or a negative value if i is not in the arrow list.

Since 3.3


visu_gl_ext_scale_getNArrows ()

guint               visu_gl_ext_scale_getNArrows        (VisuGlExtScale *scale);

A VisuGlExtScale is characterised by a set of arrows.

scale :

the VisuGlExtScale to poll.

Returns :

the number of stored arrows.

Since 3.7


visu_gl_ext_scale_getOrientation ()

float *             visu_gl_ext_scale_getOrientation    (VisuGlExtScale *scale,
                                                         guint i);

A VisuGlExtScale is characterised by its orientation in cartesian coordinates.

scale :

the VisuGlExtScale to poll.

i :

the ith arrow.

Returns :

three floating point values. [array fixed-size=3][transfer none][allow-none]

Since 3.3


visu_gl_ext_scale_getOrigin ()

float *             visu_gl_ext_scale_getOrigin         (VisuGlExtScale *scale,
                                                         guint i);

A VisuGlExtScale is characterised by its origin in cartesian coordinates.

scale :

the VisuGlExtScale to poll.

i :

the ith arrow.

Returns :

three floating point values. [array fixed-size=3][transfer none][allow-none]

Since 3.3


visu_gl_ext_scale_setDefaultLineWidth ()

gboolean            visu_gl_ext_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_gl_ext_scale_setDefaultRGB ()

gboolean            visu_gl_ext_scale_setDefaultRGB     (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_gl_ext_scale_setDefaultStipple ()

gboolean            visu_gl_ext_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_gl_ext_scale_setGlView ()

gboolean            visu_gl_ext_scale_setGlView         (VisuGlExtScale *scale,
                                                         VisuGlView *view);

Attach view to scale, so rendering is updated when view is modified.

scale :

a VisuGlExtScale object.

view :

a VisuGlView object. [transfer full]

Returns :

TRUE if view is changed.

Since 3.7


visu_gl_ext_scale_setLegend ()

gboolean            visu_gl_ext_scale_setLegend         (VisuGlExtScale *scale,
                                                         guint i,
                                                         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 ;

i :

the ith arrow ;

value :

a string (can be NULL). [allow-none]

Returns :

TRUE if visu_gl_ext_scale_draw() should be called.

Since 3.3


visu_gl_ext_scale_setLength ()

gboolean            visu_gl_ext_scale_setLength         (VisuGlExtScale *scale,
                                                         guint i,
                                                         float lg);

Routine that changes the length of the scale.

scale :

the VisuGlExtScale to modify ;

i :

the ith arrow ;

lg :

a positive length.

Returns :

TRUE if visu_gl_ext_scale_draw() should be called.

Since 3.3


visu_gl_ext_scale_setOrientation ()

gboolean            visu_gl_ext_scale_setOrientation    (VisuGlExtScale *scale,
                                                         guint i,
                                                         float xyz[3],
                                                         int mask);

Routine that changes the direction of the scale.

scale :

the VisuGlExtScale to modify ;

i :

the ith arrow ;

xyz :

a vector in cartesian coordinates ;. [array fixed-size=3]

mask :

relevant values in xyz, see TOOL_XYZ_MASK_X...

Returns :

TRUE if visu_gl_ext_scale_draw() should be called.

Since 3.3


visu_gl_ext_scale_setOrigin ()

gboolean            visu_gl_ext_scale_setOrigin         (VisuGlExtScale *scale,
                                                         guint i,
                                                         float xyz[3],
                                                         int mask);

Routine that changes the origin of the scale.

scale :

the VisuGlExtScale to modify ;

i :

the ith arrow ;

xyz :

a vector in cartesian coordinates ;. [array fixed-size=3]

mask :

relevant values in xyz, see TOOL_XYZ_MASK_X...

Returns :

TRUE if visu_gl_ext_scale_draw() should be called.

Since 3.3