TAPs 0.7.7.3
TAPsBaseBarycentricCoordsForVertexRef.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsBaseBarycentricCoordsForVertexRef.hpp
00003 ******************************************************************************/
00016 //  Node Numbering Convention
00017 //
00018 //             3
00019 //           / |\
00020 //         /   | \
00021 //      /   Pt |  \       Pt is inside the tetrahedron
00022 //   /        |    \
00023 //  2---------|-----1
00024 //   \        |    /
00025 //    \      |    /
00026 //     \     |   /
00027 //      \    |  /
00028 //       \  |  /
00029 //        \ | /
00030 //         \|/
00031 //          0
00032 /******************************************************************************
00033 SUKITTI PUNAK   (04/16/2010)
00034 UPDATE          (09/28/2010)
00035 ******************************************************************************/
00036 #ifndef TAPs_BASE_BARY_COORDS_FOR_VERTEX_REF_HPP
00037 #define TAPs_BASE_BARY_COORDS_FOR_VERTEX_REF_HPP
00038 
00039 #include "../Core/TAPsStdLib.hpp"
00040 
00041 BEGIN_NAMESPACE_TAPs
00042 //=============================================================================
00043 template <typename T>
00044 class BaseBarycentricCoordsForVertexRef {
00045 //=============================================================================
00046 public:
00047     // Member Functions -------------------------------------------------------
00049     friend std::ostream & operator<< ( std::ostream &output, BaseBarycentricCoordsForVertexRef<T> const &obj )
00050     {
00051         output << obj.StrInfo();
00052         return output;
00053     }
00054     //-------------------------------------------------------------------------
00056     //BaseBarycentricCoordsForVertexRef ();
00057     //-------------------------------------------------------------------------
00059     BaseBarycentricCoordsForVertexRef ( 
00060         Vector3<T> & vertex,    
00061         T u,    
00062         T v,    
00063         T w     
00064     );
00065     //-------------------------------------------------------------------------
00067     BaseBarycentricCoordsForVertexRef ( BaseBarycentricCoordsForVertexRef<T> const & orig );
00068     //-------------------------------------------------------------------------
00070     virtual ~BaseBarycentricCoordsForVertexRef ();
00071     //-------------------------------------------------------------------------
00072     BaseBarycentricCoordsForVertexRef<T> & operator= ( BaseBarycentricCoordsForVertexRef<T> const & orig );
00073     //-------------------------------------------------------------------------
00075     virtual std::string StrInfo () const;
00076 
00078     Vector3<T> const * const RetVertexPtr () const  { return m_pVertex; }
00080     Vector3<T> * const RetVertexPtr ()  { return m_pVertex; }
00081 
00083     Vector3<T> const & RetGenBaryCoords () const    { return m_coords; }
00085     Vector3<T> & RetGenBaryCoords ()    { return m_coords; }
00087     void GetGenBaryCoords ( T &u, T &v, T &w )
00088     { u = m_coords[0]; v = m_coords[1]; w = m_coords[2]; }
00089 
00091     unsigned int GetElementID () const      { return m_uiElementID; }
00093     void SetElementID ( unsigned int id )   { m_uiElementID = id; }
00094 
00096     inline virtual void ComputeNewVertexLocation () = 0;
00097 
00100     inline virtual Vector3<T> GetNewVertexLocation () const = 0;
00101 
00103     inline void ComputeNewVertexLocationBasedOnTetrahedralVertices (
00104         T x0, T y0, T z0,
00105         T x1, T y1, T z1,
00106         T x2, T y2, T z2,
00107         T x3, T y3, T z3
00108     );
00109 
00111     inline void ComputeNewVertexLocationBasedOnHexahedralVertices (
00112         T x0, T y0, T z0,
00113         T x1, T y1, T z1,
00114         T x2, T y2, T z2,
00115         T x3, T y3, T z3,
00116         T x4, T y4, T z4,
00117         T x5, T y5, T z5,
00118         T x6, T y6, T z6,
00119         T x7, T y7, T z7
00120     );
00121 
00122     // Data Members -----------------------------------------------------------
00123 //=============================================================================
00124 protected:
00125     // Member Functions -------------------------------------------------------
00126     // Data Members -----------------------------------------------------------
00127     Vector3<T> *    m_pVertex;      
00128     Vector3<T>      m_coords;       
00129     unsigned int    m_uiElementID;  
00130 //=============================================================================
00131 private:
00132     // Member Functions -------------------------------------------------------
00133     // Data Members -----------------------------------------------------------
00134 //=============================================================================
00135 }; // END CLASS BaseBarycentricCoordsForVertexRef
00136 //=============================================================================
00137 END_NAMESPACE_TAPs
00138 //-----------------------------------------------------------------------------
00140 #include "TAPsBaseBarycentricCoordsForVertexRef.cpp"
00141 
00143 // Include definition if TAPs_USE_EXPORT is not defined
00144 //#if !defined( TAPs_USE_EXPORT )
00145 //  #include "TAPsBaseBarycentricCoordsForVertexRef.cpp"
00146 //#endif
00147 //-----------------------------------------------------------------------------
00148 #endif
00149 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00150 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines