Polyhedral-net Splines
Loading...
Searching...
No Matches
Pool.hpp
1/* copyright(c)Jorg Peters [jorg.peters@gmail.com] */
2
3#pragma once
4
5#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
6#include "../Patch/Patch.hpp"
7#include "../Patch/T0PatchConstructor.hpp"
8#include "../Patch/T1PatchConstructor.hpp"
9#include "../Patch/T2PatchConstructor.hpp"
10#include "../Patch/ExtraordinaryPatchConstructor.hpp"
11// #include "../Patch/TwoTrianglesTwoQuadsPatchConstructor.hpp"
12#include "../Patch/NGonPatchConstructor.hpp"
13#include "../Patch/PolarPatchConstructor.hpp"
14#include "../Patch/RegularPatchConstructor.hpp"
15
16/*
17 * Store the pointers of patch constructor
18 */
19
31class PatchConstructorPool
32{
33public:
34 PatchConstructorPool()
35 {
36 // Functions to generate patches
37 m_PatchConstructorPool.push_back(new PolarPatchConstructor()); // Polar must be before Regular & Extraordinary
40 // m_PatchConstructorPool.push_back(new TwoTrianglesTwoQuadsPatchConstructor()); // deprecated
45 }
46 template <typename T> PatchConstructor* getPatchConstructor(const T& a_T, MeshType& a_Mesh, bool check_marked = false) const;
47
48private:
53 std::vector<PatchConstructor*> m_PatchConstructorPool;
54};
55
65template <typename T> PatchConstructor* PatchConstructorPool::getPatchConstructor(const T& a_T, MeshType& a_Mesh, bool check_marked) const
66{
67 for(auto t_PatchConstructor : m_PatchConstructorPool)
68 {
69 if(t_PatchConstructor->isSamePatchType(a_T, a_Mesh, check_marked))
70 {
71 return t_PatchConstructor;
72 }
73 }
74 return nullptr;
75}
76template PatchConstructor* PatchConstructorPool::getPatchConstructor(const VertexHandle& a_VertexHandle, MeshType& a_Mesh, bool check_marked) const;
77template PatchConstructor* PatchConstructorPool::getPatchConstructor(const FaceHandle& a_FaceHandle, MeshType& a_Mesh, bool check_marked) const;
Patch constructor for extraordinary patches. See PatchConstructor.
Definition ExtraordinaryPatchConstructor.hpp:20
Patch constructor for n-gon patches. See PatchConstructor.
Definition NGonPatchConstructor.hpp:20
Abstract base class for patch constructors.
Definition PatchConstructor.hpp:66
PatchConstructor * getPatchConstructor(const T &a_T, MeshType &a_Mesh, bool check_marked=false) const
Find a patch PatchConstructor that matches the given vertex or face.
Definition Pool.hpp:65
std::vector< PatchConstructor * > m_PatchConstructorPool
The list of that contains an object for each PatchConstructor subclasses that are considered.
Definition Pool.hpp:53
Patch constructor for polar patches. See PatchConstructor.
Definition PolarPatchConstructor.hpp:19
Patch constructor for regular patches. See PatchConstructor.
Definition RegularPatchConstructor.hpp:17
Patch constructor for T0 patches. See PatchConstructor.
Definition T0PatchConstructor.hpp:16
Patch constructor for T1 patches. See PatchConstructor.
Definition T1PatchConstructor.hpp:16
Patch constructor for T2 patches. See PatchConstructor.
Definition T2PatchConstructor.hpp:16