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


Member Typedef Documentation

Definition at line 234 of file selection_manager.h.

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

Definition at line 284 of file selection_manager.h.


Member Enumeration Documentation

Enumerator:
Add 
Remove 
Replace 

Definition at line 81 of file selection_manager.h.


Constructor & Destructor Documentation

Definition at line 75 of file selection_manager.cpp.

Definition at line 94 of file selection_manager.cpp.


Member Function Documentation

Definition at line 445 of file selection_manager.cpp.

std::pair< Picked, bool > rviz::SelectionManager::addSelectedObject ( const Picked obj) [private]

Definition at line 1162 of file selection_manager.cpp.

Definition at line 1133 of file selection_manager.cpp.

Definition at line 402 of file selection_manager.cpp.

Definition at line 423 of file selection_manager.cpp.

Definition at line 409 of file selection_manager.cpp.

Definition at line 1225 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 242 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 173 of file selection_manager.cpp.

Definition at line 1106 of file selection_manager.cpp.

Definition at line 142 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 191 of file selection_manager.cpp.

Definition at line 199 of file selection_manager.h.

Definition at line 117 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 988 of file selection_manager.cpp.

Ogre::ColourValue rviz::SelectionManager::handleToColor ( CollObjectHandle  handle) [static]

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

Definition at line 119 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 821 of file selection_manager.cpp.

void rviz::SelectionManager::publishDebugImage ( const Ogre::PixelBox &  pixel_box,
const std::string &  label 
) [private]

Definition at line 753 of file selection_manager.cpp.

Definition at line 518 of file selection_manager.cpp.

Definition at line 465 of file selection_manager.cpp.

void rviz::SelectionManager::removeSelectedObject ( const Picked obj) [private]

Definition at line 1201 of file selection_manager.cpp.

Definition at line 1119 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 604 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 586 of file selection_manager.cpp.

void rviz::SelectionManager::renderQueueStarted ( uint8_t  queueGroupId,
const std::string &  invocation,
bool &  skipThisInvocation 
)

Definition at line 810 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) [private]

Definition at line 1280 of file selection_manager.cpp.

void rviz::SelectionManager::selectionRemoved ( const M_Picked removed) [private]

Definition at line 1266 of file selection_manager.cpp.

Enables or disables publishing of picking and depth rendering images.

Definition at line 114 of file selection_manager.cpp.

void rviz::SelectionManager::setDepthTextureSize ( unsigned  width,
unsigned  height 
) [private]

Definition at line 315 of file selection_manager.cpp.

void rviz::SelectionManager::setHighlightRect ( Ogre::Viewport *  viewport,
int  x1,
int  y1,
int  x2,
int  y2 
) [private]

Definition at line 549 of file selection_manager.cpp.

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

Definition at line 123 of file selection_manager.h.

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

Definition at line 124 of file selection_manager.h.

void rviz::SelectionManager::setPickData ( CollObjectHandle  handle,
const Ogre::ColourValue &  color,
Ogre::SceneNode *  node 
) [static]

Definition at line 1061 of file selection_manager.cpp.

void rviz::SelectionManager::setPickData ( CollObjectHandle  handle,
const Ogre::ColourValue &  color,
Ogre::MovableObject *  object 
) [static]

Definition at line 1099 of file selection_manager.cpp.

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

Definition at line 125 of file selection_manager.h.

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

Definition at line 126 of file selection_manager.h.

Definition at line 1152 of file selection_manager.cpp.

void rviz::SelectionManager::setTextureSize ( unsigned  size)

Definition at line 361 of file selection_manager.cpp.

void rviz::SelectionManager::unpackColors ( const Ogre::PixelBox &  box,
V_CollObject pixels 
) [private]

Definition at line 564 of file selection_manager.cpp.

Definition at line 486 of file selection_manager.cpp.

void rviz::SelectionManager::updateProperties ( ) [private, slot]

Call updateProperties() on all SelectionHandlers in the current selection.

Definition at line 1295 of file selection_manager.cpp.


Member Data Documentation

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

Definition at line 264 of file selection_manager.h.

Definition at line 270 of file selection_manager.h.

Definition at line 285 of file selection_manager.h.

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

Definition at line 258 of file selection_manager.h.

Definition at line 256 of file selection_manager.h.

Definition at line 257 of file selection_manager.h.

Definition at line 257 of file selection_manager.h.

Definition at line 277 of file selection_manager.h.

Definition at line 274 of file selection_manager.h.

Definition at line 278 of file selection_manager.h.

Definition at line 275 of file selection_manager.h.

Definition at line 276 of file selection_manager.h.

Definition at line 272 of file selection_manager.h.

Definition at line 273 of file selection_manager.h.

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

Definition at line 232 of file selection_manager.h.

Definition at line 247 of file selection_manager.h.

Definition at line 237 of file selection_manager.h.

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

Definition at line 263 of file selection_manager.h.

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

Definition at line 262 of file selection_manager.h.

Definition at line 268 of file selection_manager.h.

Definition at line 235 of file selection_manager.h.

Definition at line 253 of file selection_manager.h.

Definition at line 266 of file selection_manager.h.

Definition at line 282 of file selection_manager.h.

Definition at line 252 of file selection_manager.h.

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

Definition at line 251 of file selection_manager.h.

Definition at line 249 of file selection_manager.h.

Definition at line 280 of file selection_manager.h.

Definition at line 260 of file selection_manager.h.

Definition at line 230 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 Mon Oct 6 2014 07:26:37