Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Menge::SceneGraph::Selectable Class Reference

The class interface for selectable objects – objects which can be selectedc in the OpenGL context by clicking on them. More...

#include <Select.h>

Inheritance diagram for Menge::SceneGraph::Selectable:
Menge::SceneGraph::Shape Menge::VisAgent Menge::SceneGraph::Circle Menge::SceneGraph::Cylinder

Public Member Functions

 Selectable ()
 Constructor.
 
void loadSelectName () const
 Performs the OpenGL task to make this object selectable.
 
unsigned int getID () const
 Returns this object's globally unique selection id. More...
 
virtual void dummy ()
 A dummy function that makes Selectable polymorphic. It enables the use of dynamic_cast. Otherwise, it is a no-op.
 

Static Public Member Functions

static SelectablegetSelectedObject ()
 Retrives a pointer to the currently selected node. More...
 
static unsigned int getSelectedName ()
 Returns the "name" of the currently selected object. More...
 
static void clearSelectedObject ()
 Clears the current selection.
 
static void setSelectedObject (Selectable *obj)
 Forces an arbitrary selectable to be selected. More...
 
static void selectStart ()
 The selection set up. More...
 
static bool selectEnd ()
 The selection take down. More...
 
static unsigned int nextSelectName ()
 Reports the next available selection name.
 

Protected Attributes

unsigned int _id
 Globally unique OpenGL name for selection.
 
bool _selected
 Reports if this node is selcted. More...
 

Detailed Description

The class interface for selectable objects – objects which can be selectedc in the OpenGL context by clicking on them.

Member Function Documentation

unsigned int Menge::SceneGraph::Selectable::getID ( ) const
inline

Returns this object's globally unique selection id.

Returns
The selection id - a positive value.
static unsigned int Menge::SceneGraph::Selectable::getSelectedName ( )
inlinestatic

Returns the "name" of the currently selected object.

In this case, "name" refers to the OpenGL identifier. It corresponds to a selectable object's id (see Selectable::getID).

Returns
The OpenGL name (selectable id) of the currently selected object. If no object is selected, it returns zero.
static Selectable* Menge::SceneGraph::Selectable::getSelectedObject ( )
inlinestatic

Retrives a pointer to the currently selected node.

Returns
A pointer to the selected object – NULL if no object is selected.
bool Menge::SceneGraph::Selectable::selectEnd ( )
static

The selection take down.

When performing selection, after calling Selectable::selectStart and drawing the scene, this must be called to conclude the selection process.

Returns
A boolean reporting if the selection changed (true) or not (false).
void Menge::SceneGraph::Selectable::selectStart ( )
static

The selection set up.

To perform selection, this needs to be called prior to drawing the scene of selectable objects.

static void Menge::SceneGraph::Selectable::setSelectedObject ( Selectable obj)
inlinestatic

Forces an arbitrary selectable to be selected.

Parameters
objA selectable object to set as selected.

Member Data Documentation

bool Menge::SceneGraph::Selectable::_selected
protected

Reports if this node is selcted.

This can be used by contexts or objects that change how they are drawn based on selection state.


The documentation for this class was generated from the following files: