SemiDiscreteOT 1.0
Semi-Discrete Optimal Transport Library
Loading...
Searching...
No Matches
MeshHierarchy.h
Go to the documentation of this file.
1#ifndef MESH_HIERARCHY_H
2#define MESH_HIERARCHY_H
3
4#include <geogram/basic/common.h>
5#include <geogram/mesh/mesh.h>
6#include <string>
7
8namespace MeshHierarchy {
9
14public:
20 MeshHierarchyManager(int min_vertices = 1000, int max_vertices = 10000);
21
30 int generateHierarchyFromFile(const std::string& input_mesh_file, const std::string& output_dir, bool fill_volume = true);
31
35 void setMaxVertices(int max_vertices);
36
40 void setMinVertices(int min_vertices);
41
45 int getNumLevels() const;
46
47private:
52
56 void initializeGeogram();
57
64 bool loadVolumeMesh(const std::string& filename, GEO::Mesh& M, bool fill_volume) const;
65
69 int getPointsForLevel(int base_points, int level) const;
70
74 void ensureDirectoryExists(const std::string& path) const;
75};
76
77} // namespace MeshHierarchy
78
79#endif // MESH_HIERARCHY_H
Class to manage a hierarchy of meshes with different resolutions.
int getPointsForLevel(int base_points, int level) const
Calculate number of points for a given level.
int getNumLevels() const
Get the number of levels in the last generated hierarchy.
void setMaxVertices(int max_vertices)
Set the maximum number of vertices for level 1.
bool loadVolumeMesh(const std::string &filename, GEO::Mesh &M, bool fill_volume) const
Load a volume mesh from file.
void ensureDirectoryExists(const std::string &path) const
Ensure directory exists, create if it doesn't.
void setMinVertices(int min_vertices)
Set the minimum number of vertices for coarsest level.
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 initializeGeogram()
Initialize Geogram if not already initialized.