Class to manage a hierarchy of meshes with different resolutions.
More...
#include <MeshHierarchy.h>
|
| MeshHierarchyManager (int min_vertices=1000, int max_vertices=10000) |
| Constructor.
|
|
int | generateHierarchyFromFile (const std::string &input_mesh_file, const std::string &output_dir, bool fill_volume=true) |
| Generate hierarchy of meshes from input mesh file.
|
|
void | setMaxVertices (int max_vertices) |
| Set the maximum number of vertices for level 1.
|
|
void | setMinVertices (int min_vertices) |
| Set the minimum number of vertices for coarsest level.
|
|
int | getNumLevels () const |
| Get the number of levels in the last generated hierarchy.
|
|
|
void | initializeGeogram () |
| Initialize Geogram if not already initialized.
|
|
bool | loadVolumeMesh (const std::string &filename, GEO::Mesh &M, bool fill_volume) const |
| Load a volume mesh from file.
|
|
int | getPointsForLevel (int base_points, int level) const |
| Calculate number of points for a given level.
|
|
void | ensureDirectoryExists (const std::string &path) const |
| Ensure directory exists, create if it doesn't.
|
|
Class to manage a hierarchy of meshes with different resolutions.
Definition at line 13 of file MeshHierarchy.h.
◆ MeshHierarchyManager()
MeshHierarchy::MeshHierarchyManager::MeshHierarchyManager |
( |
int |
min_vertices = 1000 , |
|
|
int |
max_vertices = 10000 |
|
) |
| |
Constructor.
- Parameters
-
min_vertices | Minimum number of vertices for the coarsest level |
max_vertices | Maximum number of vertices for level 1 mesh |
Definition at line 16 of file MeshHierarchy.cc.
◆ generateHierarchyFromFile()
int MeshHierarchy::MeshHierarchyManager::generateHierarchyFromFile |
( |
const std::string & |
input_mesh_file, |
|
|
const std::string & |
output_dir, |
|
|
bool |
fill_volume = true |
|
) |
| |
Generate hierarchy of meshes from input mesh file.
- Parameters
-
input_mesh_file | Path to the input mesh file |
output_dir | Directory to save the mesh hierarchy |
fill_volume | Whether to fill volume with tetrahedra (true for 3D, false for 2D surface meshes) |
- Returns
- Number of levels generated
- Exceptions
-
std::runtime_error | if mesh loading or processing fails |
Definition at line 112 of file MeshHierarchy.cc.
◆ setMaxVertices()
void MeshHierarchy::MeshHierarchyManager::setMaxVertices |
( |
int |
max_vertices | ) |
|
Set the maximum number of vertices for level 1.
Definition at line 79 of file MeshHierarchy.cc.
◆ setMinVertices()
void MeshHierarchy::MeshHierarchyManager::setMinVertices |
( |
int |
min_vertices | ) |
|
Set the minimum number of vertices for coarsest level.
Definition at line 83 of file MeshHierarchy.cc.
◆ getNumLevels()
int MeshHierarchy::MeshHierarchyManager::getNumLevels |
( |
| ) |
const |
Get the number of levels in the last generated hierarchy.
Definition at line 87 of file MeshHierarchy.cc.
◆ initializeGeogram()
void MeshHierarchy::MeshHierarchyManager::initializeGeogram |
( |
| ) |
|
|
private |
Initialize Geogram if not already initialized.
Definition at line 23 of file MeshHierarchy.cc.
◆ loadVolumeMesh()
bool MeshHierarchy::MeshHierarchyManager::loadVolumeMesh |
( |
const std::string & |
filename, |
|
|
GEO::Mesh & |
M, |
|
|
bool |
fill_volume |
|
) |
| const |
|
private |
Load a volume mesh from file.
- Parameters
-
filename | Path to the mesh file |
M | Reference to the Geogram mesh object |
fill_volume | Whether to fill volume with tetrahedra (true for 3D, false for 2D surface meshes) |
Definition at line 32 of file MeshHierarchy.cc.
◆ getPointsForLevel()
int MeshHierarchy::MeshHierarchyManager::getPointsForLevel |
( |
int |
base_points, |
|
|
int |
level |
|
) |
| const |
|
private |
Calculate number of points for a given level.
Definition at line 97 of file MeshHierarchy.cc.
◆ ensureDirectoryExists()
void MeshHierarchy::MeshHierarchyManager::ensureDirectoryExists |
( |
const std::string & |
path | ) |
const |
|
private |
Ensure directory exists, create if it doesn't.
Definition at line 91 of file MeshHierarchy.cc.
◆ min_vertices_
int MeshHierarchy::MeshHierarchyManager::min_vertices_ |
|
private |
◆ max_vertices_
int MeshHierarchy::MeshHierarchyManager::max_vertices_ |
|
private |
◆ num_levels_
int MeshHierarchy::MeshHierarchyManager::num_levels_ |
|
private |
◆ is_initialized_
bool MeshHierarchy::MeshHierarchyManager::is_initialized_ |
|
private |
The documentation for this class was generated from the following files: