TAPs 0.7.7.3
TAPsHEVertexPtrWithExtraInfo.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsHEVertexPtrWithExtraInfo.hpp
00003 
00004 HEVertexPtrWithExtraInfo class (hpp file).
00005 
00006 SUKITTI PUNAK   (07/28/2008)
00007 ******************************************************************************/
00008 #ifndef TAPs_HALF_EDGE_VERTEX_WITH_EXTRA_INFO_HPP
00009 #define TAPs_HALF_EDGE_VERTEX_WITH_EXTRA_INFO_HPP
00010 
00011 //#include "../../Physics/TAPsParticleRef.hpp"
00012 #include "../../Physics/TAPsSpringRef.hpp"
00013 
00014 BEGIN_NAMESPACE_TAPs
00015 //=============================================================================
00016 template <typename T>
00017 class HEVertexPtrWithExtraInfo {
00018 //=============================================================================
00019     // Member Functions -------------------------------------------------------
00021     friend std::ostream & operator<< ( 
00022         std::ostream &output, HEVertexPtrWithExtraInfo<T> const &obj )
00023     {
00024         output << obj.StrInfo();
00025         return output;
00026     }
00027 
00028 //=============================================================================
00029 public:
00030     // Member Functions -------------------------------------------------------
00031 
00033     HEVertexPtrWithExtraInfo ( HEVertex<T> * heVertexPtr, ParticleRef<T> * particlePtr );
00034 
00036     // Prohibited!
00037     //HEVertexPtrWithExtraInfo ( HEVertexPtrWithExtraInfo<T> const & obj );
00038 
00040     ~HEVertexPtrWithExtraInfo ();
00041 
00043     virtual std::string StrInfo () const;
00044 
00046     //inline HEVertexPtrWithExtraInfo<T> & operator= ( HEVertexPtrWithExtraInfo<T> const &obj );
00047 
00049     HEVertex<T> const * GetHEVertexPtr () const { return m_pHEVertex; }
00050     HEVertex<T> *       GetHEVertexPtr ()       { return m_pHEVertex; }
00051 
00053     std::vector<int> const &    GetListVertexFirstRing () const { return m_viListVertexFirstRing; }
00054     std::vector<int> &          GetListVertexFirstRing ()       { return m_viListVertexFirstRing; }
00055 
00057     std::vector<int> const &    GetListConnectedVertices () const   { return m_viListConnectedVertices; }
00058     std::vector<int> &          GetListConnectedVertices ()         { return m_viListConnectedVertices; }
00059 
00061     //std::vector<int> const &  GetListSprings () const { return m_viListSprings; }
00062     //std::vector<int> &            GetListSprings ()       { return m_viListSprings; }
00063 
00065     ParticleRef<T> const *  GetParticleRef () const { return m_pParticleRef; }
00066     ParticleRef<T> *        GetParticleRef ()       { return m_pParticleRef; }
00067 
00069     ParticleRef<T> const &  GetHomeParticle () const    { return m_HomeParticle; }
00070     ParticleRef<T> &        GetHomeParticle ()          { return m_HomeParticle; }
00071 
00073     Vector3<T> const &  GetHomePosition () const    { return m_vHomePos; }
00074     Vector3<T> &        GetHomePosition ()          { return m_vHomePos; }
00076     void    SetHomePosition ( Vector3<T> const & pos )  { m_vHomePos = pos; }
00077 
00078     // Create list of the first ring vertices
00079     //void CreateListVertexFirstRing ( HEVertexList<T> * vertexList );
00080 
00081     // Data Members -----------------------------------------------------------
00082 //=============================================================================
00083 protected:
00084     // Member Functions -------------------------------------------------------
00085 
00086     // Data Members -----------------------------------------------------------
00087 
00088     // Home Position
00089     Vector3<T>          m_vHomePos;         
00090     ParticleRef<T>      m_HomeParticle;     
00091 
00092     HEVertex<T> *       m_pHEVertex;                
00093     std::vector<int>    m_viListVertexFirstRing;    
00094     std::vector<int>    m_viListConnectedVertices;  
00095 
00096     ParticleRef<T> *    m_pParticleRef;     
00097 
00098 //=============================================================================
00099 private:
00100     // Member Functions -------------------------------------------------------
00101     // Prohibited Functions ===================================================
00102     // Since a HEVertexPtrWithExtraInfo refers to a particle and a half-edge 
00103     // vertex, in which the half-edge vertex's position is refered by the particle.
00104     // Therefore, Copy Constructor and Assignment Operator are prohibited.
00105     HEVertexPtrWithExtraInfo<T> const & operator= ( HEVertexPtrWithExtraInfo<T> const &S )  // assignment operator
00106     {
00107         std::cerr << "HEVertexPtrWithExtraInfo<T> operator= must not be used!\n";
00108         exit( 1 );
00109     }
00110     // Data Members -----------------------------------------------------------
00111 //=============================================================================
00112 }; // END CLASS HEVertexPtrWithExtraInfo
00113 //=============================================================================
00114 //-----------------------------------------------------------------------------
00118 typedef HEVertexPtrWithExtraInfo<int>    HEVertexPtrWithExtraInfoi;
00119 typedef HEVertexPtrWithExtraInfo<float>  HEVertexPtrWithExtraInfof;
00120 typedef HEVertexPtrWithExtraInfo<double> HEVertexPtrWithExtraInfod;
00121 //=============================================================================
00122 END_NAMESPACE_TAPs
00123 //-----------------------------------------------------------------------------
00124 // Include definition if TAPs_USE_EXPORT is not defined
00125 // If the class is template, use this
00126 //#if !defined( TAPs_USE_EXPORT )
00127     #include "TAPsHEVertexPtrWithExtraInfo.cpp"
00128 //#endif
00129 
00130 // If the class is NOT template, use this
00131 //#if !defined( TAPs_USE_EXPORT )
00132 //  #include "TAPsHEVertexPtrWithExtraInfo.cpp"
00133 //#endif
00134 //-----------------------------------------------------------------------------
00135 #endif
00136 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00137 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines