#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 () |
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. More... | |
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. 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, 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) |
Static Private Attributes | |
static const uint32_t | s_num_render_textures_ = 2 |
Definition at line 80 of file selection_manager.h.
|
private |
Definition at line 237 of file selection_manager.h.
|
private |
Definition at line 287 of file selection_manager.h.
Enumerator | |
---|---|
Add | |
Remove | |
Replace |
Definition at line 84 of file selection_manager.h.
rviz::SelectionManager::SelectionManager | ( | VisualizationManager * | manager | ) |
Definition at line 78 of file selection_manager.cpp.
rviz::SelectionManager::~SelectionManager | ( | ) |
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.
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.
void rviz::SelectionManager::clearHandlers | ( | ) |
Definition at line 405 of file selection_manager.cpp.
CollObjectHandle rviz::SelectionManager::createHandle | ( | ) |
Definition at line 426 of file selection_manager.cpp.
void rviz::SelectionManager::enableInteraction | ( | bool | enable | ) |
Definition at line 412 of file selection_manager.cpp.
void rviz::SelectionManager::focusOnSelection | ( | ) |
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.
SelectionHandler * rviz::SelectionManager::getHandler | ( | CollObjectHandle | obj | ) |
Definition at line 1109 of file selection_manager.cpp.
|
inline |
Definition at line 145 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.
|
inline |
Definition at line 202 of file selection_manager.h.
|
inline |
Definition at line 120 of file selection_manager.h.
|
virtual |
Definition at line 991 of file selection_manager.cpp.
|
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.
|
private |
Definition at line 756 of file selection_manager.cpp.
void rviz::SelectionManager::removeHighlight | ( | ) |
Definition at line 521 of file selection_manager.cpp.
void rviz::SelectionManager::removeObject | ( | CollObjectHandle | obj | ) |
Definition at line 468 of file selection_manager.cpp.
|
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.
|
private |
Internal render function to render to a texture and read the pixels back out.
Definition at line 607 of file selection_manager.cpp.
|
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.
|
private |
Definition at line 1283 of file selection_manager.cpp.
|
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.
|
private |
Definition at line 318 of file selection_manager.cpp.
|
private |
Definition at line 552 of file selection_manager.cpp.
|
inlinestatic |
Definition at line 126 of file selection_manager.h.
|
inlinestatic |
Definition at line 127 of file selection_manager.h.
|
static |
Definition at line 1064 of file selection_manager.cpp.
|
static |
Definition at line 1102 of file selection_manager.cpp.
|
inlinestatic |
Definition at line 128 of file selection_manager.h.
|
inlinestatic |
Definition at line 129 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.
|
private |
Definition at line 567 of file selection_manager.cpp.
void rviz::SelectionManager::update | ( | ) |
Definition at line 489 of file selection_manager.cpp.
|
privateslot |
Call updateProperties() on all SelectionHandlers in the current selection.
Definition at line 1298 of file selection_manager.cpp.
|
private |
Definition at line 267 of file selection_manager.h.
|
private |
Definition at line 273 of file selection_manager.h.
|
private |
Definition at line 288 of file selection_manager.h.
|
private |
Definition at line 261 of file selection_manager.h.
|
private |
Definition at line 259 of file selection_manager.h.
|
private |
Definition at line 260 of file selection_manager.h.
|
private |
Definition at line 260 of file selection_manager.h.
|
private |
Definition at line 280 of file selection_manager.h.
|
private |
Definition at line 277 of file selection_manager.h.
|
private |
Definition at line 281 of file selection_manager.h.
|
private |
Definition at line 278 of file selection_manager.h.
|
private |
Definition at line 279 of file selection_manager.h.
|
private |
Definition at line 275 of file selection_manager.h.
|
private |
Definition at line 276 of file selection_manager.h.
|
private |
Definition at line 235 of file selection_manager.h.
|
private |
Definition at line 250 of file selection_manager.h.
|
private |
Definition at line 240 of file selection_manager.h.
|
private |
Definition at line 266 of file selection_manager.h.
|
private |
Definition at line 265 of file selection_manager.h.
|
private |
Definition at line 271 of file selection_manager.h.
|
private |
Definition at line 238 of file selection_manager.h.
|
private |
Definition at line 256 of file selection_manager.h.
|
private |
Definition at line 269 of file selection_manager.h.
|
private |
Definition at line 285 of file selection_manager.h.
|
private |
Definition at line 255 of file selection_manager.h.
|
staticprivate |
Definition at line 254 of file selection_manager.h.
|
private |
Definition at line 252 of file selection_manager.h.
|
private |
Definition at line 283 of file selection_manager.h.
|
private |
Definition at line 263 of file selection_manager.h.
|
private |
Definition at line 233 of file selection_manager.h.