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