![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
VisuExtension* initExtFogAndBG (); #define VISU_GLEXT_FOG_AND_BG_ID int visu_glExt_fog_setValues (float rgba[4]
,int mask
); gboolean visu_glExt_fog_setOn (gboolean value
); gboolean visu_glExt_fog_setUseSpecificColor (gboolean value
); #define VISU_GLEXT_FOG_MASK_START #define VISU_GLEXT_FOG_MASK_END gboolean visu_glExt_fog_setStartEndValues (float startEnd[2]
,int mask
); void visu_glExt_fog_getValues (float rgba[4]
); gboolean visu_glExt_fog_getOn (); gboolean visu_glExt_fog_getUseSpecificColor (); float visu_glExt_fog_getStart (); float visu_glExt_fog_getEnd (); int visu_glExt_bg_setValues (float rgba[3]
,int mask
); void visu_glExt_bg_getValues (float rgba[4]
); void visu_glExt_fog_create (VisuData *data
); void visu_glExt_fog_create_color (); void visu_glExt_bg_setImage (const guchar *imageData
,guint width
,guint height
,gboolean alpha
,const gchar *title
,gboolean fit
);
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.
VisuExtension* initExtFogAndBG ();
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 initVisuExtensions()
at V_Sim
startup.
Returns : |
a pointer to the VisuExtension it created or NULL otherwise. |
#define VISU_GLEXT_FOG_AND_BG_ID "FogAndColor"
The id used to identify this extension, see
visuExtensions_rebuildList()
for instance.
int visu_glExt_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. |
gboolean visu_glExt_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_glExt_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_glExt_fog_create() should be called. In all cases, 'OpenGLAskForReDraw'
signal should then be emitted.
|
#define VISU_GLEXT_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.
#define VISU_GLEXT_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.
gboolean visu_glExt_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_GLEXT_FOG_MASK_START, VISU_GLEXT_FOG_MASK_END to indicate what values in the startEnd array must be taken into account. |
Returns : |
TRUE if visu_glExt_fog_create() should be called and then 'OpenGLAskForReDraw'
signal be emitted.
|
void visu_glExt_fog_getValues (float rgba[4]
);
Read the RGBA value of the specific fog colour (in [0;1]).
|
a storage for four values. |
gboolean visu_glExt_fog_getOn ();
Read if fog is used or not.
Returns : |
TRUE if the fog is rendered, FALSE otherwise. |
gboolean visu_glExt_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. |
float visu_glExt_fog_getStart ();
Read the starting value of the fog (in [0;1]).
Returns : |
the position where the fog starts. |
float visu_glExt_fog_getEnd ();
Read the ending value of the fog (in [0;1]).
Returns : |
the position where the fog ends. |
int visu_glExt_bg_setValues (float rgba[3]
,int mask
);
Method used to change the value of the parameter background_color.
|
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. |
void visu_glExt_bg_getValues (float rgba[4]
);
Read the RGBA value of the specific background colour (in [0;1]).
|
a storage for four values. |
void visu_glExt_fog_create (VisuData *data
);
Call the OpenGL routine to enable and initialise the fog.
|
the VisuData object the fog apply to. |
void visu_glExt_fog_create_color ();
Call the OpenGL routines that change the colour of the fog.
void visu_glExt_bg_setImage (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.
|
raw image data in RGB or RGBA format ; |
|
the width ; |
|
the height ; |
|
TRUE if the image is RGBA ; |
|
an optional title (can be NULL). |
|
a boolean (default is TRUE). |