27#ifndef EASY3D_CORE_POLYHEDRAL_MESH_H
28#define EASY3D_CORE_POLYHEDRAL_MESH_H
30#include <easy3d/core/model.h>
34#include <easy3d/core/types.h>
35#include <easy3d/core/property.h>
65 int idx()
const {
return idx_; }
75 return idx_ == _rhs.idx_;
80 return idx_ != _rhs.idx_;
85 return idx_ < _rhs.idx_;
90 std::size_t operator()(
const BaseHandle& h)
const {
return h.
idx(); }
105 std::ostream& operator<<(std::ostream& os)
const {
return os <<
'v' <<
idx(); }
114 std::ostream& operator<<(std::ostream& os)
const {
return os <<
'e' <<
idx(); }
124 std::ostream& operator<<(std::ostream& os)
const {
return os <<
'h' <<
idx(); }
133 std::ostream& operator<<(std::ostream& os)
const {
return os <<
'f' <<
idx(); }
142 std::ostream& operator<<(std::ostream& os)
const {
return os <<
'c' <<
idx(); }
153 std::set<Vertex> vertices_;
154 std::set<Edge> edges_;
155 std::set<HalfFace> halffaces_;
156 std::set<Cell> cells_;
158 void read(std::istream& in);
159 void write(std::ostream& out)
const;
167 std::vector<Vertex> vertices_;
168 std::set<HalfFace> halffaces_;
169 std::set<Cell> cells_;
171 void read(std::istream& in);
172 void write(std::ostream& out)
const;
179 std::vector<Vertex> vertices_;
180 std::set<Edge> edges_;
184 void read(std::istream& in);
185 void write(std::ostream& out)
const;
192 std::set<Vertex> vertices_;
193 std::set<Edge> edges_;
194 std::vector<HalfFace> halffaces_;
196 void read(std::istream& in);
197 void write(std::ostream& out)
const;
341 typename Property<T>::const_reference
operator[](
size_t idx)
const
369 return (hnd_==rhs.hnd_);
418 return (hnd_==rhs.hnd_);
467 return (hnd_==rhs.hnd_);
516 return (hnd_==rhs.hnd_);
565 return (hnd_==rhs.hnd_);
695 bool read(
const std::string& filename);
700 bool write(
const std::string& filename)
const;
725 Cell
add_tetra(Vertex v0, Vertex v1, Vertex v2, Vertex v3);
743 Cell
add_hexa(Vertex v0, Vertex v1, Vertex v2, Vertex v3, Vertex v4, Vertex v5, Vertex v6, Vertex v7);
768 unsigned int n_vertices()
const {
return (
unsigned int) vprops_.size(); }
770 unsigned int n_edges()
const {
return (
unsigned int) eprops_.size(); }
772 unsigned int n_halffaces()
const {
return (
unsigned int) hprops_.size(); }
774 unsigned int n_faces()
const {
return (
unsigned int) fprops_.size(); }
776 unsigned int n_cells()
const {
return (
unsigned int) cprops_.size(); }
786 void resize(
unsigned int nv,
unsigned int ne,
unsigned int nf,
unsigned int nc) {
789 hprops_.resize(2 * nf);
1007 return vprops_.rename(old_name, new_name);
1012 return hprops_.rename(old_name, new_name);
1017 return fprops_.rename(old_name, new_name);
1022 return eprops_.rename(old_name, new_name);
1027 return cprops_.rename(old_name, new_name);
1032 return mprops_.rename(old_name, new_name);
1040 return vprops_.get_type(
name);
1046 return eprops_.get_type(
name);
1052 return hprops_.get_type(
name);
1058 return fprops_.get_type(
name);
1064 return cprops_.get_type(
name);
1070 return mprops_.get_type(
name);
1077 return vprops_.properties();
1082 return eprops_.properties();
1087 return hprops_.properties();
1092 return fprops_.properties();
1097 return cprops_.properties();
1102 return mprops_.properties();
1215 return vconn_[v].vertices_;
1222 return HalfFace(
static_cast<int>((f.
idx() << 1) + i));
1233 return hconn_[h].opposite_;
1240 return econn_[e].vertices_[i];
1247 return hconn_[h].vertices_;
1259 return cconn_[c].vertices_;
1265 return vconn_[v].edges_;
1271 return hconn_[h].edges_;
1277 return cconn_[c].edges_;
1283 return vconn_[v].halffaces_;
1289 return econn_[e].halffaces_;
1295 return cconn_[c].halffaces_;
1301 return vconn_[v].cells_;
1307 return econn_[e].cells_;
1313 return hconn_[h].cell_;
1350 Edge
find_edge(Vertex a, Vertex b)
const;
1371 const std::vector<vec3>&
points()
const override {
return vpoint_.vector(); }
1374 std::vector<vec3>&
points()
override {
return vpoint_.vector(); }
1402 vprops_.push_back();
1403 return Vertex(
static_cast<int>(
n_vertices()-1));
1407 Edge new_edge(Vertex s, Vertex t)
1410 eprops_.push_back();
1411 Edge e = Edge(
static_cast<int>(
n_edges() - 1));
1412 econn_[e].vertices_ = {s, t};
1413 vconn_[s].edges_.insert(e);
1414 vconn_[t].edges_.insert(e);
1415 vconn_[s].vertices_.insert(t);
1416 vconn_[t].vertices_.insert(s);
1423 fprops_.push_back();
1424 hprops_.push_back();
1425 hprops_.push_back();
1429 hconn_[h0].opposite_ = h1;
1430 hconn_[h1].opposite_ = h0;
1438 cprops_.push_back();
1439 return Cell(
static_cast<int>(
n_cells()-1));
1444 PropertyContainer vprops_;
1445 PropertyContainer eprops_;
1446 PropertyContainer hprops_;
1447 PropertyContainer fprops_;
1448 PropertyContainer cprops_;
1449 PropertyContainer mprops_;
1451 VertexProperty<VertexConnectivity> vconn_;
1452 EdgeProperty<EdgeConnectivity> econn_;
1453 HalfFaceProperty<HalfFaceConnectivity> hconn_;
1454 CellProperty<CellConnectivity> cconn_;
1456 VertexProperty<vec3> vpoint_;
1465 return (os <<
'v' << v.
idx());
1471 return (os <<
'e' << e.
idx());
1477 return (os <<
'h' << h.
idx());
1483 return (os <<
'f' << f.
idx());
1489 return (os <<
'c' << c.
idx());
The base class of renderable 3D models.
Definition: model.h:49
const std::string & name() const
The name of a model.
Definition: model.h:60
Definition: poly_mesh.h:58
bool operator!=(const BaseHandle &_rhs) const
are two handles different?
Definition: poly_mesh.h:79
bool is_valid() const
return whether the handle is valid, i.e., the index is not equal to -1.
Definition: poly_mesh.h:71
int idx() const
Get the underlying index of this handle.
Definition: poly_mesh.h:65
bool operator<(const BaseHandle &_rhs) const
compare operator useful for sorting handles
Definition: poly_mesh.h:84
bool operator==(const BaseHandle &_rhs) const
are two handles equal?
Definition: poly_mesh.h:74
void reset()
reset handle to be invalid (index=-1)
Definition: poly_mesh.h:68
BaseHandle(int _idx=-1)
constructor
Definition: poly_mesh.h:62
Definition: poly_mesh.h:658
Definition: poly_mesh.h:551
bool operator==(const CellIterator &rhs) const
are two iterators equal?
Definition: poly_mesh.h:563
bool operator!=(const CellIterator &rhs) const
are two iterators different?
Definition: poly_mesh.h:569
CellIterator & operator--()
pre-decrement iterator
Definition: poly_mesh.h:583
Cell operator*() const
get the cell the iterator refers to
Definition: poly_mesh.h:560
CellIterator & operator++()
pre-increment iterator
Definition: poly_mesh.h:575
CellIterator(Cell c=Cell(), const PolyMesh *m=nullptr)
Default constructor.
Definition: poly_mesh.h:555
Definition: poly_mesh.h:303
Property< T >::const_reference operator[](Cell c) const
access the data stored for Cell c
Definition: poly_mesh.h:317
Property< T >::reference operator[](Cell c)
access the data stored for Cell c
Definition: poly_mesh.h:311
CellProperty()=default
default constructor
Definition: poly_mesh.h:616
Definition: poly_mesh.h:404
bool operator!=(const EdgeIterator &rhs) const
are two iterators different?
Definition: poly_mesh.h:422
EdgeIterator & operator++()
pre-increment iterator
Definition: poly_mesh.h:428
Edge operator*() const
get the edge the iterator refers to
Definition: poly_mesh.h:413
bool operator==(const EdgeIterator &rhs) const
are two iterators equal?
Definition: poly_mesh.h:416
EdgeIterator(Edge e=Edge(), const PolyMesh *m=nullptr)
Default constructor.
Definition: poly_mesh.h:408
EdgeIterator & operator--()
pre-decrement iterator
Definition: poly_mesh.h:436
Definition: poly_mesh.h:231
EdgeProperty()=default
default constructor
Property< T >::reference operator[](Edge e)
access the data stored for edge e
Definition: poly_mesh.h:239
Property< T >::const_reference operator[](Edge e) const
access the data stored for edge e
Definition: poly_mesh.h:245
Definition: poly_mesh.h:644
Definition: poly_mesh.h:502
bool operator!=(const FaceIterator &rhs) const
are two iterators different?
Definition: poly_mesh.h:520
bool operator==(const FaceIterator &rhs) const
are two iterators equal?
Definition: poly_mesh.h:514
FaceIterator & operator--()
pre-decrement iterator
Definition: poly_mesh.h:534
FaceIterator(Face f=Face(), const PolyMesh *m=nullptr)
Default constructor.
Definition: poly_mesh.h:506
Face operator*() const
get the face the iterator refers to
Definition: poly_mesh.h:511
FaceIterator & operator++()
pre-increment iterator
Definition: poly_mesh.h:526
Definition: poly_mesh.h:279
Property< T >::reference operator[](Face f)
access the data stored for face f
Definition: poly_mesh.h:287
FaceProperty()=default
default constructor
Property< T >::const_reference operator[](Face f) const
access the data stored for face f
Definition: poly_mesh.h:293
Definition: poly_mesh.h:453
HalfFaceIterator & operator++()
pre-increment iterator
Definition: poly_mesh.h:477
HalfFaceIterator(HalfFace h=HalfFace(), const PolyMesh *m=nullptr)
Default constructor.
Definition: poly_mesh.h:457
HalfFaceIterator & operator--()
pre-decrement iterator
Definition: poly_mesh.h:485
bool operator!=(const HalfFaceIterator &rhs) const
are two iterators different?
Definition: poly_mesh.h:471
HalfFace operator*() const
get the halfface the iterator refers to
Definition: poly_mesh.h:462
bool operator==(const HalfFaceIterator &rhs) const
are two iterators equal?
Definition: poly_mesh.h:465
Definition: poly_mesh.h:255
Property< T >::const_reference operator[](HalfFace h) const
access the data stored for halfface h
Definition: poly_mesh.h:269
Property< T >::reference operator[](HalfFace h)
access the data stored for halfface h
Definition: poly_mesh.h:263
HalfFaceProperty()=default
default constructor
Definition: poly_mesh.h:630
Definition: poly_mesh.h:327
ModelProperty()=default
default constructor
Property< T >::const_reference operator[](size_t idx) const
access the data stored for the mesh
Definition: poly_mesh.h:341
Property< T >::reference operator[](size_t idx)
access the data stored for the mesh
Definition: poly_mesh.h:335
Definition: poly_mesh.h:602
Definition: poly_mesh.h:355
VertexIterator(Vertex v=Vertex(), const PolyMesh *m=nullptr)
Default constructor.
Definition: poly_mesh.h:359
Vertex operator*() const
get the vertex the iterator refers to
Definition: poly_mesh.h:364
bool operator==(const VertexIterator &rhs) const
are two iterators equal?
Definition: poly_mesh.h:367
VertexIterator & operator--()
pre-decrement iterator
Definition: poly_mesh.h:387
bool operator!=(const VertexIterator &rhs) const
are two iterators different?
Definition: poly_mesh.h:373
VertexIterator & operator++()
pre-increment iterator
Definition: poly_mesh.h:379
Definition: poly_mesh.h:207
Property< T >::const_reference operator[](Vertex v) const
access the data stored for vertex v
Definition: poly_mesh.h:221
Property< T >::reference operator[](Vertex v)
access the data stored for vertex v
Definition: poly_mesh.h:215
VertexProperty()=default
default constructor
Data structure representing a polyhedral mesh.
Definition: poly_mesh.h:50
const vec3 & position(Vertex v) const
position of a vertex (read only)
Definition: poly_mesh.h:1368
const std::set< HalfFace > & halffaces(Edge e) const
returns the set of halffaces around edge e
Definition: poly_mesh.h:1287
HalfFace opposite(HalfFace h) const
returns the twin halfface of halfface h.
Definition: poly_mesh.h:1231
bool is_border(Vertex v) const
Definition: poly_mesh.h:1327
EdgeContainer edges() const
returns edge container for C++11 range-based for-loops
Definition: poly_mesh.h:1147
HalfFace find_half_face(const std::vector< Vertex > &vertices) const
find the halfface defined by a sequence of vertices (orientation sensitive)
Definition: poly_mesh.cpp:417
const std::type_info & get_vertex_property_type(const std::string &name) const
Definition: poly_mesh.h:1038
unsigned int n_faces() const
returns number of faces in the mesh
Definition: poly_mesh.h:774
void extract_boundary(std::vector< std::vector< Vertex > > &faces) const
extracts the boundary surface and return its faces
Definition: poly_mesh.cpp:686
const std::vector< Vertex > & vertices(Face f) const
returns the set of vertices around face f
Definition: poly_mesh.h:1251
bool remove_vertex_property(const std::string &n)
remove the vertex property named n
Definition: poly_mesh.h:968
const std::set< Edge > & edges(Cell c) const
returns the set of edges around cell c
Definition: poly_mesh.h:1275
EdgeIterator edges_end() const
returns end iterator for edges
Definition: poly_mesh.h:1141
HalfFace add_triangle(Vertex v0, Vertex v1, Vertex v2)
Definition: poly_mesh.h:753
CellIterator cells_begin() const
returns start iterator for cells
Definition: poly_mesh.h:1189
unsigned int n_edges() const
returns number of edges in the mesh
Definition: poly_mesh.h:770
bool is_valid(Edge e) const
return whether edge e is valid, i.e. the index is stores it within the array bounds.
Definition: poly_mesh.h:800
bool rename_vertex_property(const std::string &old_name, const std::string &new_name)
rename a vertex property given its name
Definition: poly_mesh.h:1006
const std::vector< Vertex > & vertices(HalfFace h) const
Definition: poly_mesh.h:1245
std::vector< std::string > halfface_properties() const
returns the names of all halfface properties
Definition: poly_mesh.h:1085
HalfFaceProperty< T > add_halfface_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:845
const std::set< Cell > & cells(Vertex v) const
returns the set of cells around vertex v
Definition: poly_mesh.h:1299
PolyMesh()
default constructor
Definition: poly_mesh.cpp:133
HalfFaceIterator halffaces_begin() const
returns start iterator for halffaces
Definition: poly_mesh.h:1153
VertexContainer vertices() const
returns vertex container for C++11 range-based for-loops
Definition: poly_mesh.h:1129
FaceProperty< T > get_face_property(const std::string &name) const
Definition: poly_mesh.h:899
const std::set< Cell > & cells(Edge e) const
returns the set of cells around edge e
Definition: poly_mesh.h:1305
const std::type_info & get_edge_property_type(const std::string &name) const
Definition: poly_mesh.h:1044
bool remove_halfface_property(HalfFaceProperty< T > &p)
remove the halfface property p
Definition: poly_mesh.h:979
HalfFace add_quad(Vertex v0, Vertex v1, Vertex v2, Vertex v3)
Definition: poly_mesh.h:758
bool rename_face_property(const std::string &old_name, const std::string &new_name)
rename a face property given its name
Definition: poly_mesh.h:1016
const std::vector< HalfFace > & halffaces(Cell c) const
returns the set of halffaces around cell c
Definition: poly_mesh.h:1293
VertexProperty< T > vertex_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:927
const std::set< Vertex > & vertices(Vertex v) const
returns the vertices around vertex v
Definition: poly_mesh.h:1213
std::vector< std::string > face_properties() const
returns the names of all face properties
Definition: poly_mesh.h:1090
const std::set< Edge > & edges(HalfFace h) const
returns the set of edges around halfface h
Definition: poly_mesh.h:1269
const std::set< Vertex > & vertices(Cell c) const
returns the set of vertices around cell c
Definition: poly_mesh.h:1257
FaceContainer faces() const
returns face container for C++11 range-based for-loops
Definition: poly_mesh.h:1183
ModelProperty< T > get_model_property(const std::string &name) const
Gets the model property named name of type T.
Definition: poly_mesh.h:919
std::vector< std::string > vertex_properties() const
returns the names of all vertex properties
Definition: poly_mesh.h:1075
void update_face_normals()
compute face normals by calling compute_face_normal(HalfFace) for each face.
Definition: poly_mesh.cpp:549
vec3 compute_face_normal(Face f) const
compute normal vector of face f.
Definition: poly_mesh.cpp:572
EdgeProperty< T > get_edge_property(const std::string &name) const
Definition: poly_mesh.h:887
const std::type_info & get_face_property_type(const std::string &name) const
Definition: poly_mesh.h:1056
Cell add_hexa(Vertex v0, Vertex v1, Vertex v2, Vertex v3, Vertex v4, Vertex v5, Vertex v6, Vertex v7)
Definition: poly_mesh.cpp:519
EdgeIterator edges_begin() const
returns start iterator for edges
Definition: poly_mesh.h:1135
HalfFaceIterator halffaces_end() const
returns end iterator for halffaces
Definition: poly_mesh.h:1159
FaceIterator faces_begin() const
returns start iterator for faces
Definition: poly_mesh.h:1171
Cell add_cell(const std::vector< HalfFace > &faces)
Definition: poly_mesh.cpp:479
VertexProperty< T > get_vertex_property(const std::string &name) const
Definition: poly_mesh.h:881
bool remove_face_property(const std::string &n)
remove the face property named n
Definition: poly_mesh.h:989
void resize(unsigned int nv, unsigned int ne, unsigned int nf, unsigned int nc)
Definition: poly_mesh.h:786
const std::set< Edge > & edges(Vertex v) const
returns the set of edges around vertex v
Definition: poly_mesh.h:1263
Edge find_edge(Vertex a, Vertex b) const
find the edge (a,b)
Definition: poly_mesh.cpp:408
std::vector< std::string > edge_properties() const
returns the names of all edge properties
Definition: poly_mesh.h:1080
bool read(const std::string &filename)
Read mesh from a PM file filename. Mainly for quick debug purposes. Client code should use PolyMeshIO...
Definition: poly_mesh.cpp:220
std::vector< std::string > model_properties() const
returns the names of all model properties
Definition: poly_mesh.h:1100
bool is_tetraheral_mesh() const
returns whether the mesh a tetrahedral mesh, i.e., every cell is a tetrahedron.
Definition: poly_mesh.cpp:670
CellContainer cells() const
returns cell container for C++11 range-based for-loops
Definition: poly_mesh.h:1201
bool is_border(HalfFace h) const
returns whether f is a boundary face, i.e., it is not associated with a cell.
Definition: poly_mesh.h:1340
bool rename_edge_property(const std::string &old_name, const std::string &new_name)
rename an edge property given its name
Definition: poly_mesh.h:1021
HalffaceContainer halffaces() const
returns halfface container for C++11 range-based for-loops
Definition: poly_mesh.h:1165
bool remove_halfface_property(const std::string &n)
remove the halfface property named n
Definition: poly_mesh.h:982
const std::type_info & get_model_property_type(const std::string &name) const
Definition: poly_mesh.h:1068
std::vector< vec3 > & points() override
vector of vertex positions
Definition: poly_mesh.h:1374
CellProperty< T > cell_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:951
bool remove_face_property(FaceProperty< T > &p)
remove the face property p
Definition: poly_mesh.h:986
const std::type_info & get_halfface_property_type(const std::string &name) const
Definition: poly_mesh.h:1050
bool remove_edge_property(const std::string &n)
remove the edge property named n
Definition: poly_mesh.h:975
ModelProperty< T > model_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:957
bool remove_cell_property(const std::string &n)
remove the cell property named n
Definition: poly_mesh.h:996
Cell cell(HalfFace h) const
returns the cell associated with halfface h
Definition: poly_mesh.h:1311
VertexProperty< T > add_vertex_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:831
bool remove_model_property(ModelProperty< T > &p)
remove the model property p
Definition: poly_mesh.h:1000
PolyMesh & assign(const PolyMesh &rhs)
assign rhs to *this. does not copy custom properties.
Definition: poly_mesh.cpp:179
FaceProperty< T > face_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:945
PolyMesh & operator=(const PolyMesh &rhs)
assign rhs to *this. performs a deep copy of all properties.
Definition: poly_mesh.cpp:151
FaceProperty< T > add_face_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:852
bool is_valid(HalfFace h) const
return whether halfface h is valid, i.e. the index is stores it within the array bounds.
Definition: poly_mesh.h:805
bool remove_cell_property(CellProperty< T > &p)
remove the cell property p
Definition: poly_mesh.h:993
bool rename_model_property(const std::string &old_name, const std::string &new_name)
rename a model property given its name
Definition: poly_mesh.h:1031
unsigned int n_halffaces() const
returns number of halffaces in the mesh
Definition: poly_mesh.h:772
ModelProperty< T > add_model_property(const std::string &name, const T t=T())
Adds a model property of type T with name name and default value t.
Definition: poly_mesh.h:873
HalfFace add_face(const std::vector< Vertex > &vertices)
Definition: poly_mesh.cpp:450
CellProperty< T > get_cell_property(const std::string &name) const
Definition: poly_mesh.h:905
CellProperty< T > add_cell_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:859
PolyMesh(const PolyMesh &rhs)
copy constructor: copies rhs to *this. performs a deep copy of all properties.
Definition: poly_mesh.h:680
HalfFaceProperty< T > get_halfface_property(const std::string &name) const
Definition: poly_mesh.h:893
bool write(const std::string &filename) const
Write mesh to a PM file filename. Mainly for quick debug purposes. Client code should use PolyMeshIO.
Definition: poly_mesh.cpp:263
Vertex add_vertex(const vec3 &p)
add a new vertex with position p
Definition: poly_mesh.h:709
bool is_valid(Face f) const
return whether face f is valid, i.e. the index is stores it within the array bounds.
Definition: poly_mesh.h:810
CellIterator cells_end() const
returns end iterator for cells
Definition: poly_mesh.h:1195
Face face(HalfFace h) const
returns the face of HalfFace h.
Definition: poly_mesh.h:1226
bool is_border(Face f) const
returns whether f is a boundary face, i.e., it is incident to only one cell.
Definition: poly_mesh.h:1345
EdgeProperty< T > edge_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:933
bool remove_edge_property(EdgeProperty< T > &p)
remove the edge property p
Definition: poly_mesh.h:972
HalfFaceProperty< T > halfface_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:939
void property_stats(std::ostream &output) const override
prints the names of all properties to an output stream (e.g., std::cout).
Definition: poly_mesh.cpp:343
void update_vertex_normals()
Definition: poly_mesh.cpp:599
FaceIterator faces_end() const
returns end iterator for faces
Definition: poly_mesh.h:1177
const std::type_info & get_cell_property_type(const std::string &name) const
Definition: poly_mesh.h:1062
HalfFace halfface(Face f, unsigned int i) const
returns the i'th halfface of face f. i has to be 0 or 1.
Definition: poly_mesh.h:1219
void clear()
Removes all vertices, edges, halffaces, faces, cells and properties.
Definition: poly_mesh.cpp:311
bool rename_halfface_property(const std::string &old_name, const std::string &new_name)
rename a halfface property given its name
Definition: poly_mesh.h:1011
bool rename_cell_property(const std::string &old_name, const std::string &new_name)
rename a cell property given its name
Definition: poly_mesh.h:1026
bool remove_model_property(const std::string &n)
remove the model property named n
Definition: poly_mesh.h:1003
float edge_length(Edge e) const
compute the length of edge e.
Definition: poly_mesh.cpp:633
EdgeProperty< T > add_edge_property(const std::string &name, const T t=T())
Definition: poly_mesh.h:838
bool is_border(Edge e) const
Definition: poly_mesh.h:1334
VertexIterator vertices_begin() const
returns start iterator for vertices
Definition: poly_mesh.h:1117
std::vector< std::string > cell_properties() const
returns the names of all cell properties
Definition: poly_mesh.h:1095
bool remove_vertex_property(VertexProperty< T > &p)
remove the vertex property p
Definition: poly_mesh.h:965
bool is_degenerate(Face f) const
returns whether face f is degenerate
Definition: poly_mesh.cpp:642
VertexIterator vertices_end() const
returns end iterator for vertices
Definition: poly_mesh.h:1123
bool is_valid(Vertex v) const
return whether vertex v is valid, i.e. the index is stores it within the array bounds.
Definition: poly_mesh.h:795
Vertex vertex(Edge e, unsigned int i) const
returns the i'th vertex of edge e. i has to be 0 or 1.
Definition: poly_mesh.h:1237
Cell add_tetra(HalfFace f0, HalfFace f1, HalfFace f2, HalfFace f3)
Definition: poly_mesh.h:719
unsigned int n_cells() const
returns number of cells in the mesh
Definition: poly_mesh.h:776
bool is_valid(Cell c) const
return whether cell h is valid, i.e. the index is stores it within the array bounds.
Definition: poly_mesh.h:815
const std::vector< vec3 > & points() const override
vector of vertex positions (read only)
Definition: poly_mesh.h:1371
unsigned int n_vertices() const
returns number of vertices in the mesh
Definition: poly_mesh.h:768
const std::set< HalfFace > & halffaces(Vertex v) const
returns the set of halffaces around vertex v
Definition: poly_mesh.h:1281
Implementation of a generic property.
Definition: property.h:253
Definition: collider.cpp:182
std::ostream & operator<<(std::ostream &os, Graph::Vertex v)
Definition: graph.h:920
helper structure to be able to use std::unordered_map
Definition: poly_mesh.h:89
Definition: poly_mesh.h:191
Definition: poly_mesh.h:139
Cell(int _idx=-1)
default constructor (with invalid index)
Definition: poly_mesh.h:141
Definition: poly_mesh.h:166
Definition: poly_mesh.h:111
Edge(int _idx=-1)
default constructor (with invalid index)
Definition: poly_mesh.h:113
Definition: poly_mesh.h:130
Face(int _idx=-1)
default constructor (with invalid index)
Definition: poly_mesh.h:132
Definition: poly_mesh.h:178
Definition: poly_mesh.h:121
HalfFace(int _idx=-1)
default constructor (with invalid index)
Definition: poly_mesh.h:123
Definition: poly_mesh.h:152
Definition: poly_mesh.h:102
Vertex(int _idx=-1)
default constructor (with invalid index)
Definition: poly_mesh.h:104