Volume Cartographer 2.28.0
AngleBasedFlattening.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6#include <memory>
7
8#include <opencv2/core.hpp>
9
13
14namespace volcart::texturing
15{
28{
29public:
31 enum class Solver { SparseLU = 0, ConjugateGradient = 1 };
32
34 static constexpr std::size_t DEFAULT_ITERATIONS{10};
35
37 using Pointer = std::shared_ptr<AngleBasedFlattening>;
38
42
44 explicit AngleBasedFlattening(const ITKMesh::Pointer& m);
45
47 template <typename... Args>
48 static auto New(Args... args) -> Pointer
49 {
50 return std::make_shared<AngleBasedFlattening>(
51 std::forward<Args>(args)...);
52 }
53
55 ~AngleBasedFlattening() override = default;
65 void setUseABF(bool a);
66
68 [[nodiscard]] auto useABF() const -> bool;
69
71 void setABFMaxIterations(std::size_t i);
72
74 [[nodiscard]] auto abfMaxIterations() const -> std::size_t;
86 void setUseHLSCM(bool h);
87
89 [[nodiscard]] auto useHLSCM() const -> bool;
104
106 [[nodiscard]] auto solver() const -> Solver;
111 auto compute() -> ITKMesh::Pointer override;
114private:
116 bool useABF_{true};
118 bool useHLSCM_{false};
120 Solver solver_{Solver::SparseLU};
123};
124} // namespace volcart::texturing
void setUseABF(bool a)
Whether to perform Angle-based flattening computation.
auto useABF() const -> bool
Whether Angle-based flattening is performed.
auto compute() -> ITKMesh::Pointer override
Compute the parameterization.
static constexpr std::size_t DEFAULT_ITERATIONS
auto useHLSCM() const -> bool
Whether HierarchicalLSCM is used.
std::shared_ptr< AngleBasedFlattening > Pointer
void setABFMaxIterations(std::size_t i)
The max number of ABF minimization iterations.
void setUseHLSCM(bool h)
Whether to use HierarchicalLSCM for parameterization.
auto solver() const -> Solver
The numerical solver method.
void setSolver(Solver solver)
The numerical solver method.
static auto New(Args... args) -> Pointer
AngleBasedFlattening(const ITKMesh::Pointer &m)
Construct and set the input mesh.
AngleBasedFlattening()=default
Default constructor.
auto abfMaxIterations() const -> std::size_t
The max number of ABF minimization iterations.
Texturing and parameterization algorithms and utilities library.
itk::Mesh< ITKPixel, 3, ITKMeshTraits > ITKMesh
Definition: ITKMesh.hpp:22