iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::graphics::PointCloud Class Reference

#include <nrt/Graphics/Shapes.H>

A point cloud.

Examples:
tests/test-PointCloud2OpenNI.C.

Definition at line 414 of file Shapes.H.

Inheritance diagram for nrt::graphics::PointCloud:
nrt::graphics::Shape

Public Types

enum  DisplayType { Point, Sprite, Billboard, Cube }
 The type of primitive to draw for each point. More...
 

Public Member Functions

 PointCloud (nrt::PointCloud2 const &pointcloud_=nrt::PointCloud2(), float const pointsize_=1.0F, Eigen::Affine3f const &frame_=Eigen::Affine3f::Identity(), nrt::Duration const &lifetime_=nrt::forev(), nrt::graphics::Pen const &pen_=nrt::graphics::Pen(), nrt::graphics::Brush const &brush_=nrt::graphics::Brush(), bool const useVBO=true, DisplayType displayType=Point)
 Constructor. More...
 
virtual ~PointCloud ()
 Virtual destructor for safe inheritance.
 
virtual void render (nrt::graphics::ShapeRenderer &sr) const
 Render this shape into a ShapeRenderer (e.g., OpenGL window).
 
void setPointSize (float pointsize)
 Set the point size.
 
void setUseVBO (bool useVBO)
 Set whether or not to use Vertex Buffer Objects. More...
 
void setDisplayType (DisplayType displayType)
 Set the display type to use.
 
template<class Archive >
void serialize (Archive &ar)
 Serialization.
 
- Public Member Functions inherited from nrt::graphics::Shape
 Shape (Eigen::Affine3f const &frame_=Eigen::Affine3f::Identity(), nrt::Duration const &lifetime_=nrt::forev(), nrt::graphics::Pen const &pen_=nrt::graphics::Pen(), nrt::graphics::Brush const &brush_=nrt::graphics::Brush())
 Constructor using a lifetime duration.
 
 Shape (Eigen::Affine3f const &frame_, nrt::Time const &endtime_, nrt::graphics::Pen const &pen_=nrt::graphics::Pen(), nrt::graphics::Brush const &brush_=nrt::graphics::Brush())
 Constructor using an end-of-life time point.
 
virtual ~Shape ()
 Virtual destructor for safe inheritance.
 
bool expired () const
 Returns true if this shape is past its lifetime.
 
template<class Archive >
void serialize (Archive &ar)
 Serialization.
 

Protected Attributes

nrt::PointCloud2 pointcloud
 
float pointsize
 
bool useVBO
 
DisplayType displayType
 
- Protected Attributes inherited from nrt::graphics::Shape
Eigen::Affine3f frame
 Coordinate frame of this shape.
 
nrt::Time endtime
 Time after which this shape should be discarded.
 
nrt::graphics::Pen pen
 Pen to use to draw edges.
 
nrt::graphics::Brush brush
 Brush to use to draw surfaces.
 

Additional Inherited Members

- Protected Member Functions inherited from nrt::graphics::Shape
bool prerender (nrt::graphics::ShapeRenderer &sr) const
 Set frame, pen, brush, etc, return false if dead.
 
void postrender (nrt::graphics::ShapeRenderer &sr) const
 End rendering of a given shape.
 

Member Enumeration Documentation

The type of primitive to draw for each point.

Enumerator
Point 

A simple round point. Points will always be drawn the same size on the screen, regardless of the camera view.

Sprite 

A simple square point. Sprites will always be drawn the same size on the screen, regardless of the camera view.

Billboard 

A square point which always faces the camera. Billboards will get smaller as the camera moves further away.

Cube 

A 3D cube aligned to the global coordinate frame.

Definition at line 418 of file Shapes.H.

Constructor & Destructor Documentation

nrt::graphics::PointCloud::PointCloud ( nrt::PointCloud2 const &  pointcloud_ = nrt::PointCloud2(),
float const  pointsize_ = 1.0F,
Eigen::Affine3f const &  frame_ = Eigen::Affine3f::Identity(),
nrt::Duration const &  lifetime_ = nrt::forev(),
nrt::graphics::Pen const &  pen_ = nrt::graphics::Pen(),
nrt::graphics::Brush const &  brush_ = nrt::graphics::Brush(),
bool const  useVBO = true,
DisplayType  displayType = Point 
)

Constructor.

Parameters
pointcloud_The PointCloud to display
pointsize_The size of the points. If displayType is Point or Sprite, then pointsize_ will be in pixels. Otherwise, pointsize_ will be interpreted as meters.
frame_The frame in which to render the points.
lifetime_The lifetime of the graphics object.
pen_The pen to use when rendering the points.
brush_The brush to use when rendering the points.
useVBOIf set to true, then the points will be rendered using the more efficient Vertex Buffer Objects. Otherwise, the points will be rendered in immediate mode.
displayTypeThe type of primitive to draw for each point. See nrt::graphics::PointCloud::DisplayType for details.

Member Function Documentation

void nrt::graphics::PointCloud::setUseVBO ( bool  useVBO)

Set whether or not to use Vertex Buffer Objects.

Vertex buffer objects are more efficient, but may not be available on older versions of OpenGL.


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