box

box — Draw a bounding box around nodes.

Synopsis




#define     EXT_BOX_ID
void        boxDraw                         (VisuData *data);
int         boxGet_isOn                     ();
float*      boxGet_RGBValues                ();
float       boxGet_lineWidth                ();
guint16     boxGet_expandStipple            ();
guint16     boxGet_lineStipple              ();
gboolean    boxSet_isOn                     (int value);
gboolean    boxSet_RGBValues                (float rgb[3],
                                             int mask);
gboolean    boxSet_lineWidth                (float width);
gboolean    boxSet_expandStipple            (guint16 stipple);
gboolean    boxSet_lineStipple              (guint16 stipple);

OpenGLExtension* initExtensionBox           ();

Description

This extension allows V_Sim to draw a box around the nodes. The box is defined in the VisuData structure and can be retrieved with visuDataGet_boxGeometry(). This box is not necessary orthogonal.

It has several properties, namely, its colour, its line width and its line pattern. It is represented in OpenGL with simple lines and is affected by the antialiasing property. Defined resources:

  • box_is_on (boolean): controls if a box is drawn around the rendering area (since 3.0).

  • box_color (RGB in [0;1]): defines the color of the box(since 3.0).

  • box_line_width (integer in [1;10]): defines the width of the lines of the box (since 3.0).

  • box_line_stipple (2 integers in ]0;65535]): dot scheme detail for the lines of the box. The first value is the pattern for the line of the main box and the second is the pattern for the lines of the expanded areas (since 3.4).

Details

EXT_BOX_ID

#define EXT_BOX_ID "Box"

The id used to identify this extension, see OpenGLExtensionRebuild_list() for instance.


boxDraw ()

void        boxDraw                         (VisuData *data);

This method create a compile list that draw a box for the given data.

data : a VisuData object.

boxGet_isOn ()

int         boxGet_isOn                     ();

Read if the box is drawn or not.

Returns : 1 if a box is drawn, 0 otherwise.

boxGet_RGBValues ()

float*      boxGet_RGBValues                ();

Read the colour components of box (in [0;1]).

Returns : all the colour values of the current box line.

boxGet_lineWidth ()

float       boxGet_lineWidth                ();

Read the line width used for box.

Returns : the value of current box line width.

boxGet_expandStipple ()

guint16     boxGet_expandStipple            ();

Read the line stipple pattern used for box (expanded part).

Returns : the value of current box line pattern.

boxGet_lineStipple ()

guint16     boxGet_lineStipple              ();

Read the line stipple pattern used for box (main part).

Returns : the value of current box line pattern.

boxSet_isOn ()

gboolean    boxSet_isOn                     (int value);

Method used to change the value of the parameter box_is_on.

value : 1 if box must be drawn, 0 otherwise.
Returns : TRUE if boxDraw() should be called.

boxSet_RGBValues ()

gboolean    boxSet_RGBValues                (float rgb[3],
                                             int mask);

Method used to change the value of the parameter box_color.

rgb : a three floats array with values (0 <= values <= 1) for the red, the green and the blue color. Only values specified by the mask are really relevant.
mask : use MASK_RGB_R, MASK_RGB_G, MASK_RGB_B, MASK_RGB_ALL or a combinaison to indicate what values in the rgb array must be taken into account.
Returns : TRUE if boxDraw() should be called.

boxSet_lineWidth ()

gboolean    boxSet_lineWidth                (float width);

Method used to change the value of the parameter box_line_width.

width : value of the desired box line width.
Returns : TRUE if boxDraw() should be called.

boxSet_expandStipple ()

gboolean    boxSet_expandStipple            (guint16 stipple);

Method used to change the value of the parameter box_line_stipple (expanded part).

stipple : a pattern for line stipple in OpenGL.
Returns : TRUE if boxDraw() should be called.

boxSet_lineStipple ()

gboolean    boxSet_lineStipple              (guint16 stipple);

Method used to change the value of the parameter box_line_stipple (main part).

stipple : a pattern for line stipple in OpenGL.
Returns : TRUE if boxDraw() should be called.

initExtensionBox ()

OpenGLExtension* initExtensionBox           ();

It initialises all variables of the OpenGL extension. It creates all resources and parameters introduced by this extension. This method should be added in the listInitExtensionFunc to be called automatically by the initOpenGLExtensions() at V_Sim startup.

Returns : a pointer to the OpenGLExtension it created or NULL otherwise.