TAPs 0.7.7.3
TAPsTetrahedron.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsTetrahedron.hpp
00003 
00004 Tetrahedron class is a class for a tetrahedron.
00005 
00006 SUKITTI PUNAK   (09/13/2005)
00007 UPDATE          (09/25/2005)
00008 ******************************************************************************/
00009 #ifndef TAPs_TETRAHEDRON_HPP
00010 #define TAPs_TETRAHEDRON_HPP
00011 
00012 #include "TAPsAbstractPolyhedron.hpp"
00013 
00014 BEGIN_NAMESPACE_TAPs
00015 //=============================================================================
00016 template <typename T>
00017 class Tetrahedron : public /*virtual*/ AbstractPolyhedron<T> {
00018 //=============================================================================
00019 // Data Members
00020 protected:
00021     //*
00022     static bool m_gbHasBeenSet; // for determining whether to set static members
00023     typedef typename std::vector<int>   LIST;
00024     static std::vector< LIST >  m_vVertexValence;// list of vertex valence
00025     static std::vector< LIST >  m_vVertexFace;   // list of faces having the vertex
00026     static std::vector< LIST >  m_vFace;         // list of vertices comprising the face
00027     static std::vector< LIST >::const_iterator m_itor; // iterator
00028     //*/
00029     /*
00030     std::vector< LIST > m_vVertexValence;// list of vertex valence
00031     std::vector< LIST > m_vVertexFace;   // list of faces having the vertex
00032     std::vector< LIST > m_vFace;         // list of vertices comprising the face
00033     std::vector< LIST >::iterator m_itor; // iterator
00034     //*/
00035 //=============================================================================
00036 // Member Functions
00037 public:
00038     //-------------------------------------------------------------------------
00039     // Constructors and Destructor
00040     Tetrahedron ();
00041     // Point Numbering:
00042     // ----------------
00043     // Faces will be drawn in CCW
00044     // Assuming pt#0 is the deepest one in (minus) z-direction
00045     // with the right-handed coordinate system
00046     //              2                  y
00047     //            / | \                |
00048     //           /  |  -               |
00049     //          /   | F0 \             |________x
00050     //         / F1 0-----1           /
00051     //        /  - / F2  /           /
00052     //        |/___ ----            z
00053     //        3
00054     // Face#0: 0 2 1
00055     // Face#1: 0 3 2
00056     // Face#2: 0 1 3
00057     // Face#3: 1 2 3
00058     Tetrahedron ( Vector3<T> const p[4] );
00059     virtual ~Tetrahedron ();
00060     //-------------------------------------------------------------------------
00061 protected:
00062     //-------------------------------------------------------------------------
00063     // Helper Function(s)
00064     void SetupStaticMembers ();
00065     virtual void CalNormals ();
00066 public:
00067     virtual void Setup ();
00068     //-------------------------------------------------------------------------
00069 #if defined(__gl_h_) || defined(__GL_H__)
00070 public:
00071     // DrawByOpenGL
00072     virtual void DrawByOpenGL ();
00073 #endif
00074     //-------------------------------------------------------------------------
00075 }; // END CLASS Tetrahedron
00076 //=============================================================================
00077 END_NAMESPACE_TAPs
00078 //-----------------------------------------------------------------------------
00079 // Include definition if TAPs_USE_EXPORT is not defined
00080 //#if !defined( TAPs_USE_EXPORT )
00081     #include "TAPsTetrahedron.cpp"
00082 //#endif
00083 //-----------------------------------------------------------------------------
00084 #endif
00085 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00086 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines