OpenMEEG
|
#include <mesh.h>
Inherits Triangles.
Public Types | |
typedef std::vector< Triangle * > | VectPTriangle |
typedef std::vector< Vertex * > | VectPVertex |
typedef VectPVertex::iterator | vertex_iterator |
typedef VectPVertex::const_iterator | const_vertex_iterator |
typedef VectPVertex::const_reverse_iterator | const_vertex_reverse_iterator |
Public Member Functions | |
Mesh () | |
default constructor More... | |
Mesh (const unsigned &nv, const unsigned &nt) | |
constructor from scratch (add vertices/triangles one by one) More... | |
Mesh (const Mesh &m) | |
constructor from another mesh More... | |
Mesh (Vertices &av, const std::string name="") | |
constructor using an outisde storage for vertices More... | |
Mesh (std::string filename, const bool verbose=true, const std::string n="") | |
constructor loading directly a mesh file named More... | |
~Mesh () | |
Destructor. More... | |
vertex_iterator | vertex_begin () |
vertex_iterator | vertex_end () |
size_t | vertex_size () const |
const_vertex_iterator | vertex_begin () const |
const_vertex_iterator | vertex_end () const |
const_vertex_reverse_iterator | vertex_rbegin () const |
const_vertex_reverse_iterator | vertex_rend () const |
std::string & | name () |
const std::string & | name () const |
const VectPVertex & | vertices () const |
size_t | nb_vertices () const |
size_t | nb_triangles () const |
Vertices | all_vertices () const |
size_t | nb_all_vertices () const |
void | add_vertex (const Vertex &v) |
properly add vertex to the list. More... | |
*void | info (const bool verbous=false) const |
Print info Print to std::cout some info about the mesh. More... | |
bool | has_self_intersection () const |
check if the mesh self-intersects More... | |
bool | intersection (const Mesh &) const |
check if the mesh intersects another mesh More... | |
bool | has_correct_orientation () const |
check the local orientation of the mesh triangles More... | |
void | build_mesh_vertices () |
construct the list of the mesh vertices out of its triangles More... | |
void | generate_indices () |
generate indices (if allocate) More... | |
void | update () |
recompute triangles normals, area, and links More... | |
void | merge (const Mesh &, const Mesh &) |
properly merge two meshes into one More... | |
void | flip_triangles () |
Flip all triangles. More... | |
void | correct_local_orientation () |
correct the local orientation of the mesh triangles More... | |
void | correct_global_orientation () |
correct the global orientation (if there is one) More... | |
double | compute_solid_angle (const Vect3 &p) const |
Given a point p, it computes the solid angle. More... | |
const VectPTriangle & | get_triangles_for_vertex (const Vertex &V) const |
get the triangles associated with vertex V More... | |
VectPTriangle | adjacent_triangles (const Triangle &) const |
get the adjacent triangles More... | |
Normal | normal (const Vertex &v) const |
get the Normal at vertex More... | |
void | laplacian (SymMatrix &A) const |
compute mesh laplacian More... | |
bool & | outermost () |
const bool & | outermost () const |
Returns True if it is an outermost mesh. More... | |
void | smooth (const double &smoothing_intensity, const unsigned &niter) |
Smooth Mesh. More... | |
void | gradient_norm2 (SymMatrix &A) const |
Compute the square norm of the surfacic gradient. More... | |
unsigned | load (const std::string &filename, const bool &verbose=true, const bool &read_all=true) |
Read mesh from file. More... | |
unsigned | load_tri (std::istream &, const bool &read_all=true) |
unsigned | load_tri (const std::string &, const bool &read_all=true) |
unsigned | load_bnd (std::istream &, const bool &read_all=true) |
unsigned | load_bnd (const std::string &, const bool &read_all=true) |
unsigned | load_off (std::istream &, const bool &read_all=true) |
unsigned | load_off (const std::string &, const bool &read_all=true) |
unsigned | load_mesh (std::istream &, const bool &read_all=true) |
unsigned | load_mesh (const std::string &, const bool &read_all=true) |
template<typename T > | |
unsigned | load_vtk (T, const bool &read_all=true) |
template<typename T > | |
unsigned | load_gifti (T, const bool &) |
template<typename T > | |
void | save_gifti (T) const |
*void | save (const std::string &filename) const |
Save mesh to file. More... | |
void | save_vtk (const std::string &) const |
void | save_bnd (const std::string &) const |
void | save_tri (const std::string &) const |
void | save_off (const std::string &) const |
void | save_mesh (const std::string &) const |
Mesh & | operator= (const Mesh &m) |
const bool & | current_barrier () const |
bool & | current_barrier () |
const bool & | isolated () const |
bool & | isolated () |
Private Types | |
typedef std::map< std::pair < const Vertex *, const Vertex * > , int > | EdgeMap |
map the edges with an unsigned More... | |
Private Member Functions | |
void | destroy () |
void | copy (const Mesh &) |
const EdgeMap | compute_edge_map () const |
void | orient_adjacent_triangles (std::stack< Triangle * > &t_stack, std::map< Triangle *, bool > &tri_reoriented) |
bool | triangle_intersection (const Triangle &, const Triangle &) const |
Vect3 | P1gradient (const Vect3 &p0, const Vect3 &p1, const Vect3 &p2) const |
P1gradient : aux function to compute the surfacic gradient. More... | |
double | P0gradient_norm2 (const Triangle &t1, const Triangle &t2) const |
P0gradient_norm2 : aux function to compute the square norm of the surfacic gradient. More... | |
Private Attributes | |
std::string | name_ |
Name of the mesh. More... | |
std::map< const Vertex *, VectPTriangle > | links_ |
links[&v] are the triangles that contain vertex v. More... | |
Vertices * | all_vertices_ |
Pointer to all the vertices. More... | |
VectPVertex | vertices_ |
Vector of pointers to the mesh vertices. More... | |
bool | outermost_ |
Is it an outermost mesh ? (i.e does it touch the Air domain) More... | |
bool | allocate_ |
Are the vertices allocate within the mesh or shared ? More... | |
std::set< Vertex > | set_vertices_ |
bool | current_barrier_ |
handle multiple 0 conductivity domains More... | |
bool | isolated_ |
Friends | |
std::istream & | operator>> (std::istream &is, Mesh &m) |
insert a triangle into the mesh More... | |
typedef std::vector<Triangle*> OpenMEEG::Mesh::VectPTriangle |
typedef std::vector<Vertex*> OpenMEEG::Mesh::VectPVertex |
typedef VectPVertex::iterator OpenMEEG::Mesh::vertex_iterator |
typedef VectPVertex::const_iterator OpenMEEG::Mesh::const_vertex_iterator |
typedef VectPVertex::const_reverse_iterator OpenMEEG::Mesh::const_vertex_reverse_iterator |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void OpenMEEG::Mesh::add_vertex | ( | const Vertex & | v | ) |
properly add vertex to the list.
* void OpenMEEG::Mesh::info | ( | const bool | verbous = false | ) | const |
Print info Print to std::cout some info about the mesh.
bool OpenMEEG::Mesh::has_self_intersection | ( | ) | const |
check if the mesh self-intersects
bool OpenMEEG::Mesh::intersection | ( | const Mesh & | ) | const |
check if the mesh intersects another mesh
bool OpenMEEG::Mesh::has_correct_orientation | ( | ) | const |
check the local orientation of the mesh triangles
void OpenMEEG::Mesh::build_mesh_vertices | ( | ) |
construct the list of the mesh vertices out of its triangles
void OpenMEEG::Mesh::generate_indices | ( | ) |
generate indices (if allocate)
void OpenMEEG::Mesh::update | ( | ) |
recompute triangles normals, area, and links
|
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::compute_solid_angle | ( | const Vect3 & | p | ) | const |
Given a point p, it computes the solid angle.
const VectPTriangle& OpenMEEG::Mesh::get_triangles_for_vertex | ( | const Vertex & | V | ) | const |
get the triangles associated with vertex V
VectPTriangle OpenMEEG::Mesh::adjacent_triangles | ( | const Triangle & | ) | const |
get the adjacent triangles
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.
unsigned OpenMEEG::Mesh::load | ( | const std::string & | filename, |
const bool & | verbose = true , |
||
const bool & | read_all = true |
||
) |
Read mesh from file.
filename | can be .vtk, .tri (ascii), .off .bnd or .mesh. Be verbose if |
verbose | is true. Id |
read_all | is false then it only returns the total number of vertices. |
unsigned OpenMEEG::Mesh::load_tri | ( | std::istream & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_tri | ( | const std::string & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_bnd | ( | std::istream & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_bnd | ( | const std::string & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_off | ( | std::istream & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_off | ( | const std::string & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_mesh | ( | std::istream & | , |
const bool & | read_all = true |
||
) |
unsigned OpenMEEG::Mesh::load_mesh | ( | const std::string & | , |
const bool & | read_all = true |
||
) |
|
inline |
|
inline |
|
inline |
* void OpenMEEG::Mesh::save | ( | const std::string & | filename | ) | const |
Save mesh to file.
filename | can be .vtk, .tri (ascii), .bnd, .off or .mesh |
void OpenMEEG::Mesh::save_vtk | ( | const std::string & | ) | const |
void OpenMEEG::Mesh::save_bnd | ( | const std::string & | ) | const |
void OpenMEEG::Mesh::save_tri | ( | const std::string & | ) | const |
void OpenMEEG::Mesh::save_off | ( | const std::string & | ) | const |
void OpenMEEG::Mesh::save_mesh | ( | const std::string & | ) | const |
|
private |
|
private |
|
private |
|
private |
|
friend |
insert a triangle into the mesh
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |