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 #ifndef opengl_CAxis_H
00029 #define opengl_CAxis_H
00030
00031 #include <mrpt/opengl/CRenderizableDisplayList.h>
00032
00033 namespace mrpt
00034 {
00035 namespace opengl
00036 {
00037 class OPENGL_IMPEXP CAxis;
00038
00039
00040 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CAxis, CRenderizableDisplayList, OPENGL_IMPEXP )
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 class OPENGL_IMPEXP CAxis : public CRenderizableDisplayList
00053 {
00054 DEFINE_SERIALIZABLE( CAxis )
00055 protected:
00056 float m_xmin,m_ymin,m_zmin;
00057 float m_xmax,m_ymax,m_zmax;
00058 float m_frecuency;
00059 float m_lineWidth;
00060 bool m_marks;
00061
00062 public:
00063 void setAxisLimits(float xmin,float ymin, float zmin, float xmax,float ymax, float zmax)
00064 {
00065 m_xmin=xmin; m_ymin=ymin; m_zmin=zmin;
00066 m_xmax=xmax; m_ymax=ymax; m_zmax=zmax;
00067 CRenderizableDisplayList::notifyChange();
00068 }
00069
00070 void setFrequency(float f) { ASSERT_(f>0); m_frecuency=f; CRenderizableDisplayList::notifyChange(); }
00071
00072 void setLineWidth(float w) { m_lineWidth=w; CRenderizableDisplayList::notifyChange(); }
00073 float getLineWidth() const { return m_lineWidth;}
00074
00075 void enableTickMarks(bool v=true) { m_marks=v; CRenderizableDisplayList::notifyChange(); }
00076
00077
00078
00079 static CAxisPtr Create(
00080 float xmin,float ymin, float zmin,
00081 float xmax, float ymax, float zmax,
00082 float frecuency = 1, float lineWidth = 3, bool marks=false)
00083 {
00084 return CAxisPtr( new CAxis( xmin,ymin, zmin, xmax,ymax,zmax,frecuency,lineWidth,marks ) );
00085 }
00086
00087
00088
00089 void render_dl() const;
00090
00091 private:
00092
00093
00094 CAxis(
00095 float xmin=-1.0f,float ymin=-1.0f, float zmin=-1.0f,
00096 float xmax=1.0f, float ymax=1.0f, float zmax=1.0f,
00097 float frecuency = 0.25f, float lineWidth = 3.0f, bool marks=false) :
00098 m_xmin(xmin),m_ymin(ymin),m_zmin(zmin),
00099 m_xmax(xmax),m_ymax(ymax),m_zmax(zmax),
00100 m_frecuency(frecuency),
00101 m_lineWidth(lineWidth),
00102 m_marks(marks)
00103 {
00104 }
00105
00106
00107 virtual ~CAxis() { }
00108 };
00109
00110 }
00111 }
00112
00113 #endif