#include <selection_manager.h>
Classes | |
struct | Highlight |
Public Types | |
enum | SelectType { Add, Remove, Replace } |
Signals | |
void | selectionAdded (const M_Picked &added) |
void | selectionRemoved (const M_Picked &removed) |
void | selectionSet (const M_Picked &old_selection, const M_Picked &new_selection) |
void | selectionSetting () |
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) |
Ogre::Viewport * | getCurrentViewport () |
Get the viewport currently being rendered to. Used by recipients of pre- and post-render callbacks to determine where the rendering is happening; returns NULL when called not between those callbacks. | |
SelectionHandlerPtr | getHandler (CollObjectHandle obj) |
bool | getInteractionEnabled () |
const M_Picked & | getSelection () |
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 () | |
Protected Types | |
typedef boost::unordered_map < CollObjectHandle, SelectionHandlerPtr > | M_CollisionObjectToSelectionHandler |
Protected Member Functions | |
std::pair< Picked, bool > | addSelection (const Picked &obj) |
void | initDepthFinder () |
void | removeSelection (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 | 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) |
Protected Attributes | |
Ogre::Camera * | camera_ |
Ogre::Viewport * | current_viewport_ |
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_ |
Ogre::TexturePtr | render_textures_ [s_num_render_textures_] |
M_Picked | selection_ |
uint32_t | texture_size_ |
uint32_t | uid_counter_ |
VisualizationManager * | vis_manager_ |
Static Protected Attributes | |
static const uint32_t | s_num_render_textures_ = 2 |
Definition at line 75 of file selection_manager.h.
typedef boost::unordered_map<CollObjectHandle, SelectionHandlerPtr> rviz::SelectionManager::M_CollisionObjectToSelectionHandler [protected] |
Definition at line 191 of file selection_manager.h.
Definition at line 79 of file selection_manager.h.
Definition at line 66 of file selection_manager.cpp.
Definition at line 80 of file selection_manager.cpp.
void rviz::SelectionManager::addObject | ( | CollObjectHandle | obj, |
const SelectionHandlerPtr & | handler | ||
) |
Definition at line 443 of file selection_manager.cpp.
Ogre::Technique * rviz::SelectionManager::addPickTechnique | ( | CollObjectHandle | handle, |
const Ogre::MaterialPtr & | material | ||
) |
Definition at line 952 of file selection_manager.cpp.
void rviz::SelectionManager::addSelection | ( | const M_Picked & | objs | ) |
Definition at line 1175 of file selection_manager.cpp.
std::pair< Picked, bool > rviz::SelectionManager::addSelection | ( | const Picked & | obj | ) | [protected] |
Definition at line 1208 of file selection_manager.cpp.
Definition at line 398 of file selection_manager.cpp.
CollObjectHandle rviz::SelectionManager::createCollisionForEntity | ( | Ogre::Entity * | entity, |
const SelectionHandlerPtr & | handler, | ||
CollObjectHandle | coll = 0 |
||
) |
Definition at line 1108 of file selection_manager.cpp.
CollObjectHandle rviz::SelectionManager::createCollisionForObject | ( | Object * | obj, |
const SelectionHandlerPtr & | handler, | ||
CollObjectHandle | coll = 0 |
||
) |
Definition at line 1049 of file selection_manager.cpp.
Definition at line 421 of file selection_manager.cpp.
void rviz::SelectionManager::enableInteraction | ( | bool | enable | ) |
Definition at line 405 of file selection_manager.cpp.
Definition at line 1271 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 226 of file selection_manager.cpp.
Ogre::Viewport* rviz::SelectionManager::getCurrentViewport | ( | ) | [inline] |
Get the viewport currently being rendered to. Used by recipients of pre- and post-render callbacks to determine where the rendering is happening; returns NULL when called not between those callbacks.
Definition at line 157 of file selection_manager.h.
Definition at line 1148 of file selection_manager.cpp.
bool rviz::SelectionManager::getInteractionEnabled | ( | ) | [inline] |
Definition at line 135 of file selection_manager.h.
const M_Picked& rviz::SelectionManager::getSelection | ( | ) | [inline] |
Definition at line 116 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 943 of file selection_manager.cpp.
void rviz::SelectionManager::highlight | ( | Ogre::Viewport * | viewport, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Definition at line 505 of file selection_manager.cpp.
void rviz::SelectionManager::initDepthFinder | ( | ) | [protected] |
Definition at line 157 of file selection_manager.cpp.
void rviz::SelectionManager::initialize | ( | bool | debug = false | ) |
Definition at line 98 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 766 of file selection_manager.cpp.
Definition at line 518 of file selection_manager.cpp.
void rviz::SelectionManager::removeObject | ( | CollObjectHandle | obj | ) |
Definition at line 465 of file selection_manager.cpp.
void rviz::SelectionManager::removeSelection | ( | const M_Picked & | objs | ) |
Definition at line 1161 of file selection_manager.cpp.
void rviz::SelectionManager::removeSelection | ( | const Picked & | obj | ) | [protected] |
Definition at line 1247 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 | ||
) | [protected] |
Internal render function to render to a texture and read the pixels back out.
Definition at line 610 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 | ||
) | [protected] |
Render to a texture for one of the picking passes and unpack the resulting pixels.
Definition at line 593 of file selection_manager.cpp.
void rviz::SelectionManager::renderQueueStarted | ( | uint8_t | queueGroupId, |
const std::string & | invocation, | ||
bool & | skipThisInvocation | ||
) |
Definition at line 755 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 525 of file selection_manager.cpp.
void rviz::SelectionManager::selectionAdded | ( | const M_Picked & | added | ) | [signal] |
void rviz::SelectionManager::selectionRemoved | ( | const M_Picked & | removed | ) | [signal] |
void rviz::SelectionManager::selectionSet | ( | const M_Picked & | old_selection, |
const M_Picked & | new_selection | ||
) | [signal] |
void rviz::SelectionManager::selectionSetting | ( | ) | [signal] |
void rviz::SelectionManager::setDebugVisibility | ( | bool | visible | ) | [protected] |
Definition at line 214 of file selection_manager.cpp.
void rviz::SelectionManager::setHighlightRect | ( | Ogre::Viewport * | viewport, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) | [protected] |
Definition at line 549 of file selection_manager.cpp.
void rviz::SelectionManager::setSelection | ( | const M_Picked & | objs | ) |
Definition at line 1194 of file selection_manager.cpp.
void rviz::SelectionManager::setTextureSize | ( | unsigned | size | ) |
Definition at line 318 of file selection_manager.cpp.
void rviz::SelectionManager::unpackColors | ( | const Ogre::PixelBox & | box, |
V_Pixel & | pixels | ||
) | [protected] |
Definition at line 564 of file selection_manager.cpp.
void rviz::SelectionManager::update | ( | ) |
Definition at line 486 of file selection_manager.cpp.
Ogre::Camera* rviz::SelectionManager::camera_ [protected] |
Definition at line 223 of file selection_manager.h.
Ogre::Viewport* rviz::SelectionManager::current_viewport_ [protected] |
Definition at line 240 of file selection_manager.h.
Ogre::MaterialPtr rviz::SelectionManager::debug_depth_material_ [protected] |
Definition at line 216 of file selection_manager.h.
Ogre::SceneNode* rviz::SelectionManager::debug_depth_node_ [protected] |
Definition at line 215 of file selection_manager.h.
Ogre::MaterialPtr rviz::SelectionManager::debug_material_[s_num_render_textures_] [protected] |
Definition at line 230 of file selection_manager.h.
bool rviz::SelectionManager::debug_mode_ [protected] |
Definition at line 231 of file selection_manager.h.
Ogre::SceneNode* rviz::SelectionManager::debug_nodes_[s_num_render_textures_] [protected] |
Definition at line 229 of file selection_manager.h.
Ogre::PixelBox rviz::SelectionManager::depth_pixel_box_ [protected] |
Definition at line 217 of file selection_manager.h.
Ogre::TexturePtr rviz::SelectionManager::depth_render_texture_ [protected] |
Definition at line 213 of file selection_manager.h.
uint32_t rviz::SelectionManager::depth_texture_size_ [protected] |
Definition at line 214 of file selection_manager.h.
Ogre::MaterialPtr rviz::SelectionManager::fallback_pick_material_ [protected] |
Definition at line 233 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_pick_technique_ [protected] |
Definition at line 234 of file selection_manager.h.
boost::recursive_mutex rviz::SelectionManager::global_mutex_ [protected] |
Definition at line 189 of file selection_manager.h.
Highlight rviz::SelectionManager::highlight_ [protected] |
Definition at line 204 of file selection_manager.h.
bool rviz::SelectionManager::highlight_enabled_ [protected] |
Definition at line 194 of file selection_manager.h.
Ogre::SceneNode* rviz::SelectionManager::highlight_node_ [protected] |
Definition at line 222 of file selection_manager.h.
Ogre::Rectangle2D* rviz::SelectionManager::highlight_rectangle_ [protected] |
Definition at line 221 of file selection_manager.h.
bool rviz::SelectionManager::interaction_enabled_ [protected] |
Definition at line 227 of file selection_manager.h.
Definition at line 192 of file selection_manager.h.
Ogre::PixelBox rviz::SelectionManager::pixel_boxes_[s_num_render_textures_] [protected] |
Definition at line 210 of file selection_manager.h.
V_Pixel rviz::SelectionManager::pixel_buffer_ [protected] |
Definition at line 225 of file selection_manager.h.
Ogre::TexturePtr rviz::SelectionManager::render_textures_[s_num_render_textures_] [protected] |
Definition at line 209 of file selection_manager.h.
const uint32_t rviz::SelectionManager::s_num_render_textures_ = 2 [static, protected] |
Definition at line 208 of file selection_manager.h.
M_Picked rviz::SelectionManager::selection_ [protected] |
Definition at line 206 of file selection_manager.h.
uint32_t rviz::SelectionManager::texture_size_ [protected] |
Definition at line 236 of file selection_manager.h.
uint32_t rviz::SelectionManager::uid_counter_ [protected] |
Definition at line 219 of file selection_manager.h.
VisualizationManager* rviz::SelectionManager::vis_manager_ [protected] |
Definition at line 187 of file selection_manager.h.