![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsXVertex.hpp 00003 00004 (X <==> Extra) 00005 XVertex class is a class for 3D vertex with its ring (see definition below). 00006 00007 Definition: 00008 =========== 00009 Let v denotes a vertex in the model M. 00010 ring[v] is the set of faces that contains the vertex v. 00011 The valence of the vertex v is the number of faces in ring[v]. 00012 00013 SUKITTI PUNAK (11/01/2004) 00014 UPDATE (08/15/2010) 00015 ******************************************************************************/ 00016 #ifndef TAPs_XVERTEX_HPP 00017 #define TAPs_XVERTEX_HPP 00018 00019 #include "TAPsVertex.hpp" 00020 #include <vector> 00021 00022 BEGIN_NAMESPACE_TAPs 00023 //============================================================================= 00024 template <typename T> 00025 class XVertex : public /*virtual*/ Vertex<T> { 00026 //============================================================================= 00027 protected: 00028 std::vector<int> m_viFaceRing; // the set of faces that contains this vertex 00029 //std::vector<int> m_viVertexRing; // the set of 1st ring neighbor vertices 00030 //============================================================================= 00031 public: 00032 //------------------------------------------------------------------------- 00033 // Output Operator << 00034 friend std::ostream & operator<< ( std::ostream &output, XVertex<T> const &xv ) 00035 { 00036 //------------------------------------------------------------ 00037 // Display Vertex Position and Normal 00038 output << "XVertex<" << typeid(T).name() << ">" 00039 << " with Position:" << xv.m_vPosit 00040 << " and Normal:" << xv.m_vNormal; 00041 //------------------------------------------------------------ 00042 // Display Face Ring 00043 output << "\n FaceRing:"; 00044 for ( int i = 0; i < static_cast<int>( xv.m_viFaceRing.size() ); ++i ) { 00045 output << " " << xv.m_viFaceRing[i]; 00046 } 00047 //------------------------------------------------------------ 00048 // Display Vertex Ring 00049 //output << "\n VertexRing:"; 00050 //for ( int i = 0; i < static_cast<int>( xv.m_viVertexRing.size() ); ++i ) { 00051 // output << " " << xv.m_viVertexRing[i]; 00052 //} 00053 return output; 00054 } 00055 //------------------------------------------------------------------------- 00057 XVertex (); 00059 XVertex ( int faceRingSize, /*int valence, */ 00060 T x, T y, T z, 00061 Vector3<T> normal = Vector3<T>() ); 00063 XVertex ( int faceRingSize, /*int valence, */ 00064 T a[3], Vector3<T> normal = Vector3<T>() ); 00066 XVertex ( XVertex<T> const &xv ); 00068 virtual ~XVertex (); 00069 //------------------------------------------------------------------------- 00070 // Get/Set Fn(s) 00071 std::vector<int> & GetFaceRing () { return m_viFaceRing; } 00072 //std::vector<int> & GetVertexRing () { return m_viVertexRing; } 00073 void SetFaceRing ( std::vector<int> faceRing ) { m_viFaceRing = faceRing; } 00074 //void SetVertexRing ( std::vector<int> vertexRing ) { m_viVertexRing = vertexRing; } 00075 //------------------------------------------------------------------------- 00076 // Assignment Operator 00077 inline XVertex<T> & operator= ( XVertex<T> const &xv ); 00078 //------------------------------------------------------------------------- 00079 }; // END CLASS XVertex 00080 //============================================================================= 00081 END_NAMESPACE_TAPs 00082 //----------------------------------------------------------------------------- 00083 // Include definition if TAPs_USE_EXPORT is not defined 00084 //#if !defined( TAPs_USE_EXPORT ) 00085 #include "TAPsXVertex.cpp" 00086 //#endif 00087 //----------------------------------------------------------------------------- 00088 #endif 00089 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00090 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8