pcl::visualization::PCLPainter2D Class Reference
[Module visualization]

PCL Painter2D main class. More...

#include <pcl/visualization/pcl_painter2D.h>

List of all members.

Classes

struct  ExitMainLoopTimerCallback

Public Member Functions

 PCLPainter2D (char const *name="PCLPainter2D")
 Constructor of the class.
 vtkTypeRevisionMacro (PCLPainter2D, vtkContextItem)
virtual bool Paint (vtkContext2D *painter)
 Paint event for the chart, called whenever the chart needs to be drawn.
void addLine (float x1, float y1, float x2, float y2)
 Draw a line between the specified points.
void addLine (std::vector< float > p)
 Draw line(s) between the specified points.
void addPoint (float x, float y)
 Draw specified point(s).
void addPoints (std::vector< float > points)
 Draw specified point(s).
void addRect (float x, float y, float width, float height)
 Draw a rectangle based on the given points.
void addQuad (std::vector< float > p)
 Draw a quadrilateral based on the given points.
void addPolygon (std::vector< float > p)
 Draw a polygon between the specified points.
void addEllipse (float x, float y, float rx, float ry)
 Draw an ellipse based on the inputs.
void addCircle (float x, float y, float r)
 Draw a circle based on the inputs.
void addEllipticArc (float x, float y, float rx, float ry, float start_angle, float end_angle)
 Draw an elliptic arc based on the inputs.
void addArc (float x, float y, float r, float start_angle, float end_angle)
 Draw an arc based on the inputs.
void translatePen (double x, double y)
 Create a translation matrix and concatenate it with the current transformation.
void rotatePen (double angle)
 Create a rotation matrix and concatenate it with the current transformation.
void scalePen (double x, double y)
 Create a scale matrix and concatenate it with the current transformation.
void setTransform (vtkMatrix3x3 *matrix)
 Create a translation matrix and concatenate it with the current transformation.
vtkMatrix3x3 * getTransform ()
 Returns the current transformation matrix.
void clearTransform ()
 Clears all the transformation applied.
void clearFigures ()
 remove all the figures from the window
void setPenColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 set/get methods for current working vtkPen
void setPenWidth (float w)
void setPenType (int type)
unsigned char * getPenColor ()
 set/get methods for current working vtkPen
float getPenWidth ()
int getPenType ()
void setPen (vtkPen *pen)
vtkPen * getPen ()
void setBrush (vtkBrush *brush)
 set/get methods for current working vtkBrush
vtkBrush * getBrush ()
void setBrushColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
unsigned char * getBrushColor ()
void setBackgroundColor (const double r, const double g, const double b)
 set/get method for the viewport's background color.
void setBackgroundColor (const double color[3])
 set/get method for the viewport's background color.
double * getBackgroundColor ()
 set/get method for the viewport's background color.
void setWindowSize (int w, int h)
 set/get method for the window size.
int * getWindowSize ()
 set/get method for the window size.
void display ()
 displays all the figures added in a window.
void spinOnce (const int spin_time=0)
 spins (runs the event loop) the interactor for spin_time amount of time.
void spin ()
 spins (runs the event loop) the interactor indefinitely.

Detailed Description

PCL Painter2D main class.

Class for drawing 2D figures

Author:
Kripasindhu Sarkar

Definition at line 200 of file pcl_painter2D.h.


Constructor & Destructor Documentation

pcl::visualization::PCLPainter2D::PCLPainter2D ( char const *  name = "PCLPainter2D"  ) 

Constructor of the class.


Member Function Documentation

void pcl::visualization::PCLPainter2D::addArc ( float  x,
float  y,
float  r,
float  start_angle,
float  end_angle 
)

Draw an arc based on the inputs.

Parameters:
[in] x X coordinate of the origin
[in] y Y coordinate of the origin
[in] r radius of the circle
[in] start_angle the starting angle of the arc expressed in degrees
[in] end_angle the ending angle of the arc expressed in degrees
void pcl::visualization::PCLPainter2D::addCircle ( float  x,
float  y,
float  r 
)

Draw a circle based on the inputs.

Parameters:
[in] x X coordinate of the origin
[in] y Y coordinate of the origin
[in] r radius of the circle
void pcl::visualization::PCLPainter2D::addEllipse ( float  x,
float  y,
float  rx,
float  ry 
)

Draw an ellipse based on the inputs.

Parameters:
[in] x X coordinate of the origin
[in] y Y coordinate of the origin
[in] rx X radius of the ellipse
[in] ry Y radius of the ellipse
void pcl::visualization::PCLPainter2D::addEllipticArc ( float  x,
float  y,
float  rx,
float  ry,
float  start_angle,
float  end_angle 
)

Draw an elliptic arc based on the inputs.

Parameters:
[in] x X coordinate of the origin
[in] y Y coordinate of the origin
[in] rx X radius of the ellipse
[in] ry Y radius of the ellipse
[in] start_angle the starting angle of the arc expressed in degrees
[in] end_angle the ending angle of the arc expressed in degrees
void pcl::visualization::PCLPainter2D::addLine ( std::vector< float >  p  ) 

Draw line(s) between the specified points.

Parameters:
[in] p a vector of size 2*n and the points are packed x1, y1, x2, y2 etc.
void pcl::visualization::PCLPainter2D::addLine ( float  x1,
float  y1,
float  x2,
float  y2 
)

Draw a line between the specified points.

Parameters:
[in] x1 X coordinate of the starting point of the line
[in] y1 Y coordinate of the starting point of the line
[in] x2 X coordinate of the ending point of the line
[in] y2 Y coordinate of the ending point of the line
void pcl::visualization::PCLPainter2D::addPoint ( float  x,
float  y 
)

