rviz::SelectionManager Class Reference

#include <selection_manager.h>

List of all members.

Classes

struct  Highlight

Public Types

enum  SelectType { Add, Remove, Replace }

Public Member Functions

void addObject (CollObjectHandle obj, const SelectionHandlerPtr &handler)
Ogre::Technique * addPickTechnique (CollObjectHandle handle, const Ogre::MaterialPtr &material)
void addSelection (const M_Picked &objs)
void clearHandlers ()
CollObjectHandle createCollisionForEntity (Ogre::Entity *entity, const SelectionHandlerPtr &handler, CollObjectHandle coll=0)
CollObjectHandle createCollisionForObject (Object *obj, const SelectionHandlerPtr &handler, CollObjectHandle coll=0)
CollObjectHandle createHandle ()
void enableInteraction (bool enable)
void focusOnSelection ()
bool get3DPoint (Ogre::Viewport *viewport, int x, int y, Ogre::Vector3 &result_point)
SelectionHandlerPtr getHandler (CollObjectHandle obj)
bool getInteractionEnabled ()
PropertyTreeModelgetPropertyModel ()
const M_PickedgetSelection ()
virtual Ogre::Technique * handleSchemeNotFound (unsigned short scheme_index, const Ogre::String &scheme_name, Ogre::Material *original_material, unsigned short lod_index, const Ogre::Renderable *rend)
void highlight (Ogre::Viewport *viewport, int x1, int y1, int x2, int y2)
void initialize (bool debug=false)
void pick (Ogre::Viewport *viewport, int x1, int y1, int x2, int y2, M_Picked &results, bool single_render_pass=false)
void removeHighlight ()
void removeObject (CollObjectHandle obj)
void removeSelection (const M_Picked &objs)
void renderQueueStarted (uint8_t queueGroupId, const std::string &invocation, bool &skipThisInvocation)
void select (Ogre::Viewport *viewport, int x1, int y1, int x2, int y2, SelectType type)
 SelectionManager (VisualizationManager *manager)
void setSelection (const M_Picked &objs)
void setTextureSize (unsigned size)
void update ()
 ~SelectionManager ()

Private Types

typedef boost::unordered_map
< CollObjectHandle,
SelectionHandlerPtr
M_CollisionObjectToSelectionHandler

Private Slots

void updateProperties ()
 Call updateProperties() on all SelectionHandlers in the current selection.

Private Member Functions

std::pair< Picked, bool > addSelectedObject (const Picked &obj)
void initDepthFinder ()
void removeSelectedObject (const Picked &obj)
bool render (Ogre::Viewport *viewport, Ogre::TexturePtr tex, int x1, int y1, int x2, int y2, Ogre::PixelBox &dst_box, std::string material_scheme, unsigned texture_size)
void renderAndUnpack (Ogre::Viewport *viewport, uint32_t pass, int x1, int y1, int x2, int y2, V_Pixel &pixels)
void selectionAdded (const M_Picked &added)
void selectionRemoved (const M_Picked &removed)
void setDebugVisibility (bool visible)
void setHighlightRect (Ogre::Viewport *viewport, int x1, int y1, int x2, int y2)
void unpackColors (const Ogre::PixelBox &box, V_Pixel &pixels)

Private Attributes

Ogre::Camera * camera_
Ogre::MaterialPtr debug_depth_material_
Ogre::SceneNode * debug_depth_node_
Ogre::MaterialPtr debug_material_ [s_num_render_textures_]
bool debug_mode_
Ogre::SceneNode * debug_nodes_ [s_num_render_textures_]
Ogre::PixelBox depth_pixel_box_
Ogre::TexturePtr depth_render_texture_
uint32_t depth_texture_size_
Ogre::MaterialPtr fallback_pick_material_
Ogre::Technique * fallback_pick_technique_
boost::recursive_mutex global_mutex_
Highlight highlight_
bool highlight_enabled_
Ogre::SceneNode * highlight_node_
Ogre::Rectangle2D * highlight_rectangle_
bool interaction_enabled_
M_CollisionObjectToSelectionHandler objects_
Ogre::PixelBox pixel_boxes_ [s_num_render_textures_]
V_Pixel pixel_buffer_
PropertyTreeModelproperty_model_
Ogre::TexturePtr render_textures_ [s_num_render_textures_]
M_Picked selection_
bool setting_
uint32_t texture_size_
uint32_t uid_counter_
VisualizationManagervis_manager_

Static Private Attributes

static const uint32_t s_num_render_textures_ = 2

Detailed Description

Definition at line 74 of file selection_manager.h.


Member Typedef Documentation

Definition at line 188 of file selection_manager.h.


Member Enumeration Documentation

Enumerator:
Add 
Remove 
Replace 

Definition at line 78 of file selection_manager.h.


Constructor & Destructor Documentation

rviz::SelectionManager::SelectionManager ( VisualizationManager manager  ) 

Definition at line 37 of file selection_manager.cpp.

rviz::SelectionManager::~SelectionManager (  ) 

Definition at line 56 of file selection_manager.cpp.


Member Function Documentation

void rviz::SelectionManager::addObject ( CollObjectHandle  obj,
const SelectionHandlerPtr handler 
)

Definition at line 420 of file selection_manager.cpp.

Ogre::Technique * rviz::SelectionManager::addPickTechnique ( CollObjectHandle  handle,
const Ogre::MaterialPtr &  material 
)

Definition at line 927 of file selection_manager.cpp.

std::pair< Picked, bool > rviz::SelectionManager::addSelectedObject ( const Picked obj  )  [private]

Definition at line 1183 of file selection_manager.cpp.

void rviz::SelectionManager::addSelection ( const M_Picked objs  ) 

Definition at line 1150 of file selection_manager.cpp.

void rviz::SelectionManager::clearHandlers (  ) 

Definition at line 375 of file selection_manager.cpp.

CollObjectHandle rviz::SelectionManager::createCollisionForEntity ( Ogre::Entity *  entity,
const SelectionHandlerPtr handler,
CollObjectHandle  coll = 0 
)

Definition at line 1083 of file selection_manager.cpp.

CollObjectHandle rviz::SelectionManager::createCollisionForObject ( Object obj,
const SelectionHandlerPtr handler,
CollObjectHandle  coll = 0 
)

Definition at line 1024 of file selection_manager.cpp.

CollObjectHandle rviz::SelectionManager::createHandle (  ) 

Definition at line 398 of file selection_manager.cpp.

void rviz::SelectionManager::enableInteraction ( bool  enable  ) 

Definition at line 382 of file selection_manager.cpp.

void rviz::SelectionManager::focusOnSelection (  ) 

Definition at line 1246 of file selection_manager.cpp.

bool rviz::SelectionManager::get3DPoint ( Ogre::Viewport *  viewport,
int  x,
int  y,
Ogre::Vector3 &  result_point 
)

Return true if the point at x, y in the viewport is showing an object, false otherwise. If it is showing an object, result will be changed to contain the 3D point corresponding to it.

Definition at line 204 of file selection_manager.cpp.

SelectionHandlerPtr rviz::SelectionManager::getHandler ( CollObjectHandle  obj  ) 

Definition at line 1123 of file selection_manager.cpp.

bool rviz::SelectionManager::getInteractionEnabled (  )  [inline]

Definition at line 134 of file selection_manager.h.

PropertyTreeModel* rviz::SelectionManager::getPropertyModel (  )  [inline]

Definition at line 152 of file selection_manager.h.

const M_Picked& rviz::SelectionManager::getSelection (  )  [inline]

Definition at line 115 of file selection_manager.h.

Ogre::Technique * rviz::SelectionManager::handleSchemeNotFound ( unsigned short  scheme_index,
const Ogre::String &  scheme_name,
Ogre::Material *  original_material,
unsigned short  lod_index,
const Ogre::Renderable *  rend 
) [virtual]

Definition at line 918 of file selection_manager.cpp.

void rviz::SelectionManager::highlight ( Ogre::Viewport *  viewport,
int  x1,
int  y1,
int  x2,
int  y2 
)

Definition at line 482 of file selection_manager.cpp.

void rviz::SelectionManager::initDepthFinder (  )  [private]

Definition at line 135 of file selection_manager.cpp.

void rviz::SelectionManager::initialize ( bool  debug = false  ) 

Definition at line 76 of file selection_manager.cpp.

void rviz::SelectionManager::pick ( Ogre::Viewport *  viewport,
int  x1,
int  y1,
int  x2,
int  y2,
M_Picked results,
bool  single_render_pass = false 
)

Definition at line 743 of file selection_manager.cpp.

void rviz::SelectionManager::removeHighlight (  ) 

Definition at line 495 of file selection_manager.cpp.

void rviz::SelectionManager::removeObject ( CollObjectHandle  obj  ) 

Definition at line 442 of file selection_manager.cpp.

void rviz::SelectionManager::removeSelectedObject ( const Picked obj  )  [private]

Definition at line 1222 of file selection_manager.cpp.

void rviz::SelectionManager::removeSelection ( const M_Picked objs  ) 

Definition at line 1136 of file selection_manager.cpp.

