PCL Painter2D main class. Class for drawing 2D figures. More...
#include <pcl_painter2D.h>
Classes | |
struct | ExitMainLoopTimerCallback |
Public Member Functions | |
void | addArc (float x, float y, float r, float start_angle, float end_angle) |
Draw an arc based on the inputs. | |
void | addCircle (float x, float y, float r) |
Draw a circle based on the inputs. | |
void | addEllipse (float x, float y, float rx, float ry) |
Draw an ellipse 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 | 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 | addPolygon (std::vector< float > p) |
Draw a polygon between the specified points. | |
void | addQuad (std::vector< float > p) |
Draw a quadrilateral based on the given points. | |
void | addRect (float x, float y, float width, float height) |
Draw a rectangle based on the given points. | |
void | clearFigures () |
remove all the figures from the window | |
void | clearTransform () |
Clears all the transformation applied. Sets the transformation matrix to Identity. | |
void | display () |
displays all the figures added in a window. | |
double * | getBackgroundColor () |
set/get method for the viewport's background color. | |
vtkBrush * | getBrush () |
unsigned char * | getBrushColor () |
vtkPen * | getPen () |
unsigned char * | getPenColor () |
set/get methods for current working vtkPen | |
int | getPenType () |
float | getPenWidth () |
vtkMatrix3x3 * | getTransform () |
Returns the current transformation matrix. | |
int * | getWindowSize () |
set/get method for the window size. | |
virtual bool | Paint (vtkContext2D *painter) |
Paint event for the chart, called whenever the chart needs to be drawn. | |
PCLPainter2D (char const *name="PCLPainter2D") | |
Constructor of the class. | |
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 | 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. | |
void | setBrush (vtkBrush *brush) |
set/get methods for current working vtkBrush | |
void | setBrushColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
void | setPen (vtkPen *pen) |
void | setPenColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
set/get methods for current working vtkPen | |
void | setPenType (int type) |
void | setPenWidth (float w) |
void | setTransform (vtkMatrix3x3 *matrix) |
Create a translation matrix and concatenate it with the current transformation. | |
void | setWindowSize (int w, int h) |
set/get method for the window size. | |
void | spin () |
spins (runs the event loop) the interactor indefinitely. Same as display() - added to retain the similarity between other existing visualization classes | |
void | 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. | |
void | translatePen (double x, double y) |
Create a translation matrix and concatenate it with the current transformation. | |
vtkTypeRevisionMacro (PCLPainter2D, vtkContextItem) | |
Private Attributes | |
double | bkg_color_ [3] |
vtkBrush * | current_brush_ |
vtkPen * | current_pen_ |
vtkTransform2D * | current_transform_ |
vtkSmartPointer < ExitMainLoopTimerCallback > | exit_loop_timer_ |
Callback object enabling us to leave the main loop, when a timer fires. | |
std::vector< Figure2D * > | figures_ |
vtkContextView * | view_ |
int | win_height_ |
int | win_width_ |
PCL Painter2D main class. Class for drawing 2D figures.
Definition at line 200 of file pcl_painter2D.h.
pcl::visualization::PCLPainter2D::PCLPainter2D | ( | char const * | name = "PCLPainter2D" | ) |
Constructor of the class.
Definition at line 44 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addArc | ( | float | x, |
float | y, | ||
float | r, | ||
float | start_angle, | ||
float | end_angle | ||
) |
Draw an arc based on the inputs.
[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 |
Definition at line 154 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addCircle | ( | float | x, |
float | y, | ||
float | r | ||
) |
Draw a circle based on the inputs.
[in] | x | X coordinate of the origin |
[in] | y | Y coordinate of the origin |
[in] | r | radius of the circle |
Definition at line 140 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addEllipse | ( | float | x, |
float | y, | ||
float | rx, | ||
float | ry | ||
) |
Draw an ellipse based on the inputs.
[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 |
Definition at line 133 of file pcl_painter2D.cpp.
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.
[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 |
Definition at line 147 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draw a line between the specified points.
[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 |
Definition at line 67 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addLine | ( | std::vector< float > | p | ) |
Draw line(s) between the specified points.
[in] | p | a vector of size 2*n and the points are packed x1, y1, x2, y2 etc. |
Definition at line 81 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addPoint | ( | float | x, |
float | y | ||
) |
Draw specified point(s).
[in] | x | X coordinate of the point |
[in] | y | Y coordinate of the point |
Definition at line 88 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addPoints | ( | std::vector< float > | points | ) |
Draw specified point(s).
[in] | points | a vector of size 2*n and the points are packed x1, y1, x2, y2 etc. |
Definition at line 98 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addPolygon | ( | std::vector< float > | p | ) |
Draw a polygon between the specified points.
[in] | p | a vector of size 2*n and the points are packed x1, y1, x2, y2 etc. |
Definition at line 126 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addQuad | ( | std::vector< float > | p | ) |
Draw a quadrilateral based on the given points.
[in] | p | a vector of size 8 and the points are packed x1, y1, x2, y2, x3, y3 and x4, y4. |
Definition at line 119 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::addRect | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Draw a rectangle based on the given points.
[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 |
Definition at line 105 of file pcl_painter2D.cpp.
remove all the figures from the window
Definition at line 265 of file pcl_painter2D.cpp.
Clears all the transformation applied. Sets the transformation matrix to Identity.
Definition at line 258 of file pcl_painter2D.cpp.
displays all the figures added in a window.
Definition at line 273 of file pcl_painter2D.cpp.
double * pcl::visualization::PCLPainter2D::getBackgroundColor | ( | ) |
set/get method for the viewport's background color.
Definition at line 335 of file pcl_painter2D.cpp.
vtkBrush * pcl::visualization::PCLPainter2D::getBrush | ( | ) |
Definition at line 216 of file pcl_painter2D.cpp.
unsigned char * pcl::visualization::PCLPainter2D::getBrushColor | ( | ) |
Definition at line 196 of file pcl_painter2D.cpp.
vtkPen * pcl::visualization::PCLPainter2D::getPen | ( | ) |
Definition at line 206 of file pcl_painter2D.cpp.
unsigned char * pcl::visualization::PCLPainter2D::getPenColor | ( | ) |
set/get methods for current working vtkPen
Definition at line 176 of file pcl_painter2D.cpp.
Definition at line 186 of file pcl_painter2D.cpp.
Definition at line 181 of file pcl_painter2D.cpp.
vtkMatrix3x3 * pcl::visualization::PCLPainter2D::getTransform | ( | ) |
Returns the current transformation matrix.
Definition at line 251 of file pcl_painter2D.cpp.
set/get method for the window size.
Definition at line 354 of file pcl_painter2D.cpp.
bool pcl::visualization::PCLPainter2D::Paint | ( | vtkContext2D * | painter | ) | [virtual] |
Paint event for the chart, called whenever the chart needs to be drawn.
[in] | name | Name of the window |
Definition at line 364 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::rotatePen | ( | double | angle | ) |
Create a rotation matrix and concatenate it with the current transformation.
[in] | angle | angle in degrees |
Definition at line 230 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::scalePen | ( | double | x, |
double | y | ||
) |
Create a scale matrix and concatenate it with the current transformation.
[in] | x | translation along X axis |
[in] | y | translation along Y axis |
Definition at line 237 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setBackgroundColor | ( | const double | r, |
const double | g, | ||
const double | b | ||
) |
set/get method for the viewport's background color.
[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 |
Definition at line 317 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setBackgroundColor | ( | const double | color[3] | ) |
set/get method for the viewport's background color.
[in] | color | the array containing the 3 component of the RGB color |
Definition at line 326 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setBrush | ( | vtkBrush * | brush | ) |
set/get methods for current working vtkBrush
Definition at line 211 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setBrushColor | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a | ||
) |
Definition at line 191 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setPen | ( | vtkPen * | pen | ) |
Definition at line 201 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setPenColor | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a | ||
) |
set/get methods for current working vtkPen
Definition at line 161 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setPenType | ( | int | type | ) |
Definition at line 171 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setPenWidth | ( | float | w | ) |
Definition at line 166 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setTransform | ( | vtkMatrix3x3 * | matrix | ) |
Create a translation matrix and concatenate it with the current transformation.
[in] | x | translation along X axis |
[in] | y | translation along Y axis |
Definition at line 244 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::setWindowSize | ( | int | w, |
int | h | ||
) |
set/get method for the window size.
[in] | w | the width of the window |
[in] | h | the height of the window |
Definition at line 346 of file pcl_painter2D.cpp.
spins (runs the event loop) the interactor indefinitely. Same as display() - added to retain the similarity between other existing visualization classes
Definition at line 310 of file pcl_painter2D.cpp.
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.
[in] | spin_time | - How long (in ms) should the visualization loop be allowed to run. |
Definition at line 288 of file pcl_painter2D.cpp.
void pcl::visualization::PCLPainter2D::translatePen | ( | double | x, |
double | y | ||
) |
Create a translation matrix and concatenate it with the current transformation.
[in] | x | translation along X axis |
[in] | y | translation along Y axis |
Definition at line 223 of file pcl_painter2D.cpp.
pcl::visualization::PCLPainter2D::vtkTypeRevisionMacro | ( | PCLPainter2D | , |
vtkContextItem | |||
) |
double pcl::visualization::PCLPainter2D::bkg_color_[3] [private] |
Definition at line 429 of file pcl_painter2D.h.
vtkBrush* pcl::visualization::PCLPainter2D::current_brush_ [private] |
Definition at line 426 of file pcl_painter2D.h.
vtkPen* pcl::visualization::PCLPainter2D::current_pen_ [private] |
Definition at line 425 of file pcl_painter2D.h.
vtkTransform2D* pcl::visualization::PCLPainter2D::current_transform_ [private] |
Definition at line 427 of file pcl_painter2D.h.
vtkSmartPointer<ExitMainLoopTimerCallback> pcl::visualization::PCLPainter2D::exit_loop_timer_ [private] |
Callback object enabling us to leave the main loop, when a timer fires.
Definition at line 466 of file pcl_painter2D.h.
std::vector<Figure2D *> pcl::visualization::PCLPainter2D::figures_ [private] |
Definition at line 422 of file pcl_painter2D.h.
vtkContextView* pcl::visualization::PCLPainter2D::view_ [private] |
Definition at line 431 of file pcl_painter2D.h.
int pcl::visualization::PCLPainter2D::win_height_ [private] |
Definition at line 428 of file pcl_painter2D.h.
int pcl::visualization::PCLPainter2D::win_width_ [private] |
Definition at line 428 of file pcl_painter2D.h.