![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsHexahedronCube.hpp 00003 00004 HexahedronCube class is a class for a Cube. 00005 A hexahedron is a polyhedron with six faces. There are seven convex hexahedra, 00006 coresponding through graph duality with the seven hexahedral graphs (according 00007 to http://mathworld.wolfram.com/Hexahedron.html) 00008 00009 SUKITTI PUNAK (09/14/2005) 00010 UPDATE (09/15/2005) 00011 ******************************************************************************/ 00012 #ifndef TAPs_HEXAHEDRON_CUBE_HPP 00013 #define TAPs_HEXAHEDRON_CUBE_HPP 00014 00015 #include "TAPsAbstractPolyhedron.hpp" 00016 00017 BEGIN_NAMESPACE_TAPs 00018 //============================================================================= 00019 template <typename T> 00020 class HexahedronCube : public /*virtual*/ AbstractPolyhedron<T> { 00021 //============================================================================= 00022 // Data Members 00023 protected: 00024 //* 00025 static bool m_gbHasBeenSet; // for determining whether to set static members 00026 typedef typename std::vector<int> LIST; 00027 static std::vector< LIST > m_vVertexValence;// list of vertex valence 00028 static std::vector< LIST > m_vVertexFace; // list of faces having the vertex 00029 static std::vector< LIST > m_vFace; // list of vertices comprising the face 00030 static std::vector< LIST >::iterator m_itor; // iterator 00031 //*/ 00032 //============================================================================= 00033 // Member Functions 00034 public: 00035 //------------------------------------------------------------------------- 00036 // Constructors and Destructor 00037 HexahedronCube (); 00038 // Point Numbering: 00039 // ---------------- 00040 // Faces will be drawn in CCW 00041 // with the right-handed coordinate system 00042 // 7 6 00043 // +--------+ y 00044 // /| /| | 00045 // / | / | | 00046 // 3+--------+2 | |________x 00047 // | 4+-----|--+5 / 00048 // | / | / / 00049 // |/ |/ z 00050 // +--------+ 00051 // 0 1 00052 // Face#0: 0 1 2 3 (front) 00053 // Face#1: 1 5 6 2 (right) 00054 // Face#2: 7 6 5 4 (back) 00055 // Face#3: 0 3 7 4 (left) 00056 // Face#4: 0 4 5 1 (bottom) 00057 // Face#5: 2 6 7 3 (top) 00058 HexahedronCube ( Vector3<T> const p[8] ); 00059 virtual ~HexahedronCube (); 00060 //------------------------------------------------------------------------- 00061 protected: 00062 //------------------------------------------------------------------------- 00063 // Helper Function(s) 00064 static void SetupStaticMembers (); 00065 virtual void Setup (); 00066 virtual void CalNormals (); 00067 //------------------------------------------------------------------------- 00068 #if defined(__gl_h_) || defined(__GL_H__) 00069 public: 00070 // DrawByOpenGL 00071 virtual void DrawByOpenGL (); 00072 #endif 00073 //------------------------------------------------------------------------- 00074 }; // END CLASS HexahedronCube 00075 //============================================================================= 00076 END_NAMESPACE_TAPs 00077 //----------------------------------------------------------------------------- 00078 // Include definition if TAPs_USE_EXPORT is not defined 00079 //#if !defined( TAPs_USE_EXPORT ) 00080 #include "TAPsHexahedronCube.cpp" 00081 //#endif 00082 //----------------------------------------------------------------------------- 00083 #endif 00084 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00085 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8