xc
Triang3dMesh.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //Triang3dMesh.h
22 
23 #ifndef TRIANG3D_MESH_H
24 #define TRIANG3D_MESH_H
25 
26 #include "../d3/3d_polyhedrons/Polyhedron3d.h"
27 
28 class Triangle3d;
29 class SoGroup;
30 class GTSSurface;
31 class Pos3d;
32 
33 
35 //
38  {
39  GTSSurface get_gts_surface(void) const;
40 
41  friend class Polyhedron3d;
42 
43  public:
44  typedef Polyhedron3d::Vertex Vertex;
45  typedef Polyhedron3d::Facet Facet;
46  typedef Polyhedron3d::Point_iterator Point_iterator;
47  typedef Polyhedron3d::Point_const_iterator Point_const_iterator;
48  typedef Polyhedron3d::Vertex_iterator Vertex_iterator;
49  typedef Polyhedron3d::Vertex_const_iterator Vertex_const_iterator;
50  typedef Polyhedron3d::Facet_iterator Facet_iterator;
51  typedef Polyhedron3d::Facet_const_iterator Facet_const_iterator;
52  typedef Polyhedron3d::Edge_iterator Edge_iterator;
53  typedef Polyhedron3d::Halfedge_iterator Halfedge_iterator;
54  typedef Polyhedron3d::Halfedge_around_facet_circulator Halfedge_around_facet_circulator;
55  typedef Polyhedron3d::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator;
56  typedef Polyhedron3d::Vertex_handle Vertex_handle;
57  typedef Polyhedron3d::Facet_handle Facet_handle;
58  typedef Polyhedron3d::Halfedge_handle Halfedge_handle;
59 
60  protected:
61  Facet_const_iterator find_trihedron(const Pos3d &org,const Pos3d &p,const double &tol) const;
62 
63  public:
64 
65  Triang3dMesh(void): Polyhedron3d() {}
66  explicit Triang3dMesh(const Polyhedron3d &p)
67  : Polyhedron3d(p) {}
68  Triang3dMesh(const GTSSurface &gts_surf);
69 
70  virtual GeomObj *getCopy(void) const
71  { return new Triang3dMesh(*this); }
72 
73  Triangle3d getFaceTriangle(const Facet_const_iterator &f) const;
74 
75  Facet_const_iterator findTrihedron(const Pos3d &org,const Pos3d &p,const double &tol) const;
76 
77  friend Triang3dMesh GTSSurface2Triang3dMesh(const GTSSurface &gts_surf);
78  };
79 
80 #endif
Facet_const_iterator find_trihedron(const Pos3d &org, const Pos3d &p, const double &tol) const
Finds the trihedron formed by org and one of the facets that contains p.
Definition: Triang3dMesh.cc:138
virtual GeomObj * getCopy(void) const
Constructor virtual.
Definition: Triang3dMesh.h:70
Base class for polyhedrons in a three-dimensional space.
Definition: Polyhedron3d.h:41
Triangle in a three-dimensional space.
Definition: Triangle3d.h:34
Definition: GTSSurface.h:38
Posición en tres dimensiones.
Definition: Pos3d.h:44
3D Triange mesh.
Definition: Triang3dMesh.h:37
Polyhedron3d(void)
Default constructor.
Definition: Polyhedron3d.cc:40
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
Facet_const_iterator findTrihedron(const Pos3d &org, const Pos3d &p, const double &tol) const
Finds the trihedron formed by org and one of the facets that contains p.
Definition: Triang3dMesh.cc:158