![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
VisuGlExtVisuGlExt — All objects drawn by V_Sim are defined in by a VisuGlExt object |
#define VISU_GL_EXT_PRIORITY_BACKGROUND #define VISU_GL_EXT_PRIORITY_HIGH #define VISU_GL_EXT_PRIORITY_LAST #define VISU_GL_EXT_PRIORITY_LOW #define VISU_GL_EXT_PRIORITY_NODES #define VISU_GL_EXT_PRIORITY_NODE_DECORATIONS #define VISU_GL_EXT_PRIORITY_NORMAL struct VisuGlExt; struct VisuGlExtClass; VisuGlExtClassPrivate; void visu_gl_ext_call (VisuGlExt *extension
,gboolean lastOnly
); gboolean visu_gl_ext_getActive (VisuGlExt *extension
); GList * visu_gl_ext_getAll (void
); VisuGlExt * visu_gl_ext_getFromName (const char *name
); guint visu_gl_ext_getGlList (VisuGlExt *extension
); VisuGlRenderingMode visu_gl_ext_getPreferedRenderingMode (VisuGlExt *extension
); gboolean visu_gl_ext_getSensitiveToRenderingMode (VisuGlExt *extension
); void visu_gl_ext_rebuild (VisuGlExt *self
); void visu_gl_ext_rebuildAll (void
); gboolean visu_gl_ext_setActive (VisuGlExt *extension
,gboolean value
); gboolean visu_gl_ext_setPreferedRenderingMode (VisuGlExt *extension
,VisuGlRenderingMode value
); void visu_gl_ext_setPriority (VisuGlExt *extension
,guint priority
); void visu_gl_ext_setSaveState (VisuGlExt *extension
,gboolean saveState
); void visu_gl_ext_setSensitiveToRenderingMode (VisuGlExt *extension
,gboolean status
);
GObject +----VisuGlExt +----VisuGlExtAxes +----VisuGlExtBg +----VisuGlExtBox +----VisuGlExtFrame +----VisuGlExtNodeVectors +----VisuGlExtInfos +----VisuGlExtMaps +----VisuGlExtMarks +----VisuGlExtNodes +----VisuGlExtPairs +----VisuGlExtPaths +----VisuGlExtPlanes +----VisuGlExtScale +----VisuGlExtSurfaces
"active" gboolean : Read / Write "description" gchar* : Read / Write "label" gchar* : Read / Write / Construct "nGlObj" guint : Read / Write / Construct Only "name" gchar* : Read / Write / Construct Only "priority" guint : Read / Write "saveState" gboolean : Read / Write
All objects that are drawn by V_Sim are handled by a
VisuGlExt object. Such an object has an OpenGL list. This
list is only COMPILED. When V_Sim receives the 'OpenGLAskForReDraw'
or the 'OpenGLForceReDraw' signals, each list of all known
VisuGlExt are excecuted. This excecution can be canceled if
the used flag of the VisuGlExt object is set to FALSE. The
order in which the lists are called depends on the priority of the
VisuGlExt object. This priority is set to
VISU_GL_EXT_PRIORITY_NORMAL as default value, but it can be
tune by a call to visu_gl_ext_setPriority()
. This priority is
an integer, the lower it is, the sooner the list is
excecuted.
The method registerVisuGlExt()
is used to declare to
V_Sim that there is a new VisuGlExt object available. This
allows to create extension when V_Sim is already
running. Nevertheless, an extension must be initialized in the
initialisation process, it is better to add an
initVisuGlExtFunc method in the listInitExtensionFunc array
declared in extensions/externalVisuGlExts.h.
Once again, the OpenGL list corresponding to an OpenGL
extension is COMPILE only. Then, OpenGL methods like glIsenabled()
are totally unusefull because it is called when the list is
compiled not when the list is called. If the extension needs to
alter some OpenGL state, such as desable GL_LIGHTING, it needs to
set a flag for the extension. With this flag, V_Sim will save the
OpenGL states and restore it when the list is called. Use
visu_gl_ext_setSaveState()
to set this flag.
#define VISU_GL_EXT_PRIORITY_BACKGROUND 0
An extension with this priority is drawn first.
#define VISU_GL_EXT_PRIORITY_HIGH 20
An extension with this priority is drawn after the higher priorities.
#define VISU_GL_EXT_PRIORITY_LAST 100
An extension with this priority is drawn last.
#define VISU_GL_EXT_PRIORITY_LOW 80
An extension with this priority is drawn among last extensions.
#define VISU_GL_EXT_PRIORITY_NODES 2
An extension with this priority is drawn alsmost first with the nodes.
#define VISU_GL_EXT_PRIORITY_NODE_DECORATIONS 5
An extension with this priority is drawn just after the nodes.
#define VISU_GL_EXT_PRIORITY_NORMAL 50
An extension with this priority is drawn after the higher priorities.
struct VisuGlExtClass { GObjectClass parent; void (*rebuild)(VisuGlExt *self); VisuGlExtClassPrivate *priv; };
Common name to refer to a _VisuGlExtClass.
GObjectClass |
private. |
a rebuilding function for this extension. | |
VisuGlExtClassPrivate * |
private. |
typedef struct _VisuGlExtClassPrivate VisuGlExtClassPrivate;
Private data for VisuGlExtClass classes.
void visu_gl_ext_call (VisuGlExt *extension
,gboolean lastOnly
);
Select the VisuGlExt matching the given name
and call
it. The call is indeed done only if the extension is used. If
lastOnly
is TRUE, the list is called only if it has a
VISU_GL_EXT_PRIORITY_LAST priority. On the contrary the list
is called only if its priority is lower than
VISU_GL_EXT_PRIORITY_LAST.
|
a VisuGlExt object. |
|
a boolean. |
gboolean visu_gl_ext_getActive (VisuGlExt *extension
);
Get if the extension is used or not. If not its ObjectList is not rendered.
|
the extension. |
Returns : |
TRUE if used, FALSE otherwise. |
GList * visu_gl_ext_getAll (void
);
This method is used to get the list of all registered VisuGlExt. This list is own by V_Sim and should not be freed.
Returns : |
the list of all VisuGlExt. [element-type VisuGlExt*][transfer none] |
VisuGlExt * visu_gl_ext_getFromName (const char *name
);
VisuGlExt objects are identified by an id.
|
a string identifying a VisuGlExt object. |
Returns : |
a VisuGlExt object matching name . [transfer none]
|
Since 3.7
guint visu_gl_ext_getGlList (VisuGlExt *extension
);
All VisuGlExt objects have a master OpenGL list to draw to. This routine gets the identifier of this list.
|
a VisuGlExt method. |
Returns : |
an OpenGL identifier id for extension . |
Since 3.7
VisuGlRenderingMode visu_gl_ext_getPreferedRenderingMode
(VisuGlExt *extension
);
Each VisuGlExt method can draw in a mode different from the
global one, see VisuGlRenderingMode. See also
visu_gl_ext_setPreferedRenderingMode()
.
|
a VisuGlExt method. |
Returns : |
the prefered rendering mode of this extension . |
Since 3.7
gboolean visu_gl_ext_getSensitiveToRenderingMode
(VisuGlExt *extension
);
Each VisuGlExt method can follow or not the global setting for
the rendering mode, see VisuGlRenderingMode. See also
visu_gl_ext_setSensitiveToRenderingMode()
.
|
a VisuGlExt object. |
Returns : |
TRUE if extension can change its rendering mode according
to global settings. |
Since 3.7
void visu_gl_ext_rebuild (VisuGlExt *self
);
This routine does not sort the extension on their priority and
should be used only to draw some selected extensions. To draw all
of them, use visu_gl_ext_rebuildAll()
instead.
|
a VisuGlExt object. |
void visu_gl_ext_rebuildAll (void
);
For each registered extension that has a valid rebuild method, it calls it.
gboolean visu_gl_ext_setActive (VisuGlExt *extension
,gboolean value
);
Set if an extension is actually used or not.
|
the extension, |
|
the new value. |
gboolean visu_gl_ext_setPreferedRenderingMode (VisuGlExt *extension
,VisuGlRenderingMode value
);
This method is used to specify the rendering mode that the extension should use
to be drawn (if the sensitive flag has been set, see
visu_gl_ext_setSensitiveToRenderingMode()
). If the value
is set
to VISU_GL_RENDERING_FOLLOW, the extension follows the global setting
for rendering mode.
|
a VisuGlExt object ; |
|
see VisuGlRenderingMode to choose one. |
Returns : |
TRUE if the "OpenGLAskForReDraw" should be emitted. |
void visu_gl_ext_setPriority (VisuGlExt *extension
,guint priority
);
Extentions are drawn in an order that depends on their priority. The lower is the number, the sooner the extension is drawn. Flags, such as VISU_GL_EXT_PRIORITY_NORMAL or VISU_GL_EXT_PRIORITY_LOW, can be used or user defined values are also possible.
|
a VisuGlExt object ; |
|
an integer value. |
void visu_gl_ext_setSaveState (VisuGlExt *extension
,gboolean saveState
);
If the extension needs to change some OpenGL state (to disable the fog for example, or the cullface), a flag should be set to enable V_Sim to restore the right values after the extensio have been called. Because the OpenGL list of an extension is just GL_COMPILE the extension can't just save and restore state itself because when the list is called, the state can have been changed.
|
a VisuGlExt object ; |
|
an boolean value. |
void visu_gl_ext_setSensitiveToRenderingMode (VisuGlExt *extension
,gboolean status
);
If status
is TRUE, when the extension is rendered, OpenGL context is
switched to the rendering mode preferd for the extension. Use
visu_gl_ext_setPreferedRenderingMode()
to choose one.
|
a VisuGlExt object ; |
|
an boolean value. |
"active"
property"active" gboolean : Read / Write
extension is used or not.
Default value: FALSE
"description"
property"description" gchar* : Read / Write
description of extension.
Default value: ""
"label"
property"label" gchar* : Read / Write / Construct
label (translated) of extension.
Default value: ""
"nGlObj"
property"nGlObj" guint : Read / Write / Construct Only
number of GL lists dealt with.
Allowed values: [1,2048]
Default value: 1
"name"
property"name" gchar* : Read / Write / Construct Only
name (id) of extension.
Default value: ""
"priority"
property"priority" guint : Read / Write
drawing priority of extension.
Allowed values: <= 100
Default value: 50
"saveState"
property"saveState" gboolean : Read / Write
save OpenGL state.
Default value: FALSE