00001 #ifndef _MESHBASE_H_ 00002 #define _MESHBASE_H_ 00003 00004 #include "IGS_Object.h" 00005 #include "math/Vector4.h" 00006 #include <vector> 00007 00008 class IGS_Mesh; 00009 00010 //============================================================================= 00011 class MeshFacet 00012 { 00013 public: 00014 void AddEdgeIndex( const int index ); 00015 void AddNormalIndex( const int index ); 00016 void AddVertexIndex( const int index ); 00017 void Clear(); 00018 void ClearNormals(); 00019 int GetNormalNum( const int i ) const; 00020 int GetVertexNum( const int i ) const; 00021 void MarkFrontFacing( const IGS_Mesh* parent ) const; 00022 void MarkBackFacing( const IGS_Mesh* parent ) const; 00023 int Size() const; 00024 00025 protected: 00026 std::vector< int > vertexNums; 00027 std::vector< int > normalNums; 00028 std::vector< int > edgeNums; 00029 }; 00030 //============================================================================= 00031 class IGS_MeshBase 00032 : 00033 public IGS_Object 00034 { 00035 public: 00036 IGS_MeshBase(); 00037 IGS_MeshBase( const IGS_MeshBase& right ); 00038 virtual ~IGS_MeshBase(); 00039 00040 int AddNormal( const Vector4& normal ); 00041 int AddVertexCoordinates( const Vector4& vector ); 00042 const Vector4& GetNormal( const int i ) const; 00043 const int GetNumVertexes() const; 00044 const Vector4& GetVertex( const int i ) const; 00045 00046 protected: 00047 std::vector< Vector4 > m_Vertexes; 00048 std::vector< Vector4 > m_Normals; 00049 00050 }; 00051 00052 //============================================================================= 00053 #endif