Point Cloud Library (PCL)  1.14.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:
+ Collaboration diagram for pcl::visualization::PCLPainter2D:

Public Member Functions

 PCLPainter2D (char const *name="PCLPainter2D")
 Constructor of the class. More...
 
 vtkTypeMacro (PCLPainter2D, vtkContextItem)
 
bool Paint (vtkContext2D *painter) override
 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 () const
 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 203 of file pcl_painter2D.h.

Constructor & Destructor Documentation

◆ PCLPainter2D()

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

Constructor of the class.

Member Function Documentation

◆ addArc()

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

◆ addCircle()

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

◆ addEllipse()

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

◆ addEllipticArc()

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

◆ addLine() [1/2]

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

◆ addLine() [2/2]

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.

◆ addPoint()

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

◆ addPoints()

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.

◆ addPolygon()

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.

◆ addQuad()

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.

◆ addRect()

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

◆ clearFigures()

void pcl::visualization::PCLPainter2D::clearFigures ( )

remove all the figures from the window

◆ clearTransform()

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

Clears all the transformation applied.

Sets the transformation matrix to Identity

◆ display()

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

displays all the figures added in a window.

◆ getBackgroundColor()

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

◆ getBrush()

vtkBrush* pcl::visualization::PCLPainter2D::getBrush ( )

◆ getBrushColor()

unsigned char* pcl::visualization::PCLPainter2D::getBrushColor ( )

◆ getPen()

vtkPen* pcl::visualization::PCLPainter2D::getPen ( )

◆ getPenColor()

unsigned char* pcl::visualization::PCLPainter2D::getPenColor ( )

set/get methods for current working vtkPen

◆ getPenType()

int pcl::visualization::PCLPainter2D::getPenType ( )

◆ getPenWidth()

float pcl::visualization::PCLPainter2D::getPenWidth ( )

◆ getTransform()

vtkMatrix3x3* pcl::visualization::PCLPainter2D::getTransform ( )

Returns the current transformation matrix.

◆ getWindowSize()

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

set/get method for the window size.

Returns
[in] array containing the width and height of the window

◆ Paint()

bool pcl::visualization::PCLPainter2D::Paint ( vtkContext2D *  painter)
override

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

Parameters
[in]painterName of the window

◆ rotatePen()

void pcl::visualization::PCLPainter2D::rotatePen ( double  angle)

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

Parameters
[in]angleangle in degrees

◆ scalePen()

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

◆ setBackgroundColor() [1/2]

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

◆ setBackgroundColor() [2/2]

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

◆ setBrush()

void pcl::visualization::PCLPainter2D::setBrush ( vtkBrush *  brush)

set/get methods for current working vtkBrush

◆ setBrushColor()

void pcl::visualization::PCLPainter2D::setBrushColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)

◆ setPen()

void pcl::visualization::PCLPainter2D::setPen ( vtkPen *  pen)

◆ setPenColor()

void pcl::visualization::PCLPainter2D::setPenColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)

set/get methods for current working vtkPen

◆ setPenType()

void pcl::visualization::PCLPainter2D::setPenType ( int  type)

◆ setPenWidth()

void pcl::visualization::PCLPainter2D::setPenWidth ( float  w)

◆ setTransform()

void pcl::visualization::PCLPainter2D::setTransform ( vtkMatrix3x3 *  matrix)

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

Parameters
[in]matrixthe transformation matrix

◆ setWindowSize()

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

◆ spin()

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

◆ spinOnce()

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.

◆ translatePen()

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

◆ vtkTypeMacro()

pcl::visualization::PCLPainter2D::vtkTypeMacro ( PCLPainter2D  ,
vtkContextItem   
)

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