Top | ![]() |
![]() |
![]() |
![]() |
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_NODES |
#define | VISU_GL_EXT_PRIORITY_NODE_DECORATIONS |
#define | VISU_GL_EXT_PRIORITY_HIGH |
#define | VISU_GL_EXT_PRIORITY_NORMAL |
#define | VISU_GL_EXT_PRIORITY_LOW |
#define | VISU_GL_EXT_PRIORITY_LAST |
struct | VisuGlExt |
struct | VisuGlExtClass |
GObject ╰── ToolDbgObj ╰── VisuGlExt ├── VisuGlExtAxes ├── VisuGlExtBg ├── VisuGlExtBox ├── VisuGlExtFrame ├── VisuGlExtNodeVectors ├── VisuGlExtInfos ├── VisuGlExtMaps ├── VisuGlExtMarks ├── VisuGlExtNodes ├── VisuGlExtPairs ├── VisuGlExtPaths ├── VisuGlExtPlanes ├── VisuGlExtScale ╰── VisuGlExtSurfaces
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.
gboolean visu_gl_ext_setDirty (VisuGlExt *ext
,gboolean status
);
Set an internal flag to mark that ext
should be redrawn before
next OpenGL frame view.
Since: 3.8
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.
guint
visu_gl_ext_getPriority (VisuGlExt *extension
);
Inquire the priority of extension
.
Since: 3.8
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.
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.
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()
.
Since: 3.7
gboolean
visu_gl_ext_getActive (VisuGlExt *extension
);
Get if the extension is used or not. If not its ObjectList is not rendered.
gboolean visu_gl_ext_setActive (VisuGlExt *extension
,gboolean value
);
Set if an extension is actually used or not.
VisuGl *
visu_gl_ext_getGlContext (VisuGlExt *extension
);
The VisuGl object this extension draws to.
Since: 3.8
gboolean visu_gl_ext_setGlContext (VisuGlExt *extension
,VisuGl *gl
);
Associate gl
to extension
.
Since: 3.8
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.
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()
.
Since: 3.7
gboolean visu_gl_ext_setTranslation (VisuGlExt *extension
,const gfloat trans[3]
);
Change the translation the extension is drawn at.
extension |
a VisuGlExt method. |
|
trans |
a translation vector in real space. |
[array fixed-size=3] |
Since: 3.8
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.
Since: 3.7
const gchar *
visu_gl_ext_getLabel (const VisuGlExt *extension
);
Retrieve the name of the extension.
Since: 3.8
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.
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_set_rebuild()
instead.
gboolean visu_gl_ext_setGlView (VisuGlExt *ext
,VisuGlView *view
);
Attach a view
to the self
extension.
Since: 3.8
#define VISU_GL_EXT_PRIORITY_BACKGROUND 0
An extension with this priority is drawn first.
#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_HIGH 20
An extension with this priority is drawn after the higher priorities.
#define VISU_GL_EXT_PRIORITY_NORMAL 50
An extension with this priority is drawn after the higher priorities.
#define VISU_GL_EXT_PRIORITY_LOW 80
An extension with this priority is drawn among last extensions.
#define VISU_GL_EXT_PRIORITY_LAST 100
An extension with this priority is drawn last.
struct VisuGlExtClass { VisuObjectClass parent; gboolean (*setGlView)(VisuGlExt *ext, VisuGlView *view); void (*rebuild)(VisuGlExt *self); void (*draw)(VisuGlExt *self); GList *allExtensions; };
Common name to refer to a _VisuGlExtClass.
private. |
||
a method to attach a VisuGlView object to this extension. |
||
a rebuilding function for this extension. |
||
a draw method for this extension. |
||
GList * |
the list of all stored VisuGlExt objects. |
“active”
property“active” gboolean
extension is used or not.
Flags: Read / Write
Default value: FALSE
“description”
property“description” gchar *
description of extension.
Flags: Read / Write
Default value: ""
“dirty”
property“dirty” gboolean
object rendering is out of date.
Flags: Read / Write
Default value: FALSE
“label”
property“label” gchar *
label (translated) of extension.
Flags: Read / Write / Construct
Default value: ""
“nGlObj”
property“nGlObj” guint
number of GL lists dealt with.
Flags: Read / Write / Construct Only
Allowed values: [1,2048]
Default value: 1
“name”
property“name” gchar *
name (id) of extension.
Flags: Read / Write / Construct Only
Default value: ""
“priority”
property“priority” guint
drawing priority of extension.
Flags: Read / Write
Allowed values: <= 100
Default value: 50
“saveState”
property“saveState” gboolean
save OpenGL state.
Flags: Read / Write
Default value: FALSE