00001 #ifndef __POLYGONAL_MESH_H
00002 #define __POLYGONAL_MESH_H
00003
00004 #include <esg/mesh/Mesh.h>
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 namespace esg {
00018
00019
00020
00021 class OGSCENE_EXPORT PolygonalMesh : public Mesh {
00022 protected:
00023 Sgi::hash_map<int, Vert*> _vertices;
00024 Sgi::hash_map<long int, Edge*> _edges;
00025
00026 static const unsigned MAX_LOOP;
00027
00028 protected:
00029 inline Mesh::Vert* _find_vertex (int);
00030 void _store_vertex (Mesh::Vert*);
00031 Vector3 _plane_normal (const unsigned[],
00032 unsigned, unsigned, unsigned);
00033 long int _multiplex (unsigned, unsigned);
00034 inline Mesh::Edge* _find_edge (unsigned, unsigned);
00035 inline void _store_edge (Edge*);
00036 inline void _erase_edge (unsigned, unsigned);
00037 Mesh::Edge* _append_new_edge (Mesh::Vert*,
00038 Mesh::Vert*,
00039 Mesh::Plane*);
00040 Mesh::Edge* _append_fake_edge (Mesh::Edge*, Mesh::Vert*);
00041 bool _connect_edge (Mesh::Edge*, Mesh::Plane*);
00042 Mesh::Edge* _split_edge (Edge*, Vert*);
00043 Mesh::Plane* _split_plane (Plane*, Vert*, Vert*);
00044 bool _get_facet_topology (Mesh::Vert **,
00045 Mesh::Edge **,
00046 unsigned,
00047 const unsigned*,
00048 const Vector3*);
00049
00050 public:
00051 PolygonalMesh (const Vector3 [],
00052 unsigned,
00053 const unsigned vIndices[] = NULL );
00054
00055 bool addFacet (const unsigned [],
00056 const Vector3 [],
00057 unsigned,
00058 const Vector3& );
00059
00060 bool addFacet (const unsigned [],
00061 const Vector3 [],
00062 unsigned );
00063 };
00064
00065
00066
00067 };
00068
00069 #endif // __POLYGONAL_MESH_H