RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
RenderPointCloud Class Reference

Render a point cloud. More...

#include <RenderPointCloud.hpp>

Inherits Render.

Public Types

typedef rw::core::Ptr< RenderPointCloudPtr
 smart pointer type to this class
 
- Public Types inherited from Render
typedef rw::core::Ptr< RenderPtr
 smart pointer type to this class
 
typedef DrawableNode::DrawType DrawType
 when calling render on the draw mode or type can be specified. See DrawableNode::DrawType
 

Public Member Functions

 RenderPointCloud ()
 Constructs RenderPointCloud with no points.
 
 RenderPointCloud (const std::vector< rw::math::Vector3D< float >> &points)
 Construct RenderPointCloud adding the points specified. More...
 
virtual ~RenderPointCloud ()
 Descructor.
 
void addPoint (const rw::math::Vector3D< float > &p)
 Adds a single line to the drawable. More...
 
void addPoint (const rw::math::Vector3D< double > &p)
 Adds a single line to the drawable.
 
void addPoints (const std::vector< rw::math::Vector3D< float >> &points)
 Adds a collection of points. More...
 
void addPoints (const std::vector< rw::math::Vector3D< double >> &points)
 Adds a collection of points. More...
 
void setColor (float r, float g, float b, float alpha)
 Sets the color of the points. More...
 
void setPointSize (float size)
 Sets point size. More...
 
void clear ()
 Clears all points. More...
 
void draw (const rw::graphics::DrawableNode::RenderInfo &info, rw::graphics::DrawableNode::DrawType type, double alpha) const
 
void rerender ()
 Rerender the scene into the display list. This method need to be called after all points has been added.
 
- Public Member Functions inherited from Render
virtual ~Render ()
 destructor
 

Additional Inherited Members

- Protected Member Functions inherited from Render
 Render ()
 Only instances of classes inheriting Render is allowed.
 

Detailed Description

Render a point cloud.

Constructor & Destructor Documentation

◆ RenderPointCloud()

RenderPointCloud ( const std::vector< rw::math::Vector3D< float >> &  points)

Construct RenderPointCloud adding the points specified.

Parameters
points[in] Points to draw

Member Function Documentation

◆ addPoint()

void addPoint ( const rw::math::Vector3D< float > &  p)

Adds a single line to the drawable.

Note
Each call to addLine generates an update of the display list. Use addLines to add multiple lines with only one update.
Parameters
p[in] point to add

◆ addPoints() [1/2]

void addPoints ( const std::vector< rw::math::Vector3D< double >> &  points)

Adds a collection of points.

Parameters
points

◆ addPoints() [2/2]

void addPoints ( const std::vector< rw::math::Vector3D< float >> &  points)

Adds a collection of points.

After all points are added, the display list will be updated

Parameters
points[in] List of points

◆ clear()

void clear ( )

Clears all points.

When clearing the points a new display list without points will be generated.

◆ draw()

void draw ( const rw::graphics::DrawableNode::RenderInfo info,
rw::graphics::DrawableNode::DrawType  type,
double  alpha 
) const
virtual

Parameters
info[in] state and rendering specific info
type[in] the drawtype which is being used
alpha[in] the alpha value to render with

Implements Render.

◆ setColor()

void setColor ( float  r,
float  g,
float  b,
float  alpha 
)

Sets the color of the points.

The influence of the alpha value depends on how opengl is configured. Calling setColor triggers an update of the display list

Parameters
r[in] red [0;1]
g[in] green [0;1]
b[in] blue [0;1]
alpha[in] alpha [0;1]

◆ setPointSize()

void setPointSize ( float  size)

Sets point size.

The thickness is forwarded to glPointSize. Default 2.0. Calling setPointSize triggers an update of the display list

Parameters
size[in] Point size

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