#include <selection_manager.h>
Classes | |
struct | Highlight |
Public Types | |
enum | SelectType { Add, Remove, Replace } |
Public Member Functions | |
void | addObject (CollObjectHandle obj, SelectionHandler *handler) |
void | addSelection (const M_Picked &objs) |
void | clearHandlers () |
CollObjectHandle | createHandle () |
void | enableInteraction (bool enable) |
void | focusOnSelection () |
bool | get3DPatch (Ogre::Viewport *viewport, const int x, const int y, const unsigned width, const unsigned height, const bool skip_missing, std::vector< Ogre::Vector3 > &result_points) |
Gets the 3D points in a box around a point in a view port. | |
bool | get3DPoint (Ogre::Viewport *viewport, const int x, const int y, Ogre::Vector3 &result_point) |
SelectionHandler * | getHandler (CollObjectHandle obj) |
bool | getInteractionEnabled () |
bool | getPatchDepthImage (Ogre::Viewport *viewport, const int x, const int y, const unsigned width, const unsigned height, std::vector< float > &depth_vector) |
Renders a depth image in a box around a point in a view port. | |
PropertyTreeModel * | getPropertyModel () |
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 () |
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 | setDebugMode (bool debug) |
Enables or disables publishing of picking and depth rendering images. | |
void | setSelection (const M_Picked &objs) |
void | setTextureSize (unsigned size) |
void | update () |
~SelectionManager () | |
Static Public Member Functions | |
static Ogre::ColourValue | handleToColor (CollObjectHandle handle) |
static void | setPickColor (const Ogre::ColourValue &color, Ogre::SceneNode *node) |
static void | setPickColor (const Ogre::ColourValue &color, Ogre::MovableObject *object) |
static void | setPickData (CollObjectHandle handle, const Ogre::ColourValue &color, Ogre::SceneNode *node) |
static void | setPickData (CollObjectHandle handle, const Ogre::ColourValue &color, Ogre::MovableObject *object) |
static void | setPickHandle (CollObjectHandle handle, Ogre::SceneNode *node) |
static void | setPickHandle (CollObjectHandle handle, Ogre::MovableObject *object) |
Private Types | |
typedef boost::unordered_map < CollObjectHandle, SelectionHandler * > | M_CollisionObjectToSelectionHandler |
typedef std::map< std::string, ros::Publisher > | PublisherMap |
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 | publishDebugImage (const Ogre::PixelBox &pixel_box, const std::string &label) |
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_width, unsigned textured_height) |
void | renderAndUnpack (Ogre::Viewport *viewport, uint32_t pass, int x1, int y1, int x2, int y2, V_CollObject &pixels) |
void | selectionAdded (const M_Picked &added) |
void | selectionRemoved (const M_Picked &removed) |
void | setDepthTextureSize (unsigned width, unsigned height) |
void | setHighlightRect (Ogre::Viewport *viewport, int x1, int y1, int x2, int y2) |
void | unpackColors (const Ogre::PixelBox &box, V_CollObject &pixels) |
Private Attributes | |
Ogre::Camera * | camera_ |
bool | debug_mode_ |
PublisherMap | debug_publishers_ |
Ogre::PixelBox | depth_pixel_box_ |
Ogre::TexturePtr | depth_render_texture_ |
uint32_t | depth_texture_height_ |
uint32_t | depth_texture_width_ |
Ogre::Technique * | fallback_black_cull_technique_ |
Ogre::Technique * | fallback_black_technique_ |
Ogre::Technique * | fallback_depth_cull_technique_ |
Ogre::Technique * | fallback_depth_technique_ |
Ogre::Technique * | fallback_pick_cull_technique_ |
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_CollObject | pixel_buffer_ |
PropertyTreeModel * | property_model_ |
Ogre::TexturePtr | render_textures_ [s_num_render_textures_] |
M_Picked | selection_ |
uint32_t | texture_size_ |
uint32_t | uid_counter_ |
VisualizationManager * | vis_manager_ |
Static Private Attributes | |
static const uint32_t | s_num_render_textures_ = 2 |
Definition at line 78 of file selection_manager.h.
typedef boost::unordered_map<CollObjectHandle, SelectionHandler*> rviz::SelectionManager::M_CollisionObjectToSelectionHandler [private] |
Definition at line 235 of file selection_manager.h.
typedef std::map<std::string, ros::Publisher> rviz::SelectionManager::PublisherMap [private] |
Definition at line 285 of file selection_manager.h.
Definition at line 82 of file selection_manager.h.
Definition at line 78 of file selection_manager.cpp.
Definition at line 97 of file selection_manager.cpp.
void rviz::SelectionManager::addObject | ( | CollObjectHandle | obj, |
SelectionHandler * | handler | ||
) |
Definition at line 448 of file selection_manager.cpp.
std::pair< Picked, bool > rviz::SelectionManager::addSelectedObject | ( | const Picked & | obj | ) | [private] |
Definition at line 1165 of file selection_manager.cpp.
void rviz::SelectionManager::addSelection | ( | const M_Picked & | objs | ) |
Definition at line 1136 of file selection_manager.cpp.
Definition at line 405 of file selection_manager.cpp.
Definition at line 426 of file selection_manager.cpp.
void rviz::SelectionManager::enableInteraction | ( | bool | enable | ) |
Definition at line 412 of file selection_manager.cpp.
Definition at line 1228 of file selection_manager.cpp.
bool rviz::SelectionManager::get3DPatch | ( | Ogre::Viewport * | viewport, |
const int | x, | ||
const int | y, | ||
const unsigned | width, | ||
const unsigned | height, | ||
const bool | skip_missing, | ||
std::vector< Ogre::Vector3 > & | result_points | ||
) |
Gets the 3D points in a box around a point in a view port.
[in] | viewport | Rendering area clicked on. |
[in] | x | x coordinate of upper-left corner of box. |
[in] | y | y coordinate of upper-left corner of box. |
[in] | width | The width of the rendered box in pixels. |
[in] | height | The height of the rendered box in pixels. |
[in] | skip_missing | Whether to skip non-existing points or insert NaNs for them |
[out] | result_points | The vector of output points. |
Definition at line 245 of file selection_manager.cpp.
bool rviz::SelectionManager::get3DPoint | ( | Ogre::Viewport * | viewport, |
const int | x, | ||
const 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 176 of file selection_manager.cpp.
Definition at line 1109 of file selection_manager.cpp.
bool rviz::SelectionManager::getInteractionEnabled | ( | ) | [inline] |
Definition at line 143 of file selection_manager.h.
bool rviz::SelectionManager::getPatchDepthImage | ( | Ogre::Viewport * | viewport, |
const int | x, | ||
const int | y, | ||
const unsigned | width, | ||
const unsigned | height, | ||
std::vector< float > & | depth_vector | ||
) |
Renders a depth image in a box around a point in a view port.
[in] | viewport | Rendering area clicked on. |
[in] | x | x coordinate of upper-left corner of box. |
[in] | y | y coordinate of upper-left corner of box. |
[in] | width | The width of the rendered box in pixels. |
[in] | height | The height of the rendered box in pixels. |
[out] | depth_vector | The vector of depth values. |
Definition at line 194 of file selection_manager.cpp.
PropertyTreeModel* rviz::SelectionManager::getPropertyModel | ( | ) | [inline] |
Definition at line 200 of file selection_manager.h.
const M_Picked& rviz::SelectionManager::getSelection | ( | ) | [inline] |
Definition at line 118 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 991 of file selection_manager.cpp.
Ogre::ColourValue rviz::SelectionManager::handleToColor | ( | CollObjectHandle | handle | ) | [static] |
Definition at line 1056 of file selection_manager.cpp.
void rviz::SelectionManager::highlight | ( | Ogre::Viewport * | viewport, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Definition at line 508 of file selection_manager.cpp.
void rviz::SelectionManager::initialize | ( | ) |
Definition at line 122 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 824 of file selection_manager.cpp.
void rviz::SelectionManager::publishDebugImage | ( | const Ogre::PixelBox & | pixel_box, |
const std::string & | label | ||
) | [private] |
Definition at line 756 of file selection_manager.cpp.
Definition at line 521 of file selection_manager.cpp.
void rviz::SelectionManager::removeObject | ( | CollObjectHandle | obj | ) |
Definition at line 468 of file selection_manager.cpp.
void rviz::SelectionManager::removeSelectedObject | ( | const Picked & | obj | ) | [private] |
Definition at line 1204 of file selection_manager.cpp.
void rviz::SelectionManager::removeSelection | ( | const M_Picked & | objs | ) |
Definition at line 1122 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_width, | ||
unsigned | textured_height | ||
) | [private] |
Internal render function to render to a texture and read the pixels back out.
Definition at line 607 of file selection_manager.cpp.
void rviz::SelectionManager::renderAndUnpack | ( | Ogre::Viewport * | viewport, |
uint32_t | pass, | ||
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
V_CollObject & | pixels | ||
) | [private] |
Render to a texture for one of the picking passes and unpack the resulting pixels.
Definition at line 589 of file selection_manager.cpp.
void rviz::SelectionManager::renderQueueStarted | ( | uint8_t | queueGroupId, |
const std::string & | invocation, | ||
bool & | skipThisInvocation | ||
) |
Definition at line 813 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 528 of file selection_manager.cpp.
void rviz::SelectionManager::selectionAdded | ( | const M_Picked & | added | ) | [private] |
Definition at line 1283 of file selection_manager.cpp.
void rviz::SelectionManager::selectionRemoved | ( | const M_Picked & | removed | ) | [private] |
Definition at line 1269 of file selection_manager.cpp.
void rviz::SelectionManager::setDebugMode | ( | bool | debug | ) |
Enables or disables publishing of picking and depth rendering images.
Definition at line 117 of file selection_manager.cpp.
void rviz::SelectionManager::setDepthTextureSize | ( | unsigned | width, |
unsigned | height | ||
) | [private] |
Definition at line 318 of file selection_manager.cpp.
void rviz::SelectionManager::setHighlightRect | ( | Ogre::Viewport * | viewport, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) | [private] |
Definition at line 552 of file selection_manager.cpp.
static void rviz::SelectionManager::setPickColor | ( | const Ogre::ColourValue & | color, |
Ogre::SceneNode * | node | ||
) | [inline, static] |
Definition at line 124 of file selection_manager.h.
static void rviz::SelectionManager::setPickColor | ( | const Ogre::ColourValue & | color, |
Ogre::MovableObject * | object | ||
) | [inline, static] |
Definition at line 125 of file selection_manager.h.
void rviz::SelectionManager::setPickData | ( | CollObjectHandle | handle, |
const Ogre::ColourValue & | color, | ||
Ogre::SceneNode * | node | ||
) | [static] |
Definition at line 1064 of file selection_manager.cpp.
void rviz::SelectionManager::setPickData | ( | CollObjectHandle | handle, |
const Ogre::ColourValue & | color, | ||
Ogre::MovableObject * | object | ||
) | [static] |
Definition at line 1102 of file selection_manager.cpp.
static void rviz::SelectionManager::setPickHandle | ( | CollObjectHandle | handle, |
Ogre::SceneNode * | node | ||
) | [inline, static] |
Definition at line 126 of file selection_manager.h.
static void rviz::SelectionManager::setPickHandle | ( | CollObjectHandle | handle, |
Ogre::MovableObject * | object | ||
) | [inline, static] |
Definition at line 127 of file selection_manager.h.
void rviz::SelectionManager::setSelection | ( | const M_Picked & | objs | ) |
Definition at line 1155 of file selection_manager.cpp.
void rviz::SelectionManager::setTextureSize | ( | unsigned | size | ) |
Definition at line 364 of file selection_manager.cpp.
void rviz::SelectionManager::unpackColors | ( | const Ogre::PixelBox & | box, |
V_CollObject & | pixels | ||
) | [private] |
Definition at line 567 of file selection_manager.cpp.
void rviz::SelectionManager::update | ( | ) |
Definition at line 489 of file selection_manager.cpp.
void rviz::SelectionManager::updateProperties | ( | ) | [private, slot] |
Call updateProperties() on all SelectionHandlers in the current selection.
Definition at line 1298 of file selection_manager.cpp.
Ogre::Camera* rviz::SelectionManager::camera_ [private] |
Definition at line 265 of file selection_manager.h.
bool rviz::SelectionManager::debug_mode_ [private] |
Definition at line 271 of file selection_manager.h.
Definition at line 286 of file selection_manager.h.
Ogre::PixelBox rviz::SelectionManager::depth_pixel_box_ [private] |
Definition at line 259 of file selection_manager.h.
Ogre::TexturePtr rviz::SelectionManager::depth_render_texture_ [private] |
Definition at line 257 of file selection_manager.h.
uint32_t rviz::SelectionManager::depth_texture_height_ [private] |
Definition at line 258 of file selection_manager.h.
uint32_t rviz::SelectionManager::depth_texture_width_ [private] |
Definition at line 258 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_black_cull_technique_ [private] |
Definition at line 278 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_black_technique_ [private] |
Definition at line 275 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_depth_cull_technique_ [private] |
Definition at line 279 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_depth_technique_ [private] |
Definition at line 276 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_pick_cull_technique_ [private] |
Definition at line 277 of file selection_manager.h.
Ogre::MaterialPtr rviz::SelectionManager::fallback_pick_material_ [private] |
Definition at line 273 of file selection_manager.h.
Ogre::Technique* rviz::SelectionManager::fallback_pick_technique_ [private] |
Definition at line 274 of file selection_manager.h.
boost::recursive_mutex rviz::SelectionManager::global_mutex_ [private] |
Definition at line 233 of file selection_manager.h.
Highlight rviz::SelectionManager::highlight_ [private] |
Definition at line 248 of file selection_manager.h.
bool rviz::SelectionManager::highlight_enabled_ [private] |
Definition at line 238 of file selection_manager.h.
Ogre::SceneNode* rviz::SelectionManager::highlight_node_ [private] |
Definition at line 264 of file selection_manager.h.
Ogre::Rectangle2D* rviz::SelectionManager::highlight_rectangle_ [private] |
Definition at line 263 of file selection_manager.h.
bool rviz::SelectionManager::interaction_enabled_ [private] |
Definition at line 269 of file selection_manager.h.
Definition at line 236 of file selection_manager.h.
Ogre::PixelBox rviz::SelectionManager::pixel_boxes_[s_num_render_textures_] [private] |
Definition at line 254 of file selection_manager.h.
Definition at line 267 of file selection_manager.h.
Definition at line 283 of file selection_manager.h.
Ogre::TexturePtr rviz::SelectionManager::render_textures_[s_num_render_textures_] [private] |
Definition at line 253 of file selection_manager.h.
const uint32_t rviz::SelectionManager::s_num_render_textures_ = 2 [static, private] |
Definition at line 252 of file selection_manager.h.
M_Picked rviz::SelectionManager::selection_ [private] |
Definition at line 250 of file selection_manager.h.
uint32_t rviz::SelectionManager::texture_size_ [private] |
Definition at line 281 of file selection_manager.h.
uint32_t rviz::SelectionManager::uid_counter_ [private] |
Definition at line 261 of file selection_manager.h.
Definition at line 231 of file selection_manager.h.