Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::SelectedEntity Struct Reference

#include <GlScene.h>

Public Types

enum  SelectedEntityType { UNKNOW_SELECTED = 0, NODE_SELECTED = 1, EDGE_SELECTED = 2, SIMPLE_ENTITY_SELECTED = 3 }
 

Public Member Functions

 SelectedEntity (GlSimpleEntity *entity)
 
 SelectedEntity (Graph *graph, unsigned int id, SelectedEntityType type)
 
GraphgetComplexEntityGraph () const
 
unsigned int getComplexEntityId () const
 
edge getEdge () const
 
SelectedEntityType getEntityType () const
 
node getNode () const
 
GlSimpleEntitygetSimpleEntity () const
 

Protected Attributes

GraphcomplexEntityGraph
 
unsigned int complexEntityId
 
SelectedEntityType entityType
 
GlSimpleEntitysimpleEntity
 

Detailed Description

Structure to store selected entities.

After a selection, objects of SelectedEntity is returned To use this object the first thing to do is to call getEntity type to know the type of Entity After that you can :

  • Get the GlSimpleEnity pointer (getSimpleEntity())
  • Get the id of node/edge and the graph associated (getComplexEntityId() and getComplexEntityGraph())
Examples:
interactor_plugin/interactor_plugin.cpp.

Definition at line 47 of file GlScene.h.

Member Function Documentation

edge tlp::SelectedEntity::getEdge ( ) const
inline

getEdge is a convenience method to perform the check on the selected element type and return the corresponding edge object. It's equivalent to

if(getComplexEntityType()==EDGE_SELECTED){
return edge(getComplexEntityId())
}
Returns
the selected edge if the entity type is correct or an invalid edge else.

Definition at line 105 of file GlScene.h.

node tlp::SelectedEntity::getNode ( ) const
inline

getNode is a convenience method to perform the check on the selected element type and return the corresponding node object. It's equivalent to

if(getComplexEntityType()==NODE_SELECTED){
return node(getComplexEntityId())
}
Returns
the selected node if the entity type is correct or an invalid node else.

Definition at line 87 of file GlScene.h.