Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef PCL_VISUALIZATION_PCL_CONTEXT_ITEM_H_
00039 #define PCL_VISUALIZATION_PCL_CONTEXT_ITEM_H_
00040
00041 #include <pcl/pcl_macros.h>
00042 #include <vtkContextItem.h>
00043 #include <vector>
00044
00045 template <typename T> class vtkSmartPointer;
00046 class vtkImageData;
00047 class vtkContext2D;
00048
00049 namespace pcl
00050 {
00051 namespace visualization
00052 {
00058 struct PCL_EXPORTS PCLContextItem : public vtkContextItem
00059 {
00060 vtkTypeMacro (PCLContextItem, vtkContextItem);
00061 static PCLContextItem *New();
00062 virtual bool Paint (vtkContext2D *) { return (false); };
00063 void setColors (unsigned char r, unsigned char g, unsigned char b);
00064 void setColors (unsigned char rgb[3]) { memcpy (colors, rgb, 3 * sizeof (unsigned char)); }
00065 void setOpacity (double opacity) { SetOpacity (opacity); };
00066 unsigned char colors[3];
00067 double opacity;
00068 std::vector<float> params;
00069 };
00070
00076 struct PCL_EXPORTS PCLContextImageItem : public vtkContextItem
00077 {
00078 vtkTypeMacro (PCLContextImageItem, vtkContextItem);
00079 PCLContextImageItem ();
00080
00081 static PCLContextImageItem *New ();
00082 virtual bool Paint (vtkContext2D *painter);
00083 void set (float _x, float _y, vtkImageData *_image);
00084 vtkSmartPointer<vtkImageData> image;
00085 float x, y;
00086 };
00087
00088 namespace context_items
00089 {
00090 struct PCL_EXPORTS Point : public PCLContextItem
00091 {
00092 vtkTypeMacro (Point, PCLContextItem);
00093 static Point *New();
00094 virtual bool Paint (vtkContext2D *painter);
00095 virtual void set (float _x, float _y);
00096 };
00097
00098 struct PCL_EXPORTS Line : public PCLContextItem
00099 {
00100 vtkTypeMacro (Line, PCLContextItem);
00101 static Line *New();
00102 virtual bool Paint (vtkContext2D *painter);
00103 virtual void set (float _x_1, float _y_1, float _x_2, float _y_2);
00104 };
00105
00106 struct PCL_EXPORTS Circle : public PCLContextItem
00107 {
00108 vtkTypeMacro (Circle, PCLContextItem);
00109 static Circle *New();
00110 virtual bool Paint (vtkContext2D *painter);
00111 virtual void set (float _x, float _y, float _r);
00112 };
00113
00114 struct PCL_EXPORTS Disk : public Circle
00115 {
00116 vtkTypeMacro (Disk, Circle);
00117 static Disk *New();
00118 virtual bool Paint (vtkContext2D *painter);
00119 };
00120
00121 struct PCL_EXPORTS Rectangle : public PCLContextItem
00122 {
00123 vtkTypeMacro (Rectangle, Point);
00124 static Rectangle *New();
00125 virtual bool Paint (vtkContext2D *painter);
00126 virtual void set (float _x, float _y, float _w, float _h);
00127 };
00128
00129 struct PCL_EXPORTS FilledRectangle : public Rectangle
00130 {
00131 vtkTypeMacro (FilledRectangle, Rectangle);
00132 static FilledRectangle *New();
00133 virtual bool Paint (vtkContext2D *painter);
00134 };
00135
00136 struct PCL_EXPORTS Points : public PCLContextItem
00137 {
00138 vtkTypeMacro (Points, PCLContextItem);
00139 static Points *New();
00140 virtual bool Paint (vtkContext2D *painter);
00141 void set (const std::vector<float>& _xy) { params = _xy; }
00142 };
00143
00144 struct PCL_EXPORTS Polygon : public Points
00145 {
00146 vtkTypeMacro (Polygon, Points);
00147 static Polygon *New();
00148 virtual bool Paint (vtkContext2D *painter);
00149 };
00150 }
00151 }
00152 }
00153
00154 #endif