Polyhedral-net Splines
Loading...
Searching...
No Matches
PatchBuilder Class Reference

A builder class for constructing Bézier patches from a mesh. More...

#include <PatchBuilder.hpp>

Public Member Functions

 PatchBuilder (const MeshType &a_Mesh, std::vector< VertexHandle > a_NBVertexHandles, const Matrix &a_Mask, PatchConstructor *a_PatchConstructor, int a_NumOfPatches)
 Constructs a PatchBuilder with the given neighboring vertex handles, mask, patch constructor and number of output bezier patches.
 PatchBuilder (const MeshType &a_Mesh, std::vector< VertexHandle > a_NBVertexHandles, const Matrix &a_Mask, PatchConstructor *a_PatchConstructor, int a_DegU, int a_DegV)
 Constructs a PatchBuilder with the given neighboring vertex handles, mask, patch constructor, and degrees.
 PatchBuilder (const PatchBuilder &a_PatchBuilder)
 Construct a new Patch Builder object.
PatchBuilderoperator= (const PatchBuilder &a_PatchBuilder)
 Assignment operator.
std::vector< PatchbuildPatches (const MeshType &a_Mesh) const
 Builds the Bézier patches using the current vertex positions in the given mesh.
std::vector< VertexHandle > getNeighborVerts () const
 Get the Neighbor Verts object that are used to construct the bezier patches for this PnS patch.
Matrix getMask () const
 Get the Mask object. The linear transformation that maps the neighboring vertices to the coefficients of the bezier patches.
const PatchConstructorgetPatchConstructor () const
 Get the PatchConstructor object that created this PatchBuilder.
void degRaise ()
 Raises the degree of the bezier patches by upto degree 3 in each direction. Nothing happens if the degree is already 3 or higher in a direction. The mask is modified to produce patches with a higher degree.
int numPatches () const
 Get the Num Patches object. The number of bezier patches this PnS patch type outputs.

Public Attributes

std::vector< VertexHandle > m_NBVertexHandles
 The neighboring vertex handles used to construct the patch.
Matrix m_Mask
 The mask used to construct the patch.
PatchConstructorm_PatchConstructor
 The patch constructor that created this patch builder.
int m_NumOfPatches = -1
 The number of bézier patches this PnS patch type outputs.
int m_DegU = -1
 The degree in u direction of each bézier patch this PnS patch type outputs.
int m_DegV = -1
 The degree in v direction of each bézier patch this PnS patch type outputs.

Private Member Functions

void initializeMaskAndNeighborVertices (const MeshType &a_Mesh, std::vector< VertexHandle > a_NBVertexHandles, const Matrix &a_Mask)

Detailed Description

A builder class for constructing Bézier patches from a mesh.

The PatchBuilder class created by a PatchConstructor contains all the information needed to build a Patch. It holds the neighboring vertex handles, the mask for creating the patch. The mask is always with respect to the control points of the original mesh. The stored mask is generated in case of patch builders being collected from mesh after Subdivision. This way the mask is always with respect to the control points of the original mesh. It can be given a mesh with updated vertices to build updated bezier patches for this particular patch type and neighborhood. By keeping track of the control points that affect this PnS patch, upon updates, only the necessary patch builders need to be re-evaluated.

Note
The connectivty of the mesh must not change, only the vertex positions.

Constructor & Destructor Documentation

◆ PatchBuilder() [1/3]

PatchBuilder::PatchBuilder ( const MeshType & a_Mesh,
std::vector< VertexHandle > a_NBVertexHandles,
const Matrix & a_Mask,
PatchConstructor * a_PatchConstructor,
int a_NumOfPatches )

Constructs a PatchBuilder with the given neighboring vertex handles, mask, patch constructor and number of output bezier patches.

Parameters
a_MeshThe mesh to which the vertex handles belong. Used to validate the vertex handles.
a_NBVertexHandlesThe neighboring vertex handles used to construct the patch.
a_MaskThe mask used to construct the patch.
a_PatchConstructorThe patch constructor that created this patch builder.
a_NumOfPatchesThe number of bézier patches this PnS patch type outputs.

◆ PatchBuilder() [2/3]

PatchBuilder::PatchBuilder ( const MeshType & a_Mesh,
std::vector< VertexHandle > a_NBVertexHandles,
const Matrix & a_Mask,
PatchConstructor * a_PatchConstructor,
int a_DegU,
int a_DegV )

Constructs a PatchBuilder with the given neighboring vertex handles, mask, patch constructor, and degrees.

Parameters
a_MeshThe mesh to which the vertex handles belong. Used to validate the vertex handles.
a_NBVertexHandlesThe neighboring vertex handles used to construct the patch.
a_MaskThe mask used to construct the patch.
a_PatchConstructorThe patch constructor that created this patch builder.
a_DegUThe degree in u direction of each bézier patch this PnS patch type outputs.
a_DegVThe degree in v direction of each bézier patch this PnS patch type outputs.

◆ PatchBuilder() [3/3]

PatchBuilder::PatchBuilder ( const PatchBuilder & a_PatchBuilder)
inline

Construct a new Patch Builder object.

Parameters
a_PatchBuilder

Member Function Documentation

◆ buildPatches()

std::vector< Patch > PatchBuilder::buildPatches ( const MeshType & a_Mesh) const

Builds the Bézier patches using the current vertex positions in the given mesh.

Parameters
a_MeshThe mesh containing the current vertex positions.
Returns
A vector of constructed Bézier patches.
Note
The connectivity of the mesh must not change, only the vertex positions.

◆ getMask()

Matrix PatchBuilder::getMask ( ) const

Get the Mask object. The linear transformation that maps the neighboring vertices to the coefficients of the bezier patches.

Returns
Matrix

◆ getNeighborVerts()

std::vector< VertexHandle > PatchBuilder::getNeighborVerts ( ) const

Get the Neighbor Verts object that are used to construct the bezier patches for this PnS patch.

Returns
std::vector<VertexHandle>

◆ getPatchConstructor()

const PatchConstructor * PatchBuilder::getPatchConstructor ( ) const

Get the PatchConstructor object that created this PatchBuilder.

Returns
const PatchConstructor*

◆ numPatches()

int PatchBuilder::numPatches ( ) const

Get the Num Patches object. The number of bezier patches this PnS patch type outputs.

Returns
int

The documentation for this class was generated from the following files: