version 3.3

VRS::AreaSelector Class Reference

The AreaSelector allows for specifying an axis-aligned rectangle on the terrain. More...

#include <vrs/sg/areaselector.h>

Inheritance diagram for VRS::AreaSelector:

VRS::InteractionTechnique VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 VRS_TYPEINFO (AreaSelector, InteractionTechnique)
 AreaSelector (double minY, double maxY, const Color &color=Color(1.0, 0.0, 0.0, 0.3), SO< Filter > rayRequestFilter=0, RayRequestTechnique::RQMode=RayRequestTechnique::All)
 The AreaSelector needs minimum and maximum height values to display the selection box.
void setHeights (double minY, double maxY)
 The displayed box can be reconfigured at arbitrary time.
double getMinHeight () const
double getMaxHeight () const
virtual void onDragStart (int x, int y, SO< ButtonEvent >, MouseButtonFunctionID id)
 See navigationtechnique.h.
virtual void onDragMotion (int x, int y, SO< MotionEvent >, MouseButtonFunctionID id, int startX, int startY)
virtual void onDragEnd (int x, int y, SO< ButtonEvent >, MouseButtonFunctionID id, int startX, int startY)
virtual void onEventPassive (SO< Event > e, bool modeActive)
 Running selection operations are terminated with button-release, even if the Navigation is not active anymore.
SO< SceneThinggetSelectionScene () const
 Returns a scene containing a shape indicating the current selection.
void registerDragStartCallback (SO< Callback2< SO< ButtonEvent >, Vector > > callback)
 Callbacks that are handled after the default processing of an event For startCallbacks, the dragStart-Pos is passed, for motion/endCallbacks the current SelectionBounds.
void registerDragMotionCallback (SO< Callback2< SO< MotionEvent >, Bounds > > callback)
void registerDragEndCallback (SO< Callback2< SO< ButtonEvent >, Bounds > > callback)
void unregisterDragStartCallback (SO< Callback2< SO< ButtonEvent >, Vector > > callback)
void unregisterDragMotionCallback (SO< Callback2< SO< MotionEvent >, Bounds > > callback)
void unregisterDragEndCallback (SO< Callback2< SO< ButtonEvent >, Bounds > > callback)
bool keepSelectionSceneEnabled () const
 Per default, the selection scene is cleared after drag-end, so that the selection box vanishes immediately.
void setKeepSelectionSceneEnabled (bool yesNo=false)
void setCurrentSelection (const VRS::Bounds &bounds)
 Sets current selection.
SO< FiltergetRayRequestFilter () const
void setRayRequestFilter (SO< Filter > val)

Static Public Attributes

static const MouseButtonFunctionID SelectionButton

Protected Member Functions

SO< SceneThingcreateSelectionScene (const Bounds &bounds)
 Creates a scene containing a given bounding box as semi-transparent outlined box shape.
void finishSelection (SO< ButtonEvent > be)
 clears the selection scene and calls the registered end-callbacks.

Protected Attributes

bool m_dragging
SO< Filterm_rayRequestFilter
RayRequestTechnique::RQMode m_rayRequestMode
SO< SceneThingm_selectionScene
double m_minY
double m_maxY
Color m_color
Bounds m_selectionBounds
SO< Canvasm_canvas
Vector m_dragStart
bool m_keepSelectionSceneEnabled
SO< Array< SO< Callback2< SO
< ButtonEvent >, Vector > > > > 
m_startCallbacks
SO< Array< SO< Callback2< SO
< MotionEvent >, Bounds > > > > 
m_motionCallbacks
SO< Array< SO< Callback2< SO
< ButtonEvent >, Bounds > > > > 
m_endCallbacks


Detailed Description

The AreaSelector allows for specifying an axis-aligned rectangle on the terrain.

The area is displayed as a semi-transparent bounding box. The y-values of this box must be specified from outside. To handle a selection, a callback can be registered. Note: This technique assumes xz to be the 'horizontal plane'.


Constructor & Destructor Documentation

VRS::AreaSelector::AreaSelector ( double  minY,
double  maxY,
const Color color = Color(1.0, 0.0, 0.0, 0.3),
SO< Filter rayRequestFilter = 0,
RayRequestTechnique::RQMode  = RayRequestTechnique::All 
)

The AreaSelector needs minimum and maximum height values to display the selection box.


Member Function Documentation

VRS::AreaSelector::VRS_TYPEINFO ( AreaSelector  ,
InteractionTechnique   
)

void VRS::AreaSelector::setHeights ( double  minY,
double  maxY 
)

The displayed box can be reconfigured at arbitrary time.

The values are considered at the first event after the change.

double VRS::AreaSelector::getMinHeight (  )  const

double VRS::AreaSelector::getMaxHeight (  )  const

virtual void VRS::AreaSelector::onDragStart ( int  x,
int  y,
SO< ButtonEvent ,
MouseButtonFunctionID  id 
) [virtual]

See navigationtechnique.h.

virtual void VRS::AreaSelector::onDragMotion ( int  x,
int  y,
SO< MotionEvent ,
MouseButtonFunctionID  id,
int  startX,
int  startY 
) [virtual]

virtual void VRS::AreaSelector::onDragEnd ( int  x,
int  y,
SO< ButtonEvent ,
MouseButtonFunctionID  id,
int  startX,
int  startY 
) [virtual]

virtual void VRS::AreaSelector::onEventPassive ( SO< Event e,
bool  modeActive 
) [virtual]

Running selection operations are terminated with button-release, even if the Navigation is not active anymore.

Reimplemented from VRS::InteractionTechnique.

SO<SceneThing> VRS::AreaSelector::getSelectionScene (  )  const

Returns a scene containing a shape indicating the current selection.

It is only visible during dragging. The returned pointer is always equal during the lifetime of the AreaSelector.

void VRS::AreaSelector::registerDragStartCallback ( SO< Callback2< SO< ButtonEvent >, Vector > >  callback  ) 

Callbacks that are handled after the default processing of an event For startCallbacks, the dragStart-Pos is passed, for motion/endCallbacks the current SelectionBounds.

void VRS::AreaSelector::registerDragMotionCallback ( SO< Callback2< SO< MotionEvent >, Bounds > >  callback  ) 

void VRS::AreaSelector::registerDragEndCallback ( SO< Callback2< SO< ButtonEvent >, Bounds > >  callback  ) 

void VRS::AreaSelector::unregisterDragStartCallback ( SO< Callback2< SO< ButtonEvent >, Vector > >  callback  ) 

void VRS::AreaSelector::unregisterDragMotionCallback ( SO< Callback2< SO< MotionEvent >, Bounds > >  callback  ) 

void VRS::AreaSelector::unregisterDragEndCallback ( SO< Callback2< SO< ButtonEvent >, Bounds > >  callback  ) 

bool VRS::AreaSelector::keepSelectionSceneEnabled (  )  const

Per default, the selection scene is cleared after drag-end, so that the selection box vanishes immediately.

If this flag is set, the box is kept visible until it is cleared externally or a new drag-interactions starts.

void VRS::AreaSelector::setKeepSelectionSceneEnabled ( bool  yesNo = false  ) 

void VRS::AreaSelector::setCurrentSelection ( const VRS::Bounds bounds  ) 

Sets current selection.

SO<Filter> VRS::AreaSelector::getRayRequestFilter (  )  const [inline]

void VRS::AreaSelector::setRayRequestFilter ( SO< Filter val  )  [inline]

SO<SceneThing> VRS::AreaSelector::createSelectionScene ( const Bounds bounds  )  [protected]

Creates a scene containing a given bounding box as semi-transparent outlined box shape.

void VRS::AreaSelector::finishSelection ( SO< ButtonEvent be  )  [protected]

clears the selection scene and calls the registered end-callbacks.

be is passed to the callbacks.


Member Data Documentation

double VRS::AreaSelector::m_minY [protected]

double VRS::AreaSelector::m_maxY [protected]


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

Generated on Fri May 18 06:00:26 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact