31 class GISMO_EXPORT
gsMesh :
public gsMeshElement<T>
34 typedef memory::shared_ptr<gsMesh> Ptr;
35 typedef memory::unique_ptr<gsMesh> uPtr;
36 typedef gsMeshElement<T> MeshElement;
37 typedef typename MeshElement::scalar_t scalar_t;
39 typedef typename MeshElement::gsFaceHandle FaceHandle;
40 typedef typename MeshElement::gsEdgeHandle EdgeHandle;
42 typedef gsEdge<T> Edge;
52 this->operator=(mesh);
64 for (
size_t i = 0; i < other.m_face.size(); ++i)
66 for (
size_t j = 0; j != other.m_face[i]->vertices.size(); ++j)
68 GISMO_ASSERT(m_vertex[other.m_face[i]->vertices[j]->getId()]->getId() == other.m_face[i]->vertices[j]->getId(),
"gsMesh(const gsMesh<T> & mesh): getId() of vertex and face don't match");
69 m_face[i]->vertices[j] = m_vertex[other.m_face[i]->vertices[j]->getId()];
74 m_edge = other.m_edge;
75 for (
size_t i = 0; i != other.m_edge.size(); ++i)
79 m_edge[i].source = m_vertex[other.m_edge[i].source->getId()];
82 m_edge[i].target = m_vertex[other.m_edge[i].target->getId()];
125 VertexHandle addVertex(scalar_t
const& x, scalar_t
const& y, scalar_t
const& z=0);
131 void addEdge(
int const vind0,
int const vind1);
136 FaceHandle addFace(std::vector<VertexHandle>
const & vert);
144 FaceHandle addFace(std::vector<int>
const & vert);
146 FaceHandle addFace(
const int v0,
const int v1,
const int v2);
148 FaceHandle addFace(
const int v0,
const int v1,
const int v2,
const int v3);
162 std::ostream &print(std::ostream &os)
const;
185 gsMesh& reserve(
size_t vertex,
size_t face,
size_t edge);
187 size_t numVertices()
const {
return m_vertex.size(); }
188 size_t numEdges()
const {
return m_edge.size(); }
189 size_t numFaces()
const {
return m_face.size(); }
191 const std::vector<VertexHandle > & vertices()
const
194 const std::vector<Edge > & edges()
const
197 const std::vector<FaceHandle > & faces()
const
200 const Vertex & vertex(
size_t i)
const {
return *m_vertex[i]; }
201 Vertex & vertex(
size_t i) {
return *m_vertex[i]; }
203 const FaceHandle & face(
size_t i)
const {
return m_face[i]; }
204 FaceHandle & face(
size_t i) {
return m_face[i]; }
206 const Edge & edge(
size_t i)
const {
return m_edge[i]; }
207 Edge & edge(
size_t i) {
return m_edge[i]; }
211 const FaceHandle & f = face(i);
213 typename std::vector<VertexHandle >::const_iterator v;
214 for (
size_t j = 0; j!=f->vertices.size(); ++j)
216 v = std::find(m_vertex.begin(), m_vertex.end(), f->vertices[j] );
225 std::vector<VertexHandle > m_vertex;
226 std::vector<FaceHandle > m_face;
233 #ifndef GISMO_BUILD_LIB
234 #include GISMO_HPP_HEADER(gsMesh.hpp)
T distance(gsMatrix< T > const &A, gsMatrix< T > const &B, index_t i=0, index_t j=0, bool cols=false)
compute a distance between the point number in the set and the point number <j> in the set ; by def...
Provides gsMeshElement class - a vertex, edge, face or cell of a gsMesh.
Provides gsFace class for a face of a gsMesh.
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
void cloneAll(It start, It end, ItOut out)
Clones all pointers in the range [start end) and stores new raw pointers in iterator out...
Definition: gsMemory.h:295
Class Representing a triangle mesh with 3D vertices.
Definition: gsMesh.h:31
Provides gsVertex class for a vertex of a gsMesh.
Provides gsEdge class for an edge of a gsMesh.
An std::vector with sorting capabilities.
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
gsVertex class that represents a 3D vertex for a gsMesh.
Definition: gsVertex.h:26