Easy3D 2.6.1
|
Data structure representing a polyhedral mesh. More...
#include <easy3d/core/poly_mesh.h>
Classes | |
class | BaseHandle |
Base class for all topology types (internally it is basically an index). More... | |
struct | Cell |
struct | CellConnectivity |
class | CellContainer |
This helper class is a container for iterating through all cells using C++11 range-based for-loops. More... | |
class | CellIterator |
Cell iterator for PolyMesh. This class iterates linearly over all cells. More... | |
class | CellProperty |
Cell property of type T. More... | |
struct | Edge |
struct | EdgeConnectivity |
class | EdgeContainer |
This helper class is a container for iterating through all edges using C++11 range-based for-loops. More... | |
class | EdgeIterator |
Edge iterator for PolyMesh. This class iterates linearly over all edges. More... | |
class | EdgeProperty |
Edge property of type T. More... | |
struct | Face |
class | FaceContainer |
This helper class is a container for iterating through all faces using C++11 range-based for-loops. More... | |
class | FaceIterator |
Face iterator for PolyMesh. This class iterates linearly over all faces. More... | |
class | FaceProperty |
Face property of type T. More... | |
struct | HalfFace |
struct | HalfFaceConnectivity |
class | HalffaceContainer |
This helper class is a container for iterating through all halffaces using C++11 range-based for-loops. More... | |
class | HalfFaceIterator |
HalfFace iterator for PolyMesh. This class iterates linearly over all halffaces. More... | |
class | HalfFaceProperty |
HalfFace property of type T. More... | |
class | ModelProperty |
Model property of type T. More... | |
struct | Vertex |
struct | VertexConnectivity |
class | VertexContainer |
This helper class is a container for iterating through all vertices using C++11 range-based for-loops. More... | |
class | VertexIterator |
Vertex iterator for PolyMesh. This class iterates linearly over all vertices. More... | |
class | VertexProperty |
Vertex property of type T. More... | |
Public Member Functions | |
Construct, destruct, assignment | |
PolyMesh () | |
Default constructor. | |
~PolyMesh () override=default | |
Destructor. | |
PolyMesh (const PolyMesh &rhs) | |
Copy constructor: copies rhs to *this . Performs a deep copy of all properties. | |
PolyMesh & | operator= (const PolyMesh &rhs) |
Assign rhs to *this . Performs a deep copy of all properties. | |
PolyMesh & | assign (const PolyMesh &rhs) |
Assign rhs to *this . Does not copy custom properties. | |
File IO | |
bool | read (const std::string &filename) |
Read mesh from a PM file filename . | |
bool | write (const std::string &filename) const |
Write mesh to a PM file filename . | |
Add new elements by hand | |
Vertex | add_vertex (const vec3 &p) |
Add a new vertex. | |
Cell | add_cell (const std::vector< HalfFace > &faces) |
Add a new cell defined by faces . | |
Cell | add_tetra (HalfFace f0, HalfFace f1, HalfFace f2, HalfFace f3) |
Add a new tetrahedron defined by its faces. | |
Cell | add_tetra (Vertex v0, Vertex v1, Vertex v2, Vertex v3) |
Add a new tetrahedron connecting vertices v0 , v1 , v2 , v3 . | |
Cell | add_hexa (Vertex v0, Vertex v1, Vertex v2, Vertex v3, Vertex v4, Vertex v5, Vertex v6, Vertex v7) |
Add a new hexahedron connecting vertices v0 , v1 , v2 , v3 , v4 , v5 , v6 , v7 . | |
HalfFace | add_face (const std::vector< Vertex > &vertices) |
Add a new face connecting vertices . | |
HalfFace | add_triangle (Vertex v0, Vertex v1, Vertex v2) |
Add a new triangle face connecting vertices v0 , v1 , v2 . | |
HalfFace | add_quad (Vertex v0, Vertex v1, Vertex v2, Vertex v3) |
Add a new quad face connecting vertices v0 , v1 , v2 , v3 . | |
Memory Management | |
unsigned int | n_vertices () const |
Returns number of vertices in the mesh. | |
unsigned int | n_edges () const |
Returns number of edges in the mesh. | |
unsigned int | n_halffaces () const |
Returns number of halffaces in the mesh. | |
unsigned int | n_faces () const |
Returns number of faces in the mesh. | |
unsigned int | n_cells () const |
Returns number of cells in the mesh. | |
void | clear () |
Removes all vertices, edges, halffaces, faces, cells and properties. | |
void | resize (unsigned int nv, unsigned int ne, unsigned int nf, unsigned int nc) |
Resizes space for vertices, edges, halffaces, and their currently associated properties. | |
bool | is_valid (Vertex v) const |
Return whether vertex v is valid, i.e. the index is stored within the array bounds. | |
bool | is_valid (Edge e) const |
Return whether edge e is valid, i.e. the index is stored within the array bounds. | |
bool | is_valid (HalfFace h) const |
Return whether halfface h is valid, i.e. the index is stored within the array bounds. | |
bool | is_valid (Face f) const |
Return whether face f is valid, i.e. the index is stored within the array bounds. | |
bool | is_valid (Cell c) const |
Return whether cell c is valid, i.e. the index is stored within the array bounds. | |
Property handling | |
template<class T> | |
VertexProperty< T > | add_vertex_property (const std::string &name, const T t=T()) |
Add a vertex property of type T with name name and default value t . | |
template<class T> | |
EdgeProperty< T > | add_edge_property (const std::string &name, const T t=T()) |
Add an edge property of type T with name name and default value t . | |
template<class T> | |
HalfFaceProperty< T > | add_halfface_property (const std::string &name, const T t=T()) |
Add a halfface property of type T with name name and default value t . | |
template<class T> | |
FaceProperty< T > | add_face_property (const std::string &name, const T t=T()) |
Add a face property of type T with name name and default value t . | |
template<class T> | |
CellProperty< T > | add_cell_property (const std::string &name, const T t=T()) |
Add a cell property of type T with name name and default value t . | |
template<class T> | |
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 . | |
template<class T> | |
VertexProperty< T > | get_vertex_property (const std::string &name) const |
Get the vertex property with name name of type T . | |
template<class T> | |
EdgeProperty< T > | get_edge_property (const std::string &name) const |
Get the edge property with name name of type T . | |
template<class T> | |
HalfFaceProperty< T > | get_halfface_property (const std::string &name) const |
Get the halfface property with name name of type T . | |
template<class T> | |
FaceProperty< T > | get_face_property (const std::string &name) const |
Get the face property with name name of type T . | |
template<class T> | |
CellProperty< T > | get_cell_property (const std::string &name) const |
Get the cell property with name name of type T . | |
template<class T> | |
ModelProperty< T > | get_model_property (const std::string &name) const |
Gets the model property named name of type T . | |
template<class T> | |
VertexProperty< T > | vertex_property (const std::string &name, const T t=T()) |
If a vertex property of type T with name name exists, it is returned. Otherwise, this property is added with default value t . | |
template<class T> | |
EdgeProperty< T > | edge_property (const std::string &name, const T t=T()) |
If an edge property of type T with name name exists, it is returned. Otherwise, this property is added with default value t . | |
template<class T> | |
HalfFaceProperty< T > | halfface_property (const std::string &name, const T t=T()) |
If a halfface property of type T with name name exists, it is returned. Otherwise, this property is added with default value t . | |
template<class T> | |
FaceProperty< T > | face_property (const std::string &name, const T t=T()) |
If a face property of type T with name name exists, it is returned. Otherwise, this property is added with default value t . | |
template<class T> | |
CellProperty< T > | cell_property (const std::string &name, const T t=T()) |
If a cell property of type T with name name exists, it is returned. Otherwise, this property is added with default value t . | |
template<class T> | |
ModelProperty< T > | model_property (const std::string &name, const T t=T()) |
If a model property of type T with name name exists, it is returned. Otherwise, this property is added with default value t . | |
template<class T> | |
bool | remove_vertex_property (VertexProperty< T > &p) |
Remove the vertex property p . | |
bool | remove_vertex_property (const std::string &n) |
Remove the vertex property named n . | |
template<class T> | |
bool | remove_edge_property (EdgeProperty< T > &p) |
Remove the edge property p . | |
bool | remove_edge_property (const std::string &n) |
Remove the edge property named n . | |
template<class T> | |
bool | remove_halfface_property (HalfFaceProperty< T > &p) |
Remove the halfface property p . | |
bool | remove_halfface_property (const std::string &n) |
Remove the halfface property named n . | |
template<class T> | |
bool | remove_face_property (FaceProperty< T > &p) |
Remove the face property p . | |
bool | remove_face_property (const std::string &n) |
Remove the face property named n . | |
template<class T> | |
bool | remove_cell_property (CellProperty< T > &p) |
Remove the cell property p . | |
bool | remove_cell_property (const std::string &n) |
Remove the cell property named n . | |
template<class T> | |
bool | remove_model_property (ModelProperty< T > &p) |
Remove the model property p . | |
bool | remove_model_property (const std::string &n) |
Remove the model property named n . | |
bool | rename_vertex_property (const std::string &old_name, const std::string &new_name) |
Rename a vertex property given its name. | |
bool | rename_halfface_property (const std::string &old_name, const std::string &new_name) |
Rename a halfface property given its name. | |
bool | rename_face_property (const std::string &old_name, const std::string &new_name) |
Rename a face property given its name. | |
bool | rename_edge_property (const std::string &old_name, const std::string &new_name) |
Rename an edge property given its name. | |
bool | rename_cell_property (const std::string &old_name, const std::string &new_name) |
Rename a cell property given its name. | |
bool | rename_model_property (const std::string &old_name, const std::string &new_name) |
Rename a model property given its name. | |
const std::type_info & | get_vertex_property_type (const std::string &name) const |
Get the type information of the vertex property name . | |
const std::type_info & | get_edge_property_type (const std::string &name) const |
Get the type information of the edge property name . | |
const std::type_info & | get_halfface_property_type (const std::string &name) const |
Get the type information of the halfface property name . | |
const std::type_info & | get_face_property_type (const std::string &name) const |
Get the type information of the face property name . | |
const std::type_info & | get_cell_property_type (const std::string &name) const |
Get the type information of the cell property name . | |
const std::type_info & | get_model_property_type (const std::string &name) const |
Get the type information of the model property name . | |
std::vector< std::string > | vertex_properties () const |
Get the names of all vertex properties. | |
std::vector< std::string > | edge_properties () const |
Get the names of all edge properties. | |
std::vector< std::string > | halfface_properties () const |
Get the names of all halfface properties. | |
std::vector< std::string > | face_properties () const |
Get the names of all face properties. | |
std::vector< std::string > | cell_properties () const |
Get the names of all cell properties. | |
std::vector< std::string > | model_properties () const |
Get the names of all model properties. | |
void | property_stats (std::ostream &output) const override |
Prints the names of all properties to an output stream (e.g., std::cout). | |
Iterators & Circulators | |
VertexIterator | vertices_begin () const |
Returns an iterator to the beginning of the vertices. | |
VertexIterator | vertices_end () const |
Returns an iterator to the end of the vertices. | |
VertexContainer | vertices () const |
Returns a container for range-based iteration over vertices. | |
EdgeIterator | edges_begin () const |
Returns an iterator to the beginning of the edges. | |
EdgeIterator | edges_end () const |
Returns an iterator to the end of the edges. | |
EdgeContainer | edges () const |
Returns a container for range-based iteration over edges. | |
HalfFaceIterator | halffaces_begin () const |
Returns an iterator to the beginning of the halffaces. | |
HalfFaceIterator | halffaces_end () const |
Returns an iterator to the end of the halffaces. | |
HalffaceContainer | halffaces () const |
Returns a container for range-based iteration over halffaces. | |
FaceIterator | faces_begin () const |
Returns an iterator to the beginning of the faces. | |
FaceIterator | faces_end () const |
Returns an iterator to the end of the faces. | |
FaceContainer | faces () const |
Returns a container for range-based iteration over faces. | |
CellIterator | cells_begin () const |
Returns an iterator to the beginning of the cells. | |
CellIterator | cells_end () const |
Returns an iterator to the end of the cells. | |
CellContainer | cells () const |
Returns a container for range-based iteration over cells. | |
Adjacency access | |
const std::set< Vertex > & | vertices (Vertex v) const |
Returns the vertices around vertex v . | |
HalfFace | halfface (Face f, unsigned int i) const |
Returns the i'th halfface of face f . i has to be 0 or 1. | |
Face | face (HalfFace h) const |
Returns the face of HalfFace h . | |
HalfFace | opposite (HalfFace h) const |
Returns the twin halfface of halfface h . | |
Vertex | vertex (Edge e, unsigned int i) const |
Returns the i'th vertex of edge e . i has to be 0 or 1. | |
const std::vector< Vertex > & | vertices (HalfFace h) const |
Returns the set of vertices around halfface h . The vertices are ordered in a way such that its normal points outside of the cell associated with h . | |
const std::vector< Vertex > & | vertices (Face f) const |
Returns the set of vertices around face f . | |
const std::set< Vertex > & | vertices (Cell c) const |
Returns the set of vertices around cell c . | |
const std::set< Edge > & | edges (Vertex v) const |
Returns the set of edges around vertex v . | |
const std::set< Edge > & | edges (HalfFace h) const |
Returns the set of edges around halfface h . | |
const std::set< Edge > & | edges (Cell c) const |
Returns the set of edges around cell c . | |
const std::set< HalfFace > & | halffaces (Vertex v) const |
Returns the set of halffaces around vertex v . | |
const std::set< HalfFace > & | halffaces (Edge e) const |
Returns the set of halffaces around edge e . | |
const std::vector< HalfFace > & | halffaces (Cell c) const |
Returns the set of halffaces around cell c . | |
const std::set< Cell > & | cells (Vertex v) const |
Returns the set of cells around vertex v . | |
const std::set< Cell > & | cells (Edge e) const |
Returns the set of cells around edge e . | |
Cell | cell (HalfFace h) const |
Returns the cell associated with halfface h . | |
Higher-level Topological Operations | |
bool | is_tetraheral_mesh () const |
Returns whether the mesh is a tetrahedral mesh, i.e., every cell is a tetrahedron. | |
bool | is_border (Vertex v) const |
Returns whether v is a boundary vertex, i.e., at least one of its incident halffaces is not associated with a cell. | |
bool | is_border (Edge e) const |
Returns whether e is a boundary edge, i.e., at least one of its incident halffaces is not associated with a cell. | |
bool | is_border (HalfFace h) const |
Returns whether h is a boundary halfface, i.e., it is not associated with a cell. | |
bool | is_border (Face f) const |
Returns whether f is a boundary face, i.e., it is incident to only one cell. | |
Edge | find_edge (Vertex a, Vertex b) const |
HalfFace | find_half_face (const std::vector< Vertex > &vertices) const |
bool | is_degenerate (Face f) const |
Returns whether face f is degenerate, i.e., if it has collinear or coincident vertices. | |
void | extract_boundary (std::vector< std::vector< Vertex > > &faces) const |
![]() | |
Model (const std::string &name="unknown") | |
Default constructor. The parameter name is optional, but it is useful for handling multiple models with the same viewer. | |
void | set_name (const std::string &n) |
Sets/Changes the name of a model. Assigning a name to a model is optional, but it is useful for handling multiple models with the same viewer. | |
const std::string & | name () const |
The name of a model. | |
const Box3 & | bounding_box (bool recompute=false) const |
The bounding box of the model. | |
void | invalidate_bounding_box () |
Invalidates the bounding box of the model. So when bounding_box() is called, the bounding box will be re-computed. This function is typically called when the geometry of a model is changed. | |
bool | empty () const |
Tests if the model is empty. | |
void | set_renderer (std::shared_ptr< Renderer > r) |
Sets the renderer of this model. | |
Renderer * | renderer () |
Gets the renderer of this model. | |
const Renderer * | renderer () const |
Gets the constant renderer of this model. | |
void | set_manipulator (std::shared_ptr< Manipulator > manip) |
Attaches a manipulator to this model. | |
Manipulator * | manipulator () |
Gets the manipulator attached to this model. | |
const Manipulator * | manipulator () const |
Gets the manipulator attached to this model. | |
Geometry-related Functions | |
const vec3 & | position (Vertex v) const |
Returns the position of a vertex. | |
const std::vector< vec3 > & | points () const override |
Returns a read-only vector of all vertex positions. | |
std::vector< vec3 > & | points () override |
Returns a modifiable vector of all vertex positions. | |
void | update_face_normals () |
Computes face normals by calling compute_face_normal(HalfFace) for each face. | |
vec3 | compute_face_normal (Face f) const |
Computes the normal vector of face f . | |
void | update_vertex_normals () |
Computes vertex normals for each vertex. | |
float | edge_length (Edge e) const |
Computes the length of edge e . | |
Data structure representing a polyhedral mesh.
This implementation is inspired by Surface_mesh https://opensource.cit-ec.de/projects/surface_mesh
Copy constructor: copies rhs
to *this
. Performs a deep copy of all properties.
rhs | The PolyMesh to copy from. |
PolyMesh::Cell add_cell | ( | const std::vector< HalfFace > & | faces | ) |
Add a new cell defined by faces
.
faces | The input faces created by add_face(), add_triangle(), or add_quad(). |
|
inline |
Add a cell property of type T
with name name
and default value t
.
name | The name of the property. |
t | The default value of the property. |
Fails if a property named name
exists already, since the name has to be unique. In this case, it returns an invalid property.
|
inline |
Add an edge property of type T
with name name
and default value t
.
name | The name of the property. |
t | The default value of the property. |
Fails if a property named name
exists already, since the name has to be unique. In this case, it returns an invalid property.
PolyMesh::HalfFace add_face | ( | const std::vector< Vertex > & | vertices | ) |
Add a new face connecting vertices
.
vertices | The input vertices created by add_vertex(). |
|
inline |
Add a face property of type T
with name name
and default value t
.
name | The name of the property. |
t | The default value of the property. |
Fails if a property named name
exists already, since the name has to be unique. In this case, it returns an invalid property.
|
inline |
Add a halfface property of type T
with name name
and default value t
.
name | The name of the property. |
t | The default value of the property. |
Fails if a property named name
exists already, since the name has to be unique. In this case, it returns an invalid property.
PolyMesh::Cell add_hexa | ( | Vertex | v0, |
Vertex | v1, | ||
Vertex | v2, | ||
Vertex | v3, | ||
Vertex | v4, | ||
Vertex | v5, | ||
Vertex | v6, | ||
Vertex | v7 ) |
Add a new hexahedron connecting vertices v0
, v1
, v2
, v3
, v4
, v5
, v6
, v7
.
v0 | The first vertex created by add_vertex(). |
v1 | The second vertex created by add_vertex(). |
v2 | The third vertex created by add_vertex(). |
v3 | The fourth vertex created by add_vertex(). |
v4 | The fifth vertex created by add_vertex(). |
v5 | The sixth vertex created by add_vertex(). |
v6 | The seventh vertex created by add_vertex(). |
v7 | The eighth vertex created by add_vertex(). |
This function creates all the faces and the cell, and adds them to the mesh. The vertices must be ordered as below: 3-----------------—2 |\ |\ | \ | \ | \ | \ | 7-------------—+—6 | | | | 0—+-------------—1 | \ | \ | \ | \ | | | 4-----------------—5
|
inline |
Adds a model property of type T
with name name
and default value t
.
name | The name of the property. |
t | The default value of the property. |
Fails if a property named name
exists already, since the name has to be unique. In this case it returns an invalid property. Example:
Add a new quad face connecting vertices v0
, v1
, v2
, v3
.
v0 | The first vertex created by add_vertex(). |
v1 | The second vertex created by add_vertex(). |
v2 | The third vertex created by add_vertex(). |
v3 | The fourth vertex created by add_vertex(). |
Add a new tetrahedron defined by its faces.
f0 | The first face created by add_face() or add_triangle(). |
f1 | The second face created by add_face() or add_triangle(). |
f2 | The third face created by add_face() or add_triangle(). |
f3 | The fourth face created by add_face() or add_triangle(). |
PolyMesh::Cell add_tetra | ( | Vertex | v0, |
Vertex | v1, | ||
Vertex | v2, | ||
Vertex | v3 ) |
Add a new tetrahedron connecting vertices v0
, v1
, v2
, v3
.
v0 | The first vertex created by add_vertex(). |
v1 | The second vertex created by add_vertex(). |
v2 | The third vertex created by add_vertex(). |
v3 | The fourth vertex created by add_vertex(). |
It creates all the faces and the cell, and adds them to the mesh.
Add a new triangle face connecting vertices v0
, v1
, v2
.
v0 | The first vertex created by add_vertex(). |
v1 | The second vertex created by add_vertex(). |
v2 | The third vertex created by add_vertex(). |
Add a new vertex.
p | The position of the new vertex |
|
inline |
Add a vertex property of type T
with name name
and default value t
.
name | The name of the property. |
t | The default value of the property. |
Fails if a property named name
exists already, since the name has to be unique. In this case, it returns an invalid property.
|
inline |
Get the names of all cell properties.
|
inline |
If a cell property of type T
with name name
exists, it is returned. Otherwise, this property is added with default value t
.
name | The name of the property to get. |
t | The default value of the property. |
t
and returned.
|
inline |
Returns a container for range-based iteration over cells.
|
inline |
Returns an iterator to the beginning of the cells.
|
inline |
Returns an iterator to the end of the cells.
void clear | ( | ) |
Removes all vertices, edges, halffaces, faces, cells and properties.
After calling this method, the mesh is the same as newly constructed. The additional properties (such as normal vectors) are also removed and must thus be re-added if needed.
float edge_length | ( | Edge | e | ) | const |
|
inline |
Get the names of all edge properties.
|
inline |
If an edge property of type T
with name name
exists, it is returned. Otherwise, this property is added with default value t
.
name | The name of the property to get. |
t | The default value of the property. |
t
and returned.
|
inline |
Returns a container for range-based iteration over edges.
|
inline |
Returns an iterator to the beginning of the edges.
|
inline |
Returns an iterator to the end of the edges.
void extract_boundary | ( | std::vector< std::vector< Vertex > > & | faces | ) | const |
Extracts the boundary surface and returns its faces.
faces | A reference to a vector of vertex sequences, each defining a boundary face. |
|
inline |
Get the names of all face properties.
|
inline |
If a face property of type T
with name name
exists, it is returned. Otherwise, this property is added with default value t
.
name | The name of the property to get. |
t | The default value of the property. |
t
and returned.
|
inline |
Returns a container for range-based iteration over faces.
|
inline |
Returns an iterator to the beginning of the faces.
|
inline |
Returns an iterator to the end of the faces.
PolyMesh::Edge find_edge | ( | Vertex | a, |
Vertex | b ) const |
Finds the edge connecting vertices a
and b
.
a | The first vertex. |
b | The second vertex. |
PolyMesh::HalfFace find_half_face | ( | const std::vector< Vertex > & | vertices | ) | const |
Finds the halfface defined by a sequence of vertices
(orientation sensitive).
vertices | The ordered sequence of vertices defining the halfface. |
|
inline |
Get the cell property with name name
of type T
.
name | The name of the property to get. |
|
inline |
Get the type information of the cell property name
.
name | The name of the property. |
typeid(void)
if the property does not exist.
|
inline |
Get the edge property with name name
of type T
.
name | The name of the property to get. |
|
inline |
Get the type information of the edge property name
.
name | The name of the property. |
typeid(void)
if the property does not exist.
|
inline |
Get the face property with name name
of type T
.
name | The name of the property to get. |
|
inline |
Get the type information of the face property name
.
name | The name of the property. |
typeid(void)
if the property does not exist.
|
inline |
Get the halfface property with name name
of type T
.
name | The name of the property to get. |
|
inline |
Get the type information of the halfface property name
.
name | The name of the property. |
typeid(void)
if the property does not exist.
|
inline |
Gets the model property named name
of type T
.
name | The name of the property to get. |
|
inline |
Get the type information of the model property name
.
name | The name of the property. |
typeid(void)
if the property does not exist.
|
inline |
Get the vertex property with name name
of type T
.
name | The name of the property to get. |
|
inline |
Get the type information of the vertex property name
.
name | The name of the property. |
typeid(void)
if the property does not exist. Returns the i'th
halfface of face f
. i
has to be 0 or 1.
f | The face. |
i | The index (0 or 1). |
|
inline |
Get the names of all halfface properties.
|
inline |
If a halfface property of type T
with name name
exists, it is returned. Otherwise, this property is added with default value t
.
name | The name of the property to get. |
t | The default value of the property. |
t
and returned.
|
inline |
Returns a container for range-based iteration over halffaces.
|
inline |
Returns an iterator to the beginning of the halffaces.
|
inline |
Returns an iterator to the end of the halffaces.
|
inline |
Returns whether e
is a boundary edge, i.e., at least one of its incident halffaces is not associated with a cell.
e | The edge. |
e
is a boundary edge, false otherwise.
|
inline |
Returns whether f
is a boundary face, i.e., it is incident to only one cell.
f | The Face. |
f
is a boundary face, false otherwise.
|
inline |
Returns whether h
is a boundary halfface, i.e., it is not associated with a cell.
h | The HalfFace. |
h
is a boundary halfface, false otherwise.
|
inline |
Returns whether v
is a boundary vertex, i.e., at least one of its incident halffaces is not associated with a cell.
v | The vertex. |
v
is a boundary vertex, false otherwise. bool is_degenerate | ( | Face | f | ) | const |
Returns whether face f
is degenerate, i.e., if it has collinear or coincident vertices.
f | The Face. |
bool is_tetraheral_mesh | ( | ) | const |
Returns whether the mesh is a tetrahedral mesh, i.e., every cell is a tetrahedron.
|
inline |
Return whether cell c
is valid, i.e. the index is stored within the array bounds.
c | The cell to check. |
|
inline |
Return whether edge e
is valid, i.e. the index is stored within the array bounds.
e | The edge to check. |
|
inline |
Return whether face f
is valid, i.e. the index is stored within the array bounds.
f | The face to check. |
|
inline |
Return whether halfface h
is valid, i.e. the index is stored within the array bounds.
h | The halfface to check. |
|
inline |
Return whether vertex v
is valid, i.e. the index is stored within the array bounds.
v | The vertex to check. |
|
inline |
Get the names of all model properties.
|
inline |
If a model property of type T
with name name
exists, it is returned. Otherwise, this property is added with default value t
.
name | The name of the property to get. |
t | The default value of the property. |
t
and returned.
|
inline |
Returns number of cells in the mesh.
|
inline |
Returns number of edges in the mesh.
|
inline |
Returns number of faces in the mesh.
|
inline |
Returns number of halffaces in the mesh.
|
inline |
Returns number of vertices in the mesh.
|
inlineoverridevirtual |
Returns a read-only vector of all vertex positions.
Implements Model.
|
inlineoverridevirtual |
Returns a modifiable vector of all vertex positions.
Implements Model.
Returns the position of a vertex.
v | The vertex. |
|
overridevirtual |
Prints the names of all properties to an output stream (e.g., std::cout).
output | The output stream. |
Reimplemented from Model.
bool read | ( | const std::string & | filename | ) |
Read mesh from a PM file filename
.
Mainly for quick debug purposes. Client code should use PolyMeshIO.
filename | The name of the file to read from. |
|
inline |
Remove the cell property p
.
p | The property to remove. |
|
inline |
Remove the cell property named n
.
n | The name of the property to remove. |
|
inline |
Remove the edge property named n
.
n | The name of the property to remove. |
|
inline |
Remove the edge property p
.
p | The property to remove. |
|
inline |
Remove the face property named n
.
n | The name of the property to remove. |
|
inline |
Remove the face property p
.
p | The property to remove. |
|
inline |
Remove the halfface property named n
.
n | The name of the property to remove. |
|
inline |
Remove the halfface property p
.
p | The property to remove. |
|
inline |
Remove the model property named n
.
n | The name of the property to remove. |
|
inline |
Remove the model property p
.
p | The property to remove. |
|
inline |
Remove the vertex property named n
.
n | The name of the property to remove. |
|
inline |
Remove the vertex property p
.
p | The property to remove. |
|
inline |
Rename a cell property given its name.
old_name | The old name of the property. |
new_name | The new name of the property. |
|
inline |
Rename an edge property given its name.
old_name | The old name of the property. |
new_name | The new name of the property. |
|
inline |
Rename a face property given its name.
old_name | The old name of the property. |
new_name | The new name of the property. |
|
inline |
Rename a halfface property given its name.
old_name | The old name of the property. |
new_name | The new name of the property. |
|
inline |
Rename a model property given its name.
old_name | The old name of the property. |
new_name | The new name of the property. |
|
inline |
Rename a vertex property given its name.
old_name | The old name of the property. |
new_name | The new name of the property. |
|
inline |
Resizes space for vertices, edges, halffaces, and their currently associated properties.
nv | Number of vertices. |
ne | Number of edges. |
nf | Number of faces. |
nc | Number of cells. |
nf is the number of faces. For halffaces, nh = 2 * nf.
void update_vertex_normals | ( | ) |
Computes vertex normals for each vertex.
|
inline |
Get the names of all vertex properties.
|
inline |
If a vertex property of type T
with name name
exists, it is returned. Otherwise, this property is added with default value t
.
name | The name of the property to get. |
t | The default value of the property. |
t
and returned.
|
inline |
Returns a container for range-based iteration over vertices.
Returns the set of vertices around face f
.
f | The Face. |
Returns the set of vertices around halfface h
. The vertices are ordered in a way such that its normal points outside of the cell associated with h
.
h | The HalfFace. |
Returns the vertices around vertex v
.
v | The vertex. |
|
inline |
Returns an iterator to the beginning of the vertices.
|
inline |
Returns an iterator to the end of the vertices.
bool write | ( | const std::string & | filename | ) | const |
Write mesh to a PM file filename
.
Mainly for quick debug purposes. Client code should use PolyMeshIO.
filename | The name of the file to write to. |