![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
visu_pickMesurevisu_pickMesure — Some methods to treat a VisuPick informations. |
enum PickMesureType; PickMesure; void initPick_module (); gchar* pickMesureGet_errors (PickMesure *mesureData); gchar* pickMesureGet_infos (PickMesure *mesureData); VisuNode* pickMesureGet_firstReference (PickMesure *mesureData); gboolean pickMesureGet_newsAvailable (PickMesure *mesureData, PickMesureType *type); VisuNode* pickMesureGet_selectedNode (PickMesure *mesureData); float* pickMesureGet_drag (PickMesure *mesureData); int pickMesureGet_regionNNodes (PickMesure *mesureData); GList* pickMesureGet_regionNodes (PickMesure *mesureData); void pickMesureSet_formatedOutput (PickMesure *mesureData, gboolean formatedOutput); gboolean pickMesureSet_highlight (PickMesure *mesureData, guint idNode, gboolean status); void pickMesureSet_dragMove (PickMesure *mesureData, float dx, float dy, float dz); void pickMesureSet_dragStart (PickMesure *mesureData, guint nodeId); void pickMesureSet_dragStop (PickMesure *mesureData); void pickMesureSet_pickNode (PickMesure *mesureData, gint nodeId, PickMesureType type); void pickMesureSet_pickRegion (PickMesure *mesureData, GList *nodeIds); gboolean pickMesureRemove_allMarks (PickMesure *mesureData); gboolean pickMesureRemove_allHighlights (PickMesure *mesureData); void pickMesureUpdate (VisuData *newData, VisuData *oldData); gboolean pickMesureExport_XMLFile (const gchar *filename, VisuData *data, int *nodes, DrawItem drawingMode, guint drawingInfos, GError **error); PickMesure* pickMesureParse_XMLFile (const gchar *filename, VisuData *data, GList **infos, DrawItem *drawingMode, guint *drawingInfos, GError **error);
The pick mesures work on static variables, thus only one pick
session is possible at a time. Each time a node is selected,
marksAndMesures()
should be called. To retrieve then the results of
the measurements, getPickMesureInfos()
and getPickMesureErrors()
are available.
typedef enum { PICK_SELECTED, PICK_HIGHLIGHT, PICK_UNHIGHLIGHT, PICK_REFERENCE_1, PICK_REFERENCE_2, PICK_INFORMATION, PICK_REGION, PICK_DRAG_START, PICK_DRAG_MOVE, PICK_DRAG_STOP } PickMesureType;
These values are used with pickMesureSet_pickNode()
to specify that
the selected node is a simple one or a reference.
a node has been selected with simple clic ; | |
a node has been highlighted ; | |
a node has been unhighlighted ; | |
a node has been selected has a first reference ; | |
a node has been selected has a second reference ; | |
a list of nodes as been selected ; | |
the selected node has been picked for a drag ; | |
the selected node is moving ; | |
the selected node has just been released from a drag. |
gchar* pickMesureGet_errors (PickMesure *mesureData);
When a pick session is running with the format flag (see
pickMesureSet_formatedOutput()
for deatils), calls to
pickMesureSet_selection()
creates strings that represent the values of the mesure.
If error occurs, they are retrievable with this method.
|
a PickMesure structure that contains the informations about picked nodes. |
Returns : |
a string (own by V_Sim, should not be freed). |
gchar* pickMesureGet_infos (PickMesure *mesureData);
When a pick session is running with the format flag (see
pickMesureSet_formatedOutput()
for deatils), calls to
pickMesureSet_selection()
creates strings that represent the values of the mesure.
These values are retrievable with this method.
|
a PickMesure structure that contains the informations about picked nodes. |
Returns : |
a string (own by V_Sim, should not be freed). |
VisuNode* pickMesureGet_firstReference (PickMesure *mesureData);
The first reference is a store node.
|
a PickMesure structure that contains the informations about picked nodes. |
Returns : |
the node that has been picked as first reference, or NULL if none. |
gboolean pickMesureGet_newsAvailable (PickMesure *mesureData, PickMesureType *type);
When a pick is done, maybe nothing interesting happen, get informed with this method.
|
a PickMesure structure that contains the informations about picked nodes. |
|
if not NULL, contains on output the kind of news available. |
Returns : |
TRUE if values stored in the given mesureData have changed.
|
VisuNode* pickMesureGet_selectedNode (PickMesure *mesureData);
The selected node is a node selected by a normal pick, i.e. neither a first nor a second reference.
|
a PickMesure structure that contains the informations about picked nodes. |
Returns : |
the last selected node, or NULL if none. |
float* pickMesureGet_drag (PickMesure *mesureData);
Retrieve the translation vector in a drag session.
|
a PickMesure structure. |
Returns : |
a three float vector owned by V_Sim. |
int pickMesureGet_regionNNodes (PickMesure *mesureData);
Return only the number of selected nodes in a region, without
actually creating the list. See pickMesureGet_regionNodes()
to get
this list.
|
a PickMesure structure that contains the informations about picked nodes. |
Returns : |
the number of selected nodes in a region. |
GList* pickMesureGet_regionNodes (PickMesure *mesureData);
Create a list of VisuNode from a selected region. There should be
a selected region, see pickMesureGet_newsAvailable()
.
|
a PickMesure structure that contains the informations about picked nodes. |
Returns : |
a newly created list of selected nodes. Should be freed
with g_list_free() after use.
|
void pickMesureSet_formatedOutput (PickMesure *mesureData, gboolean formatedOutput);
If this flag is TRUE, one can retrieve some formatted output using the getPickMesureInfos()
and getPickMesureErrors()
methods.
|
a PickMesure structure that contains the informations about picked nodes ; |
|
a boolean. |
gboolean pickMesureSet_highlight (PickMesure *mesureData, guint idNode, gboolean status);
Put an highlight (or remove it) on a given node. The OpenGL area
should be redraw after the call. After a call to this routine, the
calling one should call pickMesureRebuild_classicalList()
.
|
a PickMesure structure ; |
|
the node to highlight ; |
|
switch on or off the highlight. |
Returns : |
TRUE if the status of highlighting for the given node has changed. |
void pickMesureSet_dragMove (PickMesure *mesureData, float dx, float dy, float dz);
Update the information of measurement when drag is done with the given translation vector.
|
a PickMesure structure ; |
|
a variation in cartesian coordinates ; |
|
a variation in cartesian coordinates ; |
|
a variation in cartesian coordinates. |
void pickMesureSet_dragStart (PickMesure *mesureData, guint nodeId);
Update the information of measurement when drag is begun on node nodeId
.
|
a PickMesure structure ; |
|
a node id. |
void pickMesureSet_dragStop (PickMesure *mesureData);
Update the information of measurement when drag is stopped.
|
a PickMesure structure. |
void pickMesureSet_pickNode (PickMesure *mesureData, gint nodeId, PickMesureType type);
Update the information of measurement when the nodeId
is
selected. See PickMesureType for further information on the
different kind of possible selection. For this method, only
PICK_SELECTED, PICK_REFERENCE_1 and PICK_REFERENCE_2 are
possible. See pickMesureGet_newsAvailable()
to catch possible
changes in a callback.
Strings are created to represent
the return of the mesure (if this has been activated using
pickMesureSet_formatedOutput()
). These strings are available with a
call to pickMesureGet_infos()
and pickMesureGet_errors()
.
|
a PickMesure structure ; |
|
a node id (or -1 to unselect current one) ; |
|
a value in PickMesureType. |
void pickMesureSet_pickRegion (PickMesure *mesureData, GList *nodeIds);
Update the information of measurement when a region containing
nodeIds
is selected. See pickMesureGet_newsAvailable()
to catch possible
changes in a callback.
|
a PickMesure structure ; |
|
a list of node ids. |
gboolean pickMesureRemove_allMarks (PickMesure *mesureData);
Erase all marks corresponding to given object.
|
a PickMesure structure that contains the informations about Nodes with marks that need to be erased. |
Returns : |
TRUE if the "OpenGLAskForReDraw" signal show be emitted. |
gboolean pickMesureRemove_allHighlights (PickMesure *mesureData);
It empties the list of all highlights.
|
a PickMesure structure. |
Returns : |
TRUE if the redraw signal should be emitted. |
void pickMesureUpdate (VisuData *newData, VisuData *oldData);
This method try to retrieve a PickMesure object associated to each given VisuData object and to update the marks and distances on the new from the values of the old.
gboolean pickMesureExport_XMLFile (const gchar *filename, VisuData *data, int *nodes, DrawItem drawingMode, guint drawingInfos, GError **error);
PickMesure* pickMesureParse_XMLFile (const gchar *filename, VisuData *data, GList **infos, DrawItem *drawingMode, guint *drawingInfos, GError **error);