![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsPointManager.hpp 00003 00004 Inherited from class BasePointManager 00005 00006 SUKITTI PUNAK (07/20/2005) 00007 UPDATE (07/30/2005) 00008 ******************************************************************************/ 00009 #ifndef TAPs_POINT_MANAGER_HPP 00010 #define TAPs_POINT_MANAGER_HPP 00011 00012 #include "TAPsBasePointManager.hpp" 00013 #include <vector> 00014 #include <GL/glut.h> 00015 00016 BEGIN_NAMESPACE_TAPs__OpenGL 00017 //============================================================================= 00018 template <typename T> 00019 class PointManager : public /*virtual*/ BasePointManager<T> { 00020 public: 00021 //---------------------------------------------------------------- 00022 // Static Data Members 00023 static const int K_NUM_POINTS; 00024 static const T K_REGULAR_SIZE; 00025 static const T K_HIGHLIGHTED_SIZE; 00026 static const T K_SELECTED_SIZE; 00027 static const Vector3<T> K_REGULAR_COLOR; 00028 static const Vector3<T> K_HIGHLIGHTED_COLOR; 00029 static const Vector3<T> K_SELECTED_COLOR; 00030 //---------------------------------------------------------------- 00031 // Default Constructor and Destructor 00032 PointManager (); 00033 virtual ~PointManager (); 00034 //---------------------------------------------------------------- 00035 enum PointState { 00036 REGULAR = (0 << 0), 00037 SELECTED = (1 << 0), 00038 HIGHLIGHTED = (1 << 1) 00039 }; 00040 //---------------------------------------------------------------- 00041 struct PointStruct { 00042 Vector3<T> m_vPosition; 00043 unsigned int m_uiState; 00044 }; 00045 typedef std::vector<PointStruct> PointList; 00046 //---------------------------------------------------------------- 00047 virtual void Setup ( OpenGLBaseViewManager<T> *pViewManager ); 00048 virtual void Cleanup (); 00049 //---------------------------------------------------------------- 00050 virtual int GetNumPoints () const { return static_cast<int>(m_svPointList.size()); } 00051 virtual const Vector3<T> & GetPointPosition ( int i ) const; 00052 virtual Vector3<T> & GetPointPosition ( int i ); 00053 virtual void SetPointPosition ( int i, const Vector3<T> &position ); 00054 virtual void SetPointHighlighted ( int i, bool bHighlighted ); 00055 virtual bool IsPointHighlighted ( int i ) const; 00056 virtual void SetPointSelected ( int i, bool bSelected ); 00057 virtual bool IsPointSelected ( int i ) const; 00058 virtual void DrawPoints (); 00059 virtual void DrawLines (); 00060 virtual int PickPoint ( int x, int y ) const; 00061 //---------------------------------------------------------------- 00062 protected: 00063 //---------------------------------------------------------------- 00064 // Data Members 00065 PointList m_svPointList; 00066 GLuint m_uiPointDisplayList; 00067 OpenGLBaseViewManager<T> * m_pViewManager; 00068 //---------------------------------------------------------------- 00069 }; // CLASS END: PointManager ************************************************** 00070 //============================================================================= 00071 END_NAMESPACE_TAPs__OpenGL 00072 //----------------------------------------------------------------------------- 00073 // Include definition if TAPs_USE_EXPORT is not defined 00074 //#if !defined( TAPs_USE_EXPORT ) 00075 #include "TAPsPointManager.cpp" 00076 //#endif 00077 //----------------------------------------------------------------------------- 00078 #endif 00079 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00080 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8