Polyhedral-net Splines
Loading...
Searching...
No Matches
TwoTrianglesTwoQuadsPatchConstructor.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 "PatchConstructor.hpp"
7#include "../Helper/Helper.hpp"
8
9typedef Matrix Mat9x9d;
10typedef Matrix Mat9x3d;
11
17class TwoTrianglesTwoQuadsPatchConstructor : public PatchConstructor
18{
19public:
20 TwoTrianglesTwoQuadsPatchConstructor() {};
21
22 bool isSamePatchType(const VertexHandle& a_VertexHandle, MeshType& a_Mesh, bool check_marked = false) override;
23 PatchBuilder getPatchBuilder(const VertexHandle& a_VertexHandle, MeshType& a_Mesh, bool mark_gathered = false) override;
24
25 Patch getPatch(const std::vector<VertexHandle>& a_NBVertexHandles, MeshType& a_Mesh);
26 Mat9x3d getPatchMat(const std::vector<VertexHandle>& a_NBVertexHandles, MeshType& a_Mesh);
27
28private:
29 const Mat9x9d m_Mask = Matrix({
30 {0.25, 0.25, 0, 0.25, 0.25, 0, 0, 0, 0},
31 {0, 0.5, 0, 0, 0.5, 0, 0, 0, 0},
32 {0, 0.25, 0.25, 0, 0.25, 0.25, 0, 0, 0},
33 {0, 0, 0, 0.5, 0.5, 0, 0, 0, 0},
34 {0, 0, 0, 0, 1, 0, 0, 0, 0},
35 {0, 0, 0, 0, 0.5, 0.5, 0, 0, 0},
36 {0, 0, 0, 0.25, 0.25, 0, 0.25, 0.25, 0},
37 {0, 0, 0, 0, 0.5, 0, 0, 0.5, 0},
38 {0, 0, 0, 0, 0.25, 0.25, 0, 0.25, 0.25}
39 });
40
58 std::vector<VertexHandle> initNeighborVerts(const VertexHandle& a_VertexHandle, MeshType& a_Mesh);
59
60 std::string getGroupName() const;
61};
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
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 TwoTrianglesTwoQuadsPatchConstructor.cpp:9
std::string getGroupName() const
Returns the name of the patch group this constructor handles.
Definition TwoTrianglesTwoQuadsPatchConstructor.cpp:117
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 TwoTrianglesTwoQuadsPatchConstructor.cpp:58
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 TwoTrianglesTwoQuadsPatchConstructor.cpp:82
A class representing a Bézier patch.
Definition Patch.hpp:20