#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. More... | |
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. More... | |
PropertyTreeModel * | getPropertyModel () |
const M_Picked & | getSelection () |
Ogre::Technique * | handleSchemeNotFound (unsigned short scheme_index, const Ogre::String &scheme_name, Ogre::Material *original_material, unsigned short lod_index, const Ogre::Renderable *rend) override |
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) override |
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. More... | |
void | setSelection (const M_Picked &objs) |
void | setTextureSize (unsigned size) |
void | update () |
~SelectionManager () override | |
Static Public Member Functions | |
static Ogre::ColourValue | handleToColor (CollObjectHandle handle) |
static void | setPickColor (const Ogre::ColourValue &color, Ogre::MovableObject *object) |
static void | setPickColor (const Ogre::ColourValue &color, Ogre::SceneNode *node) |
static void | setPickData (CollObjectHandle handle, const Ogre::ColourValue &color, Ogre::MovableObject *object) |
static void | setPickData (CollObjectHandle handle, const Ogre::ColourValue &color, Ogre::SceneNode *node) |
static void | setPickHandle (CollObjectHandle handle, Ogre::MovableObject *object) |
static void | setPickHandle (CollObjectHandle handle, Ogre::SceneNode *node) |
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. More... | |
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, const Ogre::TexturePtr &tex, int x1, int y1, int x2, int y2, Ogre::PixelBox &dst_box, const 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 (Ogre::PixelBox &box, V_CollObject &pixels) |
Static Private Attributes | |
const static uint32_t | s_num_render_textures_ = 2 |
Definition at line 81 of file selection_manager.h.
|
private |
Definition at line 288 of file selection_manager.h.
|
private |
Definition at line 340 of file selection_manager.h.
Enumerator | |
---|---|
Add | |
Remove | |
Replace |
Definition at line 87 of file selection_manager.h.
rviz::SelectionManager::SelectionManager | ( | VisualizationManager * | manager | ) |
Definition at line 78 of file selection_manager.cpp.
|
override |
Definition at line 97 of file selection_manager.cpp.
void rviz::SelectionManager::addObject | ( | CollObjectHandle | obj, |
SelectionHandler * | handler | ||
) |
Definition at line 459 of file selection_manager.cpp.
Definition at line 1224 of file selection_manager.cpp.
void rviz::SelectionManager::addSelection | ( | const M_Picked & | objs | ) |
Definition at line 1195 of file selection_manager.cpp.
void rviz::SelectionManager::clearHandlers | ( | ) |
Definition at line 416 of file selection_manager.cpp.
CollObjectHandle rviz::SelectionManager::createHandle | ( | ) |
Definition at line 437 of file selection_manager.cpp.
void rviz::SelectionManager::enableInteraction | ( | bool | enable | ) |
Definition at line 423 of file selection_manager.cpp.
void rviz::SelectionManager::focusOnSelection | ( | ) |
Definition at line 1287 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 250 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 179 of file selection_manager.cpp.
SelectionHandler * rviz::SelectionManager::getHandler | ( | CollObjectHandle | obj | ) |
Definition at line 1168 of file selection_manager.cpp.
|
inline |
Definition at line 170 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 196 of file selection_manager.cpp.
|
inline |
Definition at line 238 of file selection_manager.h.
|
inline |
Definition at line 129 of file selection_manager.h.
|
override |
Definition at line 1041 of file selection_manager.cpp.
|
static |
Definition at line 1106 of file selection_manager.cpp.
void rviz::SelectionManager::highlight | ( | Ogre::Viewport * | viewport, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Definition at line 520 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 865 of file selection_manager.cpp.
|
private |
Definition at line 794 of file selection_manager.cpp.
void rviz::SelectionManager::removeHighlight | ( | ) |
Definition at line 533 of file selection_manager.cpp.
void rviz::SelectionManager::removeObject | ( | CollObjectHandle | obj | ) |
Definition at line 480 of file selection_manager.cpp.
|
private |
Definition at line 1263 of file selection_manager.cpp.
void rviz::SelectionManager::removeSelection | ( | const M_Picked & | objs | ) |
Definition at line 1181 of file selection_manager.cpp.
|
private |
Internal render function to render to a texture and read the pixels back out.
Definition at line 625 of file selection_manager.cpp.
|
private |
Render to a texture for one of the picking passes and unpack the resulting pixels.
Definition at line 600 of file selection_manager.cpp.
|
override |
Definition at line 853 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 540 of file selection_manager.cpp.
|
private |
Definition at line 1342 of file selection_manager.cpp.
|
private |
Definition at line 1328 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.
|
private |
Definition at line 327 of file selection_manager.cpp.
|
private |
Definition at line 564 of file selection_manager.cpp.
|
inlinestatic |
Definition at line 142 of file selection_manager.h.
|
inlinestatic |
Definition at line 138 of file selection_manager.h.
|
static |
Definition at line 1159 of file selection_manager.cpp.
|
static |
Definition at line 1114 of file selection_manager.cpp.
|
inlinestatic |
Definition at line 150 of file selection_manager.h.
|
inlinestatic |
Definition at line 146 of file selection_manager.h.
void rviz::SelectionManager::setSelection | ( | const M_Picked & | objs | ) |
Definition at line 1214 of file selection_manager.cpp.
void rviz::SelectionManager::setTextureSize | ( | unsigned | size | ) |
Definition at line 375 of file selection_manager.cpp.
|
private |
Definition at line 579 of file selection_manager.cpp.
void rviz::SelectionManager::update | ( | ) |
Definition at line 501 of file selection_manager.cpp.
|
privateslot |
Call updateProperties() on all SelectionHandlers in the current selection.
Definition at line 1357 of file selection_manager.cpp.
|
private |
Definition at line 320 of file selection_manager.h.
|
private |
Definition at line 326 of file selection_manager.h.
|
private |
Definition at line 341 of file selection_manager.h.
|
private |
Definition at line 314 of file selection_manager.h.
|
private |
Definition at line 312 of file selection_manager.h.
|
private |
Definition at line 313 of file selection_manager.h.
|
private |
Definition at line 313 of file selection_manager.h.
|
private |
Definition at line 333 of file selection_manager.h.
|
private |
Definition at line 330 of file selection_manager.h.
|
private |
Definition at line 334 of file selection_manager.h.
|
private |
Definition at line 331 of file selection_manager.h.
|
private |
Definition at line 332 of file selection_manager.h.
|
private |
Definition at line 328 of file selection_manager.h.
|
private |
Definition at line 329 of file selection_manager.h.
|
private |
Definition at line 286 of file selection_manager.h.
|
private |
Definition at line 301 of file selection_manager.h.
|
private |
Definition at line 291 of file selection_manager.h.
|
private |
Definition at line 319 of file selection_manager.h.
|
private |
Definition at line 318 of file selection_manager.h.
|
private |
Definition at line 324 of file selection_manager.h.
|
private |
Definition at line 289 of file selection_manager.h.
|
private |
Definition at line 309 of file selection_manager.h.
|
private |
Definition at line 322 of file selection_manager.h.
|
private |
Definition at line 338 of file selection_manager.h.
|
private |
Definition at line 308 of file selection_manager.h.
|
staticprivate |
Definition at line 305 of file selection_manager.h.
|
private |
Definition at line 303 of file selection_manager.h.
|
private |
Definition at line 336 of file selection_manager.h.
|
private |
Definition at line 316 of file selection_manager.h.
|
private |
Definition at line 284 of file selection_manager.h.