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