Point Cloud Library (PCL)  1.8.1-dev
List of all members | Classes | Public Member Functions
pcl::visualization::PCLPainter2D Class Reference

PCL Painter2D main class. More...

#include <pcl/visualization/pcl_painter2D.h>

+ Inheritance diagram for pcl::visualization::PCLPainter2D:

Public Member Functions

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

Detailed Description

PCL Painter2D main class.

Class for drawing 2D figures

Author
Kripasindhu Sarkar

Definition at line 199 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]xX coordinate of the origin
[in]yY coordinate of the origin
[in]rradius of the circle
[in]start_anglethe starting angle of the arc expressed in degrees
[in]end_anglethe 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]xX coordinate of the origin
[in]yY coordinate of the origin
[in]rradius 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]xX coordinate of the origin
[in]yY coordinate of the origin
[in]rxX radius of the ellipse
[in]ryY 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]xX coordinate of the origin
[in]yY coordinate of the origin
[in]rxX radius of the ellipse
[in]ryY radius of the ellipse
[in]start_anglethe starting angle of the arc expressed in degrees
[in]end_anglethe ending angle of the arc expressed in degrees
void pcl::visualization::PCLPainter2D::addLine ( float  x1,
float  y1,
float  x2,
float  y2 
)

Draw a line between the specified points.

Parameters
[in]x1X coordinate of the starting point of the line
[in]y1Y coordinate of the starting point of the line
[in]x2X coordinate of the ending point of the line
[in]y2Y coordinate of the ending point of the line
void pcl::visualization::PCLPainter2D::addLine ( std::vector< float >  p)

Draw line(s) between the specified points.

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

Draw specified point(s).

Parameters
[in]xX coordinate of the point
[in]yY coordinate of the point
void pcl::visualization::PCLPainter2D::addPoints ( std::vector< float >  points)

Draw specified point(s).

Parameters
[in]pointsa 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]pa 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]pa 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]xX coordinate of the origin
[in]yY coordinate of the origin
[in]widthwidth of the rectangle
[in]heightheight 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]painterName of the window
void pcl::visualization::PCLPainter2D::rotatePen ( double  angle)

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

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

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

Parameters
[in]xtranslation along X axis
[in]ytranslation along Y axis
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]rthe red component of the RGB color
[in]gthe green component of the RGB color
[in]bthe blue component of the RGB color
void pcl::visualization::PCLPainter2D::setBackgroundColor ( const double  color[3])

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

Parameters
[in]colorthe array containing the 3 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]matrixthe transformation matrix
void pcl::visualization::PCLPainter2D::setWindowSize ( int  w,
int  h 
)

set/get method for the window size.

Parameters
[in]wthe width of the window
[in]hthe 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]xtranslation along X axis
[in]ytranslation along Y axis
pcl::visualization::PCLPainter2D::vtkTypeMacro ( PCLPainter2D  ,
vtkContextItem   
)

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