bool rviz::SelectionManager::render ( Ogre::Viewport *  viewport,
Ogre::TexturePtr  tex,
int  x1,
int  y1,
int  x2,
int  y2,
Ogre::PixelBox &  dst_box,
std::string  material_scheme,
unsigned  texture_size 
) [private]

Internal render function to render to a texture and read the pixels back out.

Definition at line 587 of file selection_manager.cpp.

void rviz::SelectionManager::renderAndUnpack ( Ogre::Viewport *  viewport,
uint32_t  pass,
int  x1,
int  y1,
int  x2,
int  y2,
V_Pixel pixels 
) [private]

Render to a texture for one of the picking passes and unpack the resulting pixels.

Definition at line 570 of file selection_manager.cpp.

void rviz::SelectionManager::renderQueueStarted ( uint8_t  queueGroupId,
const std::string &  invocation,
bool &  skipThisInvocation 
)

Definition at line 732 of file selection_manager.cpp.

void rviz::SelectionManager::select ( Ogre::Viewport *  viewport,
int  x1,
int  y1,
int  x2,
int  y2,
SelectType  type 
)

Definition at line 502 of file selection_manager.cpp.

void rviz::SelectionManager::selectionAdded ( const M_Picked added  )  [private]

Definition at line 1303 of file selection_manager.cpp.

void rviz::SelectionManager::selectionRemoved ( const M_Picked removed  )  [private]

Definition at line 1284 of file selection_manager.cpp.

void rviz::SelectionManager::setDebugVisibility ( bool  visible  )  [private]

Definition at line 192 of file selection_manager.cpp.

void rviz::SelectionManager::setHighlightRect ( Ogre::Viewport *  viewport,
int  x1,
int  y1,
int  x2,
int  y2 
) [private]

Definition at line 526 of file selection_manager.cpp.

void rviz::SelectionManager::setSelection ( const M_Picked objs  ) 

Definition at line 1169 of file selection_manager.cpp.

void rviz::SelectionManager::setTextureSize ( unsigned  size  ) 

Definition at line 295 of file selection_manager.cpp.

void rviz::SelectionManager::unpackColors ( const Ogre::PixelBox &  box,
V_Pixel pixels 
) [private]

Definition at line 541 of file selection_manager.cpp.

void rviz::SelectionManager::update (  ) 

Definition at line 463 of file selection_manager.cpp.

void rviz::SelectionManager::updateProperties (  )  [private, slot]

Call updateProperties() on all SelectionHandlers in the current selection.

Definition at line 1318 of file selection_manager.cpp.


Member Data Documentation

Ogre::Camera* rviz::SelectionManager::camera_ [private]

Definition at line 220 of file selection_manager.h.

Ogre::MaterialPtr rviz::SelectionManager::debug_depth_material_ [private]

Definition at line 213 of file selection_manager.h.

Ogre::SceneNode* rviz::SelectionManager::debug_depth_node_ [private]

Definition at line 212 of file selection_manager.h.

Definition at line 227 of file selection_manager.h.

Definition at line 228 of file selection_manager.h.

Definition at line 226 of file selection_manager.h.

Ogre::PixelBox rviz::SelectionManager::depth_pixel_box_ [private]

Definition at line 214 of file selection_manager.h.

Definition at line 210 of file selection_manager.h.

Definition at line 211 of file selection_manager.h.

Definition at line 230 of file selection_manager.h.

Definition at line 231 of file selection_manager.h.

boost::recursive_mutex rviz::SelectionManager::global_mutex_ [private]

Definition at line 186 of file selection_manager.h.

Definition at line 201 of file selection_manager.h.

Definition at line 191 of file selection_manager.h.

Ogre::SceneNode* rviz::SelectionManager::highlight_node_ [private]

Definition at line 219 of file selection_manager.h.

Ogre::Rectangle2D* rviz::SelectionManager::highlight_rectangle_ [private]

Definition at line 218 of file selection_manager.h.

Definition at line 224 of file selection_manager.h.

Definition at line 189 of file selection_manager.h.

Definition at line 207 of file selection_manager.h.

Definition at line 222 of file selection_manager.h.

Definition at line 235 of file selection_manager.h.

Definition at line 206 of file selection_manager.h.

const uint32_t rviz::SelectionManager::s_num_render_textures_ = 2 [static, private]

Definition at line 205 of file selection_manager.h.

Definition at line 203 of file selection_manager.h.

Definition at line 236 of file selection_manager.h.

Definition at line 233 of file selection_manager.h.

Definition at line 216 of file selection_manager.h.

Definition at line 184 of file selection_manager.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Wed Jun 6 11:25:48 2012