![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define VISU_GL_EXT_PAIRS_ID struct VisuGlExtPairs; struct VisuGlExtPairsClass; struct VisuPairDrawFuncs; VisuPairExtension; void visu_gl_ext_pairs_draw (VisuGlExtPairs *pairs
); VisuGlExtPairs * visu_gl_ext_pairs_getDefault (); VisuPairExtension * visu_gl_ext_pairs_getDrawMethod (VisuGlExtPairs *pairs
,VisuPairLink *data
); gboolean visu_gl_ext_pairs_getDrawnPair (VisuGlExtPairs *pairs
,VisuPairLink *data
,guint *node1
,guint *node2
,guint id
); guint visu_gl_ext_pairs_getNDrawn (VisuGlExtPairs *pairs
,VisuPairLink *data
); VisuGlExtPairs * visu_gl_ext_pairs_new (const gchar *name
); gboolean visu_gl_ext_pairs_setData (VisuGlExtPairs *pairs
,VisuGlView *view
,VisuData *data
); gboolean visu_gl_ext_pairs_setDrawMethod (VisuGlExtPairs *pairs
,VisuPairLink *data
,VisuPairExtension *ext
); void visu_pair_extension_free (VisuPairExtension *extension
); GList * visu_pair_extension_getAllMethods (); VisuPairExtension * visu_pair_extension_getByName (const gchar *name
); VisuPairExtension * visu_pair_extension_getDefault (); const gchar * visu_pair_extension_getName (VisuPairExtension *extension
,gboolean UTF8
); VisuPairExtension * visu_pair_extension_new (const char *name
,const char *printName
,const char *description
,gboolean sensitive
,const VisuPairDrawFuncs *meth
); VisuPairExtension * visu_pair_extension_ref (VisuPairExtension *ext
); gboolean visu_pair_extension_setDefault (VisuPairExtension *extension
); void visu_pair_extension_unref (VisuPairExtension *ext
);
This extension draws links between nodes, depending on VisuPairExtension drawing capabilities.
#define VISU_GL_EXT_PAIRS_ID "Pairs"
The id used to identify this extension, see
visu_gl_ext_rebuild()
for instance.
struct VisuGlExtPairsClass { VisuGlExtClass parent; };
A short way to identify _VisuGlExtPairsClass structure.
VisuGlExtClass |
the parent class; |
Since 3.7
struct VisuPairDrawFuncs { /** * start: * @ele1: a #VisuElement object ; * @ele2: a #VisuElement object ; * @data: a #VisuPairLink object. * @view: a #VisuGlView object, giving some constants describing * the OpenGL scene ; * * Prototype of functions called at the beginning and * the end of drawing of each pairs types. @ele1 and @ele2 * arguments are the two elements between the pair defined by @data is drawn. * This is useful to set some OpenGL definition specific to each pair, such * as the color for example. */ void (*start)(VisuElement *ele1, VisuElement *ele2, VisuPairLink *data, VisuGlView *view); /** * stop: * @ele1: a #VisuElement object ; * @ele2: a #VisuElement object ; * @data: a #VisuPairLink object. * @view: a #VisuGlView object, giving some constants describing * the OpenGL scene ; * * Prototype of functions called at the beginning and * the end of drawing of each pairs types. @ele1 and @ele2 * arguments are the two elements between the pair defined by @data is drawn. * This is useful to set some OpenGL definition specific to each pair, such * as the color for example. */ void (*stop)(VisuElement *ele1, VisuElement *ele2, VisuPairLink *data, VisuGlView *view); /** * main: * @ele1: a #VisuElement object ; * @ele2: a #VisuElement object ; * @data: a #VisuPairLink object ; * @view: a #VisuGlView object, giving some constants describing * the OpenGL scene ; * @x1: a floating point value ; * @y1: a floating point value ; * @z1: a floating point value ; * @x2: a floating point value ; * @y2: a floating point value ; * @z2: a floating point value ; * @d2: a floating point value ; * @alpha: a floating point value. * * Prototype of function to draw a pair. Such function are called each time a pair * is drawn between the two points (@x1, @y1, @z1) and (@x2, @y2, @z2). The @d2 argument * is the square distance between the two points. The @alpha argument * is a proposed alpha colour from the main program, its value is in [0;1]. */ void (*main)(VisuElement *ele1, VisuElement *ele2, VisuPairLink *data, VisuGlView *view, double x1, double y1, double z1, double x2, double y2, double z2, float d2, float alpha); };
Drawing method for a VisuPairLink.
a method called before drawing a family of VisuPairLink. | |
a method called after drawing a family of VisuPairLink. | |
a method used to draw each link of a VisuPairLink. |
void visu_gl_ext_pairs_draw (VisuGlExtPairs *pairs
);
Draw the pairs
, see visu_gl_ext_pairs_setData()
to attach
a VisuData object to pairs
.
|
a VisuGlExtPairs object. |
Since 3.7
VisuGlExtPairs * visu_gl_ext_pairs_getDefault ();
V_Sim is using a default pair object.
Returns : |
a VisuGlExtPairs object used by default. [transfer none] |
Since 3.7
VisuPairExtension * visu_gl_ext_pairs_getDrawMethod (VisuGlExtPairs *pairs
,VisuPairLink *data
);
Get the drawing method of a pair.
|
the rendering VisuGlExtPairs object. |
|
a VisuPairLink object. |
Returns : |
a drawing method. |
Since 3.6
gboolean visu_gl_ext_pairs_getDrawnPair (VisuGlExtPairs *pairs
,VisuPairLink *data
,guint *node1
,guint *node2
,guint id
);
After pairs have been drawn, the ids of nodes in between links have
been done can be retrieved with this routine. id
range in between
0 and the value returned by visu_gl_ext_pairs_getNDrawn()
.
|
the rendering VisuGlExtPairs object. |
|
a VisuPairLink object ; |
|
a location to store a node id ;. [out] |
|
a location to store a node id ;. [out] |
|
an index value. |
Returns : |
TRUE if id is a valid number. |
Since 3.7
guint visu_gl_ext_pairs_getNDrawn (VisuGlExtPairs *pairs
,VisuPairLink *data
);
This returns the number of pairs with characteristics of data
,
that have been drawn.
|
the rendering VisuGlExtPairs object. |
|
a VisuPairLink object. |
Returns : |
the number of drawn pairs. |
Since 3.7
VisuGlExtPairs * visu_gl_ext_pairs_new (const gchar *name
);
Creates a new VisuGlExt to draw a pairs.
|
the name to give to the extension (default is VISU_GL_EXT_PAIRS_ID). [allow-none] |
Returns : |
a pointer to the VisuGlExt it created or NULL otherwise. |
Since 3.7
gboolean visu_gl_ext_pairs_setData (VisuGlExtPairs *pairs
,VisuGlView *view
,VisuData *data
);
Attach an VisuGlView to render to and setup the pairs to get the node population also.
|
The VisuGlExtPairs to attached to. |
|
the view where to draw the pairs. |
|
the nodes to get the population of. |
Returns : |
TRUE if visu_gl_ext_pairs_draw() should be called and
then 'OpenGLAskForReDraw' signal be emitted. |
Since 3.7
gboolean visu_gl_ext_pairs_setDrawMethod (VisuGlExtPairs *pairs
,VisuPairLink *data
,VisuPairExtension *ext
);
Set the drawing method of a pair.
|
the rendering VisuGlExtPairs object. |
|
a VisuPairLink object. |
|
a VisuPairExtension object. |
Returns : |
TRUE if drawing method is changed. |
Since 3.6
void visu_pair_extension_free (VisuPairExtension *extension
);
Free all the allocated attributes of the specified method.
|
the extension to delete. |
GList * visu_pair_extension_getAllMethods ();
Useful to know all VisuPairExtension.
Returns : |
a list of all the known VisuPairExtension. This list should be considered read-only. [element-type VisuPairExtension*][transfer none] |
VisuPairExtension * visu_pair_extension_getByName (const gchar *name
);
Useful to know a VisuPairExtension when knowing its name.
|
a method name (untranslated). |
Returns : |
a VisuPairExtension, or NULL if not any matchs. |
Since 3.6
VisuPairExtension * visu_pair_extension_getDefault ();
If some process need to know the current VisuPairExtension. Such extension has
been set with setPairsMethod()
.
Returns : |
the current VisuPairExtension, NULL if none has been set. |
const gchar * visu_pair_extension_getName (VisuPairExtension *extension
,gboolean UTF8
);
A VisuPairExtension has an internal name and a translated name for UI.
|
a VisuPairExtension object ; |
|
if name is provided for UI or not. |
Returns : |
a private label identifying this extension . |
Since 3.7
VisuPairExtension * visu_pair_extension_new (const char *name
,const char *printName
,const char *description
,gboolean sensitive
,const VisuPairDrawFuncs *meth
);
This creates a new pairs extension. Such an extension describes how to draw
links (called pairs) between elements. The sensitive
argument is to inform if
pairs must be redrawn when the OpenGL engine sends the OpenGLFacetteChanged signal.
|
name of the extension (must be non null) ; |
|
a string to label the method that can be safely translated ; |
|
a brief description of the extension (can be null) ; |
|
a boolean 0 or 1 ; |
|
a set of drawing methods. |
Returns : |
the new VisuPairExtension or null if something wrong happens. |
VisuPairExtension * visu_pair_extension_ref (VisuPairExtension *ext
);
Increase the ref counter.
|
a VisuPairExtension object. |
Returns : |
itself. |
Since 3.7
gboolean visu_pair_extension_setDefault (VisuPairExtension *extension
);
Choose the method used to draw pairs.
|
a VisuPairExtension object. |
Returns : |
TRUE if pairs should be rebuilt. |
void visu_pair_extension_unref (VisuPairExtension *ext
);
Decrease the ref counter, free all memory if counter reachs zero.
|
a VisuPairExtension object. |
Since 3.7