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
00054 class OPENGL_IMPEXP CGridPlaneXZ : public CRenderizableDisplayList
00055 {
00056 DEFINE_SERIALIZABLE( CGridPlaneXZ )
00057
00058 protected:
00059 float m_xMin, m_xMax;
00060 float m_zMin, m_zMax;
00061 float m_plane_y;
00062 float m_frequency;
00063
00064 public:
00065
00066 void setPlaneLimits(float xmin,float xmax, float zmin, float zmax)
00067 {
00068 m_xMin=xmin; m_xMax = xmax;
00069 m_zMin=zmin; m_zMax = zmax;
00070 CRenderizableDisplayList::notifyChange();
00071 }
00072
00073 void getPlaneLimits(float &xmin,float &xmax, float &zmin, float &zmax) const
00074 {
00075 xmin=m_xMin; xmax=m_xMax;
00076 zmin=m_zMin; zmax=m_zMax;
00077 }
00078
00079 void setPlaneYcoord(float y) { m_plane_y=y; CRenderizableDisplayList::notifyChange(); }
00080 float getPlaneYcoord() const { return m_plane_y; }
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
00088 static CGridPlaneXZPtr Create(
00089 float xMin = -10,
00090 float xMax = 10,
00091 float zMin = -10,
00092 float zMax = 10,
00093 float y = 0,
00094 float frequency = 1
00095 )
00096 {
00097 return CGridPlaneXZPtr( new CGridPlaneXZ( xMin,xMax, zMin, zMax, y, frequency ) );
00098 }
00099
00100
00101
00102 void render_dl() const;
00103
00104 private:
00105
00106
00107 CGridPlaneXZ(
00108 float xMin = -10,
00109 float xMax = 10,
00110 float zMin = -10,
00111 float zMax = 10,
00112 float y = 0,
00113 float frequency = 1
00114 ) :
00115 m_xMin(xMin),m_xMax(xMax),
00116 m_zMin(zMin),m_zMax(zMax),
00117 m_plane_y(y),
00118 m_frequency(frequency)
00119 {
00120 }
00121
00122 virtual ~CGridPlaneXZ() { }
00123 };
00124
00125 }
00126
00127 }
00128
00129
00130 #endif