Polyhedral-net Splines
Loading...
Searching...
No Matches
RegularPatchConstructor.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 "../Helper/Helper.hpp"
7#include "PatchConstructor.hpp"
8
9
10typedef Matrix Mat9x9d;
11
16class RegularPatchConstructor : public PatchConstructor
17{
18public:
19 RegularPatchConstructor() {};
20
21 bool isSamePatchType(const VertexHandle& a_VertexHandle, MeshType& a_Mesh, bool check_marked = false) override;
22 PatchBuilder getPatchBuilder(const VertexHandle& a_VertexHandle, MeshType& a_Mesh, bool mark_gathered = false) override;
23
24 Patch getPatch(const std::vector<VertexHandle>& a_NBVertexHandles, MeshType& a_Mesh);
25 Matrix getPatchMat(const std::vector<VertexHandle>& a_NBVertexHandles, MeshType& a_Mesh);
26
27private:
28 const Mat9x9d m_Mask = Matrix({
29 {0.25, 0.25, 0, 0.25, 0.25, 0, 0, 0, 0},
30 {0, 0.5, 0, 0, 0.5, 0, 0, 0, 0},
31 {0, 0.25, 0.25, 0, 0.25, 0.25, 0, 0, 0},
32 {0, 0, 0, 0.5, 0.5, 0, 0, 0, 0},
33 {0, 0, 0, 0, 1, 0, 0, 0, 0},
34 {0, 0, 0, 0, 0.5, 0.5, 0, 0, 0},
35 {0, 0, 0, 0.25, 0.25, 0, 0.25, 0.25, 0},
36 {0, 0, 0, 0, 0.5, 0, 0, 0.5, 0},
37 {0, 0, 0, 0, 0.25, 0.25, 0, 0.25, 0.25}
38 });
39
53 std::vector<VertexHandle> initNeighborVerts(const VertexHandle& a_VertexHandle, MeshType& a_Mesh);
54
55 std::string getGroupName() const;
56};
Definition Matrix.hpp:11
A builder class for constructing Bézier patches from a mesh.
Definition PatchBuilder.hpp:28
Abstract base class for patch constructors.
Definition PatchConstructor.hpp:66
PatchBuilder getPatchBuilder(const VertexHandle &a_VertexHandle, MeshType &a_Mesh, bool mark_gathered=false) override
Constructs a PatchBuilder for the patch type at the given vertex.
Definition RegularPatchConstructor.cpp:48
std::string getGroupName() const
Returns the name of the patch group this constructor handles.
Definition RegularPatchConstructor.cpp:132
std::vector< VertexHandle > initNeighborVerts(const VertexHandle &a_VertexHandle, MeshType &a_Mesh)
Gather the list of neighboring vertices around a given vertex in the expected order to be compatable ...
Definition RegularPatchConstructor.cpp:64
bool isSamePatchType(const VertexHandle &a_VertexHandle, MeshType &a_Mesh, bool check_marked=false) override
Given a vertex, checks wither the vertex and the neighborhood arund the vertex of this patch type.
Definition RegularPatchConstructor.cpp:9
A class representing a Bézier patch.
Definition Patch.hpp:20