Draw specified point(s).

Parameters:
[in] x X coordinate of the point
[in] y Y coordinate of the point
void pcl::visualization::PCLPainter2D::addPoints ( std::vector< float >  points  ) 

Draw specified point(s).

Parameters:
[in] points a vector of size 2*n and the points are packed x1, y1, x2, y2 etc.
void pcl::visualization::PCLPainter2D::addPolygon ( std::vector< float >  p  ) 

Draw a polygon between the specified points.

Parameters:
[in] p a vector of size 2*n and the points are packed x1, y1, x2, y2 etc.
void pcl::visualization::PCLPainter2D::addQuad ( std::vector< float >  p  ) 

Draw a quadrilateral based on the given points.

Parameters:
[in] p a vector of size 8 and the points are packed x1, y1, x2, y2, x3, y3 and x4, y4.
void pcl::visualization::PCLPainter2D::addRect ( float  x,
float  y,
float  width,
float  height 
)

Draw a rectangle based on the given points.

Parameters:
[in] x X coordinate of the origin
[in] y Y coordinate of the origin
[in] width width of the rectangle
[in] height height of the rectangle
void pcl::visualization::PCLPainter2D::clearFigures (  ) 

remove all the figures from the window

void pcl::visualization::PCLPainter2D::clearTransform (  ) 

Clears all the transformation applied.

Sets the transformation matrix to Identity

void pcl::visualization::PCLPainter2D::display (  ) 

displays all the figures added in a window.

double* pcl::visualization::PCLPainter2D::getBackgroundColor (  ) 

set/get method for the viewport's background color.

Returns:
[out] color the array containing the 3 component of the RGB color
vtkBrush* pcl::visualization::PCLPainter2D::getBrush (  ) 
unsigned char* pcl::visualization::PCLPainter2D::getBrushColor (  ) 
vtkPen* pcl::visualization::PCLPainter2D::getPen (  ) 
unsigned char* pcl::visualization::PCLPainter2D::getPenColor (  ) 

set/get methods for current working vtkPen

int pcl::visualization::PCLPainter2D::getPenType (  ) 
float pcl::visualization::PCLPainter2D::getPenWidth (  ) 
vtkMatrix3x3* pcl::visualization::PCLPainter2D::getTransform (  ) 

Returns the current transformation matrix.

int* pcl::visualization::PCLPainter2D::getWindowSize (  ) 

set/get method for the window size.

Returns:
[in] array containing the width and height of the window
virtual bool pcl::visualization::PCLPainter2D::Paint ( vtkContext2D *  painter  )  [virtual]

Paint event for the chart, called whenever the chart needs to be drawn.

Parameters:
[in] name Name of the window
void pcl::visualization::PCLPainter2D::rotatePen ( double  angle  ) 

Create a rotation matrix and concatenate it with the current transformation.

Parameters:
[in] angle angle in degrees
void pcl::visualization::PCLPainter2D::scalePen ( double  x,
double  y 
)

Create a scale matrix and concatenate it with the current transformation.

Parameters:
[in] x translation along X axis
[in] y translation along Y axis
void pcl::visualization::PCLPainter2D::setBackgroundColor ( const double  color[3]  ) 

set/get method for the viewport's background color.

Parameters:
[in] color the array containing the 3 component of the RGB color
void pcl::visualization::PCLPainter2D::setBackgroundColor ( const double  r,
const double  g,
const double  b 
)

set/get method for the viewport's background color.

Parameters:
[in] r the red component of the RGB color
[in] g the green component of the RGB color
[in] b the blue component of the RGB color
void pcl::visualization::PCLPainter2D::setBrush ( vtkBrush *  brush  ) 

set/get methods for current working vtkBrush

void pcl::visualization::PCLPainter2D::setBrushColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)
void pcl::visualization::PCLPainter2D::setPen ( vtkPen *  pen  ) 
void pcl::visualization::PCLPainter2D::setPenColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)

set/get methods for current working vtkPen

void pcl::visualization::PCLPainter2D::setPenType ( int  type  ) 
void pcl::visualization::PCLPainter2D::setPenWidth ( float  w  ) 
void pcl::visualization::PCLPainter2D::setTransform ( vtkMatrix3x3 *  matrix  ) 

Create a translation matrix and concatenate it with the current transformation.

Parameters:
[in] x translation along X axis
[in] y translation along Y axis
void pcl::visualization::PCLPainter2D::setWindowSize ( int  w,
int  h 
)

set/get method for the window size.

Parameters:
[in] w the width of the window
[in] h the height of the window
void pcl::visualization::PCLPainter2D::spin (  ) 

spins (runs the event loop) the interactor indefinitely.

Same as display() - added to retain the similarity between other existing visualization classes

void pcl::visualization::PCLPainter2D::spinOnce ( const int  spin_time = 0  ) 

spins (runs the event loop) the interactor for spin_time amount of time.

The name is confusing and will be probably obsolete in the future release with a single overloaded spin()/display() function.

Parameters:
[in] spin_time - How long (in ms) should the visualization loop be allowed to run.
void pcl::visualization::PCLPainter2D::translatePen ( double  x,
double  y 
)

Create a translation matrix and concatenate it with the current transformation.

Parameters:
[in] x translation along X axis
[in] y translation along Y axis
pcl::visualization::PCLPainter2D::vtkTypeRevisionMacro ( PCLPainter2D  ,
vtkContextItem   
)

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends