pcl::visualization::PCLPainter2D Class Reference
Module visualization

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] | 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 | ( | 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::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::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] | painter | 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 | 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::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::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] | matrix | the transformation matrix

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::vtkTypeMacro | ( | PCLPainter2D | ,
|  | vtkContextItem |
| ) |  |

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

- /build/pcl-0nnAvv/pcl-1.7.2/visualization/include/pcl/visualization/pcl_painter2D.h