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