![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define VISU_GL_EXT_BG_ID #define VISU_GL_EXT_FOG_MASK_END #define VISU_GL_EXT_FOG_MASK_START struct VisuGlExtBg; struct VisuGlExtBgClass; void visu_gl_ext_bg_draw (VisuGlExtBg *bg
); VisuGlExtBg * visu_gl_ext_bg_getDefault (); void visu_gl_ext_bg_getRGBA (VisuGlExtBg *bg
,float rgba[4]
); VisuGlExtBg * visu_gl_ext_bg_new (const gchar *name
); gboolean visu_gl_ext_bg_setCamera (VisuGlExtBg *bg
,float zoom
,float xs
,float ys
); gboolean visu_gl_ext_bg_setFollowCamera (VisuGlExtBg *bg
,gboolean follow
,float zoomInit
,float xs
,float ys
); gboolean visu_gl_ext_bg_setGlView (VisuGlExtBg *bg
,VisuGlView *view
); void visu_gl_ext_bg_setImage (VisuGlExtBg *bg
,const guchar *imageData
,guint width
,guint height
,gboolean alpha
,const gchar *title
,gboolean fit
); int visu_gl_ext_bg_setRGBA (VisuGlExtBg *bg
,float rgba[3]
,int mask
); void visu_gl_ext_fog_create (VisuGlView *view
,VisuBox *box
); void visu_gl_ext_fog_create_color (); float visu_gl_ext_fog_getEnd (); gboolean visu_gl_ext_fog_getOn (); float visu_gl_ext_fog_getStart (); gboolean visu_gl_ext_fog_getUseSpecificColor (); void visu_gl_ext_fog_getValues (float rgba[4]
); void visu_gl_ext_fog_init (); gboolean visu_gl_ext_fog_setOn (gboolean value
); gboolean visu_gl_ext_fog_setStartEndValues (float startEnd[2]
,int mask
); gboolean visu_gl_ext_fog_setUseSpecificColor (gboolean value
); int visu_gl_ext_fog_setValues (float rgba[4]
,int mask
);
This module is used to support a background colour and to tune the fog. This last one can be turn on or off and its colour can be either a user defined one or the one of the background. The fog is a linear blending into the fog colour. It starts at a given z position (in the camera basis set) and ends at a lower z.
#define VISU_GL_EXT_BG_ID "Background"
The id used to identify this extension, see
visu_gl_ext_rebuild()
for instance.
#define VISU_GL_EXT_FOG_MASK_END (1 << 1)
Value used by the second parameter of setFogStartEndValues()
to
specified the value that must be changed. This actually changes
the fog_end value.
#define VISU_GL_EXT_FOG_MASK_START (1 << 0)
Value used by the second parameter of setFogStartEndValues()
to
specified the value that must be changed. This actually changes
the fog_start value.
struct VisuGlExtBgClass { VisuGlExtClass parent; };
A short way to identify _VisuGlExtBgClass structure.
VisuGlExtClass |
the parent class; |
Since 3.7
void visu_gl_ext_bg_draw (VisuGlExtBg *bg
);
Creates the OpenGL lists used by bg
(like the background image).
|
a VisuGlExtBg object. |
Since 3.7
VisuGlExtBg * visu_gl_ext_bg_getDefault ();
V_Sim is using a default bg object.
Returns : |
a VisuGlExtBg object used by default. [transfer none] |
Since 3.7
void visu_gl_ext_bg_getRGBA (VisuGlExtBg *bg
,float rgba[4]
);
Read the RGBA value of the specific background colour (in [0;1]).
|
a VisuGlExtBg object. |
|
a storage for four values. [array fixed-size=4][out] |
VisuGlExtBg * visu_gl_ext_bg_new (const gchar *name
);
Creates a new VisuGlExt to draw bg.
|
the name to give to the extension (default is VISU_GL_EXT_BG_ID). [allow-none] |
Returns : |
a pointer to the VisuGlExt it created or NULL otherwise. |
Since 3.7
gboolean visu_gl_ext_bg_setCamera (VisuGlExtBg *bg
,float zoom
,float xs
,float ys
);
If the background image is in follow mode, see
visu_gl_ext_bg_setFollowCamera()
, this routine is used to update
the current camera settings of the background image.
|
a VisuGlExtBg object. |
|
a floating point value. |
|
a floating point value. |
|
a floating point value. |
Returns : |
TRUE if the settings are indeed changed. |
Since 3.7
gboolean visu_gl_ext_bg_setFollowCamera (VisuGlExtBg *bg
,gboolean follow
,float zoomInit
,float xs
,float ys
);
When follow
is TRUE, the size and the position of the background
image is adjusted with every camera change.
|
a VisuGlExtBg object. |
|
a boolean. |
|
a floating point value. |
|
a floating point value. |
|
a floating point value. |
Returns : |
TRUE if the following status has been changed. |
Since 3.7
gboolean visu_gl_ext_bg_setGlView (VisuGlExtBg *bg
,VisuGlView *view
);
Set the view
bg
is drawn to. It is necessary if bg
has a
background image or is using transparency background colour.
|
a VisuGlExtBg object. |
|
a VisuGlView object. [transfer full][allow-none] |
Returns : |
TRUE is view is new. |
Since 3.7
void visu_gl_ext_bg_setImage (VisuGlExtBg *bg
,const guchar *imageData
,guint width
,guint height
,gboolean alpha
,const gchar *title
,gboolean fit
);
Draw the imageData
on the background. The image is scaled to the
viewport dimensions, keeping the width/height ratio, if fit
is set
to TRUE. If title
is not NULL, the title is also printed on the
background. The image data are copied and can be free after this
call.
|
a VisuGlExtBg object. |
|
raw image data in RGB or RGBA format ;. [allow-none] |
|
the width ; |
|
the height ; |
|
TRUE if the image is RGBA ; |
|
an optional title (can be NULL). [allow-none] |
|
a boolean (default is TRUE). |
int visu_gl_ext_bg_setRGBA (VisuGlExtBg *bg
,float rgba[3]
,int mask
);
Method used to change the value of the parameter background_color.
|
a VisuGlExtBg object. |
|
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. |
|
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 visu_gl_ext_bg_draw() should be aclled. |
void visu_gl_ext_fog_create (VisuGlView *view
,VisuBox *box
);
Call the OpenGL routine to enable and initialise the fog. The fog
is created in the not duplicated cell of box
.
|
the VisuGlView object the fog apply to. |
|
the VisuBox object to delimit the area start and end. |
void visu_gl_ext_fog_create_color ();
Call the OpenGL routines that change the colour of the fog.
float visu_gl_ext_fog_getEnd ();
Read the ending value of the fog (in [0;1]).
Returns : |
the position where the fog ends. |
gboolean visu_gl_ext_fog_getOn ();
Read if fog is used or not.
Returns : |
TRUE if the fog is rendered, FALSE otherwise. |
float visu_gl_ext_fog_getStart ();
Read the starting value of the fog (in [0;1]).
Returns : |
the position where the fog starts. |
gboolean visu_gl_ext_fog_getUseSpecificColor ();
Read if fog uses a specific colour or not.
Returns : |
TRUE if the fog uses its own color or FALSE if it uses the color of the background. |
void visu_gl_ext_fog_getValues (float rgba[4]
);
Read the RGBA value of the specific fog colour (in [0;1]).
|
a storage for four values. |
void visu_gl_ext_fog_init ();
It initialises all variables of the OpenGL extension. It creates all resources and parameters introduced by this extension.
Returns : |
a pointer to the VisuGlExt it created or NULL otherwise. |
gboolean visu_gl_ext_fog_setOn (gboolean value
);
Method used to change the value of the parameter fog_is_on.
|
TRUE if fog must be rendered, FALSE otherwise. |
Returns : |
FALSE if redrawing is not necessary. TRUE if the rendering window must be redrawn. |
gboolean visu_gl_ext_fog_setStartEndValues (float startEnd[2]
,int mask
);
Method used to change the value of the parameters fog_start and fog_end.
|
a two floats array with values (0 <= values <= 1) for the beging and the ending of the fog position. Only values specified by the mask are really relevant. |
|
use VISU_GL_EXT_FOG_MASK_START, VISU_GL_EXT_FOG_MASK_END to indicate what values in the startEnd array must be taken into account. |
Returns : |
TRUE if visu_gl_ext_fog_create() should be called and then 'OpenGLAskForReDraw'
signal be emitted. |
gboolean visu_gl_ext_fog_setUseSpecificColor (gboolean value
);
Method used to change the value of the parameter fog_color_is_specific.
|
TRUE if fog is rendered with its own color specified
by setFogRGBValues() or FALSE if the fog uses the background
color. |
Returns : |
TRUE if visu_gl_ext_fog_create() should be called. In all cases, 'OpenGLAskForReDraw'
signal should then be emitted. |
int visu_gl_ext_fog_setValues (float rgba[4]
,int mask
);
Method used to change the value of the parameter fog_specific_color.
This color is actually used only if fog_color_is_specific is set to 1,
use setFogColorSpecific()
to do that.
|
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. |
|
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 : |
0 if redrawing is not necessary. 1 if the rendering window must be redrawn. |