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_CGridPlaneXZ_H
00030 #define opengl_CGridPlaneXZ_H
00031
00032 #include <mrpt/opengl/CRenderizableDisplayList.h>
00033
00034 namespace mrpt
00035 {
00036 namespace opengl
00037 {
00038 class OPENGL_IMPEXP CGridPlaneXZ;
00039
00040
00041 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CGridPlaneXZ, CRenderizableDisplayList, OPENGL_IMPEXP )
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 class OPENGL_IMPEXP CGridPlaneXZ : public CRenderizableDisplayList
00054 {
00055 DEFINE_SERIALIZABLE( CGridPlaneXZ )
00056
00057 protected:
00058 float m_xMin, m_xMax;
00059 float m_zMin, m_zMax;
00060 float m_plane_y;
00061 float m_frequency;
00062
00063 public:
00064
00065 void setPlaneLimits(float xmin,float xmax, float zmin, float zmax)
00066 {
00067 m_xMin=xmin; m_xMax = xmax;
00068 m_zMin=zmin; m_zMax = zmax;
00069 CRenderizableDisplayList::notifyChange();
00070 }
00071
00072 void getPlaneLimits(float &xmin,float &xmax, float &zmin, float &zmax) const
00073 {
00074 xmin=m_xMin; xmax=m_xMax;
00075 zmin=m_zMin; zmax=m_zMax;
00076 }
00077
00078 void setPlaneYcoord(float y) { m_plane_y=y; CRenderizableDisplayList::notifyChange(); }
00079 float getPlaneYcoord() const { return m_plane_y; }
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
00087 static CGridPlaneXZPtr Create(
00088 float xMin = -10,
00089 float xMax = 10,
00090 float zMin = -10,
00091 float zMax = 10,
00092 float y = 0,
00093 float frequency = 1
00094 )
00095 {
00096 return CGridPlaneXZPtr( new CGridPlaneXZ( xMin,xMax, zMin, zMax, y, frequency ) );
00097 }
00098
00099
00100
00101 void render_dl() const;
00102
00103 private:
00104
00105
00106 CGridPlaneXZ(
00107 float xMin = -10,
00108 float xMax = 10,
00109 float zMin = -10,
00110 float zMax = 10,
00111 float y = 0,
00112 float frequency = 1
00113 ) :
00114 m_xMin(xMin),m_xMax(xMax),
00115 m_zMin(zMin),m_zMax(zMax),
00116 m_plane_y(y),
00117 m_frequency(frequency)
00118 {
00119 }
00120
00121 virtual ~CGridPlaneXZ() { }
00122 };
00123
00124 }
00125
00126 }
00127
00128
00129 #endif