OpenMEEG
|
#include <mesh.h>
Public Types | |
typedef std::map< const Vertex *, TrianglesRefs > | VertexTriangles |
Public Member Functions | |
Mesh (Geometry *geometry=nullptr) | |
Default constructor or constructor using a provided geometry. | |
Mesh (const unsigned nv, const unsigned nt, Geometry *geometry=nullptr) | |
Constructor from scratch (vertices/triangles t be added) | |
Mesh (const Mesh &)=default | |
Mesh (Mesh &&m)=default | |
Mesh & | operator= (const Mesh &)=default |
Mesh (const std::string &filename, const bool verbose, Geometry *geometry=nullptr) | |
Constructors. | |
Mesh (const std::string &filename, Geometry *geometry=nullptr) | |
~Mesh () | |
Destructor. | |
std::string & | name () |
const std::string & | name () const |
VerticesRefs & | vertices () |
const VerticesRefs & | vertices () const |
Geometry & | geometry () const |
Triangles & | triangles () |
const Triangles & | triangles () const |
TriangleIndices | triangle (const Triangle &t) const |
bool | current_barrier () const |
bool & | current_barrier () |
bool | isolated () const |
bool & | isolated () |
Triangle & | add_triangle (const TriangleIndices inds) |
Add a triangle specified by its indices in the geometry. | |
Triangle & | add_triangle (const TriangleIndices inds, const IndexMap &indmap) |
void | add (const std::vector< TriangleIndices > &trgs) |
void | add (const std::vector< TriangleIndices > &trgs, const IndexMap &indmap) |
bool | operator== (const Mesh &m) const |
bool | operator!= (const Mesh &m) const |
void | info (const bool verbose=false) const |
Print info Print to std::cout some info about the mesh. | |
bool | has_self_intersection () const |
Check whether the mesh self-intersects. | |
bool | intersection (const Mesh &) const |
Check whether the mesh intersects another mesh. | |
bool | has_correct_orientation () const |
Check local orientation of mesh triangles. | |
void | generate_indices () |
Generate indices (if allocate). | |
void | update (const bool topology_changed) |
Recompute triangles normals, area, and vertex triangles. | |
void | merge (const Mesh &, const Mesh &) |
Merge two meshes. | |
Ranges | vertices_ranges () const |
Get the ranges of the specific mesh in the global matrix. | |
Range | triangles_range () const |
TrianglesRefs | triangles (const Vertex &V) const |
Get the triangles adjacent to vertex. | |
TrianglesRefs | adjacent_triangles (const Triangle &triangle) const |
Get the triangles adjacent to. | |
void | change_orientation () |
Change mesh orientation. | |
void | correct_local_orientation () |
Correct the local orientation of the mesh triangles. | |
void | correct_global_orientation () |
Correct the global orientation (if there is one). | |
double | solid_angle (const Vect3 &p) const |
Given a point p, computes the solid angle of the mesh seen from. | |
Normal | normal (const Vertex &v) const |
Get normal at vertex.`. | |
void | laplacian (SymMatrix &A) const |
Compute mesh laplacian. | |
bool & | outermost () |
bool | outermost () const |
Returns True if it is an outermost mesh. | |
void | smooth (const double &smoothing_intensity, const unsigned &niter) |
Smooth Mesh. | |
void | gradient_norm2 (SymMatrix &A) const |
Compute the square norm of the surfacic gradient. | |
void | load (const std::string &filename, const bool verbose=true) |
Read mesh from file. | |
void | save (const std::string &filename) const |
Save mesh to file. | |
Friends | |
class | Geometry |
class | MeshIO |
typedef std::map<const Vertex*,TrianglesRefs> OpenMEEG::Mesh::VertexTriangles |
|
inline |
OpenMEEG::Mesh::Mesh | ( | const unsigned | nv, |
const unsigned | nt, | ||
Geometry * | geometry = nullptr |
||
) |
Constructor from scratch (vertices/triangles t be added)
nv | space to allocate for vertices |
nt | space to allocate for triangles |
geometry | the geometry to use |
|
default |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
TriangleIndices OpenMEEG::Mesh::triangle | ( | const Triangle & | t | ) | const |
Triangle & OpenMEEG::Mesh::add_triangle | ( | const TriangleIndices | inds | ) |
Add a triangle specified by its indices in the geometry.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void OpenMEEG::Mesh::info | ( | const bool | verbose = false | ) | const |
Print info Print to std::cout some info about the mesh.
Print mesh information.
bool OpenMEEG::Mesh::has_self_intersection | ( | ) | const |
Check whether the mesh self-intersects.
bool OpenMEEG::Mesh::intersection | ( | const Mesh & | ) | const |
Check whether the mesh intersects another mesh.
bool OpenMEEG::Mesh::has_correct_orientation | ( | ) | const |
Check local orientation of mesh triangles.
void OpenMEEG::Mesh::generate_indices | ( | ) |
Generate indices (if allocate).
void OpenMEEG::Mesh::update | ( | const bool | topology_changed | ) |
Recompute triangles normals, area, and vertex triangles.
|
inline |
|
inline |
|
inline |
|
inline |
void OpenMEEG::Mesh::correct_local_orientation | ( | ) |
Correct the local orientation of the mesh triangles.
void OpenMEEG::Mesh::correct_global_orientation | ( | ) |
Correct the global orientation (if there is one).
double OpenMEEG::Mesh::solid_angle | ( | const Vect3 & | p | ) | const |
Given a point p, computes the solid angle of the mesh seen from.
p | . |
void OpenMEEG::Mesh::laplacian | ( | SymMatrix & | A | ) | const |
Compute mesh laplacian.
|
inline |
void OpenMEEG::Mesh::smooth | ( | const double & | smoothing_intensity, |
const unsigned & | niter | ||
) |
void OpenMEEG::Mesh::gradient_norm2 | ( | SymMatrix & | A | ) | const |
Compute the square norm of the surfacic gradient.
void OpenMEEG::Mesh::load | ( | const std::string & | filename, |
const bool | verbose = true |
||
) |
Read mesh from file.
filename | can be .vtk, .tri (ascii), .off, .bnd or .mesh. Be verbose if |
verbose | is true. The difference between read and load is that read just reads the file and does not update the geometry. Read has to be used when multiple meshes are used in a geometry. load reads a mesh. |
void OpenMEEG::Mesh::save | ( | const std::string & | filename | ) | const |
Save mesh to file.
filename | can be .vtk, .tri (ascii), .bnd, .off or .mesh |