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 #ifndef opengl_CGridPlaneXY_H
00030 #define opengl_CGridPlaneXY_H
00031
00032 #include <mrpt/opengl/CRenderizableDisplayList.h>
00033
00034 namespace mrpt
00035 {
00036 namespace opengl
00037 {
00038 class OPENGL_IMPEXP CGridPlaneXY;
00039
00040
00041 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CGridPlaneXY , CRenderizableDisplayList, OPENGL_IMPEXP )
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 class OPENGL_IMPEXP CGridPlaneXY : public CRenderizableDisplayList
00055 {
00056 DEFINE_SERIALIZABLE( CGridPlaneXY )
00057
00058 protected:
00059 float m_xMin, m_xMax;
00060 float m_yMin, m_yMax;
00061 float m_plane_z;
00062 float m_frequency;
00063
00064
00065 public:
00066 void setPlaneLimits(float xmin,float xmax, float ymin, float ymax)
00067 {
00068 m_xMin=xmin; m_xMax = xmax;
00069 m_yMin=ymin; m_yMax = ymax;
00070 CRenderizableDisplayList::notifyChange();
00071 }
00072
00073 void getPlaneLimits(float &xmin,float &xmax, float &ymin, float &ymax) const
00074 {
00075 xmin=m_xMin; xmax=m_xMax;
00076 ymin=m_yMin; ymax=m_yMax;
00077 }
00078
00079 void setPlaneZcoord(float z) { CRenderizableDisplayList::notifyChange(); m_plane_z=z; }
00080 float getPlaneZcoord() const { return m_plane_z; }
00081
00082 void setGridFrequency(float freq) { ASSERT_(freq>0); m_frequency=freq; CRenderizableDisplayList::notifyChange(); }
00083 float getGridFrequency() const { return m_frequency; }
00084
00085
00086
00087 virtual void render_dl() const;
00088
00089
00090 static CGridPlaneXYPtr Create(
00091 float xMin,
00092 float xMax,
00093 float yMin,
00094 float yMax,
00095 float z = 0,
00096 float frequency = 1 )
00097 {
00098 return CGridPlaneXYPtr( new CGridPlaneXY(
00099 xMin,
00100 xMax,
00101 yMin,
00102 yMax,
00103 z,
00104 frequency ) );
00105 }
00106
00107
00108 private:
00109
00110
00111 CGridPlaneXY(
00112 float xMin = -10,
00113 float xMax = 10 ,
00114 float yMin = -10,
00115 float yMax = 10,
00116 float z = 0,
00117 float frequency = 1
00118 ) :
00119 m_xMin(xMin),
00120 m_xMax(xMax),
00121 m_yMin(yMin),
00122 m_yMax(yMax),
00123 m_plane_z(z),
00124 m_frequency(frequency)
00125 {
00126 }
00127
00128 virtual ~CGridPlaneXY() { }
00129 };
00130
00131 }
00132
00133 }
00134
00135
00136 #endif