Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes
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, 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)
SelectionHandlergetHandler (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.
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 ()
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_
PropertyTreeModelproperty_model_
Ogre::TexturePtr render_textures_ [s_num_render_textures_]
M_Picked selection_
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 80 of file selection_manager.h.


Member Typedef Documentation

Definition at line 237 of file selection_manager.h.

typedef std::map<std::string, ros::Publisher> rviz::SelectionManager::PublisherMap [private]

Definition at line 287 of file selection_manager.h.


Member Enumeration Documentation

Enumerator:
Add 
Remove 
Replace 

Definition at line 84 of file selection_manager.h.


Constructor & Destructor Documentation

Definition at line 78 of file selection_manager.cpp.

Definition at line 97 of file selection_manager.cpp.


Member Function Documentation

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.

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.

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.

Parameters:
[in]viewportRendering area clicked on.
[in]xx coordinate of upper-left corner of box.
[in]yy coordinate of upper-left corner of box.
[in]widthThe width of the rendered box in pixels.
[in]heightThe height of the rendered box in pixels.
[in]skip_missingWhether to skip non-existing points or insert NaNs for them
[out]result_pointsThe vector of output points.
Returns:
True if any valid point is rendered in the box. NaN points count, so if skip_missing is false, this will always return true if width and height are > 0.

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.

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.

Parameters:
[in]viewportRendering area clicked on.
[in]xx coordinate of upper-left corner of box.
[in]yy coordinate of upper-left corner of box.
[in]widthThe width of the rendered box in pixels.
[in]heightThe height of the rendered box in pixels.
[out]depth_vectorThe vector of depth values.
Returns:
True if rendering operation to render depth data to the depth texture buffer succeeds. Failure likely indicates a pretty serious problem.

Definition at line 194 of file selection_manager.cpp.

Definition at line 202 of file selection_manager.h.

Definition at line 120 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.

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.

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.

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.

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 126 of file selection_manager.h.

static void rviz::SelectionManager::setPickColor ( const Ogre::ColourValue &  color,
Ogre::MovableObject *  object 
) [inline, static]

Definition at line 127 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 128 of file selection_manager.h.

static void rviz::SelectionManager::setPickHandle ( CollObjectHandle  handle,
Ogre::MovableObject *  object 
) [inline, static]

Definition at line 129 of file selection_manager.h.

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.

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.


Member Data Documentation

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

Definition at line 267 of file selection_manager.h.

Definition at line 273 of file selection_manager.h.

Definition at line 288 of file selection_manager.h.

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

Definition at line 261 of file selection_manager.h.

Definition at line 259 of file selection_manager.h.

Definition at line 260 of file selection_manager.h.

Definition at line 260 of file selection_manager.h.

Definition at line 280 of file selection_manager.h.

Definition at line 277 of file selection_manager.h.

Definition at line 281 of file selection_manager.h.

Definition at line 278 of file selection_manager.h.

Definition at line 279 of file selection_manager.h.

Definition at line 275 of file selection_manager.h.

Definition at line 276 of file selection_manager.h.

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

Definition at line 235 of file selection_manager.h.

Definition at line 250 of file selection_manager.h.

Definition at line 240 of file selection_manager.h.

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

Definition at line 266 of file selection_manager.h.

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

Definition at line 265 of file selection_manager.h.

Definition at line 271 of file selection_manager.h.

Definition at line 238 of file selection_manager.h.

Definition at line 256 of file selection_manager.h.

Definition at line 269 of file selection_manager.h.

Definition at line 285 of file selection_manager.h.

Definition at line 255 of file selection_manager.h.

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

Definition at line 254 of file selection_manager.h.

Definition at line 252 of file selection_manager.h.

Definition at line 283 of file selection_manager.h.

Definition at line 263 of file selection_manager.h.

Definition at line 233 of file selection_manager.h.


The documentation for this class was generated from the following files:


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Tue Oct 3 2017 03:19:32