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

Represents a PnSpline(Polyhedral net Spline) composed of piecwise polynomial patches PnSPatch. More...

#include <PnSpline.hpp>

Public Member Functions

 PnSpline ()
 Construct an empty PnSpline.
 PnSpline (std::vector< std::array< double, 3 > > &controlPoints, std::vector< std::vector< uint32_t > > &controlIndices, bool degRaise=false)
 Construct a PnSpline from control net data.
 PnSpline (const PnSpline &other)
 Copy constructor.
PnSplineoperator= (const PnSpline &other)
 Copy assignment operator.
 PnSpline (PnSpline &&other) noexcept
 Move constructor.
PnSplineoperator= (PnSpline &&other) noexcept
 Move assignment operator.
 ~PnSpline ()
 Destructor.
std::vector< uint32_t > updateControlMesh (std::vector< std::array< double, 3 > > &updatedControlPoints, std::vector< uint32_t > &updateIndices)
 Update part of the control mesh.
void degRaise ()
 Degree raise all patches upto degree 3 for each paramter. Degree greater than 3 will remain unchanged. This is not relevant for PnS3.
uint32_t numPatches () const
 Get the number of patches in this PnSpline.
PnSPatch getPatch (uint32_t index) const
 Access an individual patch by index.

Private Attributes

PnSplineImplimpl
 Opaque pointer to implementation (PIMPL idiom). This is to ensure binary compatibility.

Detailed Description

Represents a PnSpline(Polyhedral net Spline) composed of piecwise polynomial patches PnSPatch.

A PnSpline manages a collection of patches defined over a control mesh. It provides methods to update the underlying control structure efficiently without needing to reconstruct the entire surface, retrieve individual patches, and perform operations such as degree elevation.

This class uses the PIMPL idiom to ensure binary compatibility across different versions of the library. The member functions are inline functions that call binary safe C functions declared in PnSpline_impl.hpp.

Constructor & Destructor Documentation

◆ PnSpline() [1/4]

PnSpline::PnSpline ( )
inline

Construct an empty PnSpline.

Only useful as a placeholder before assignment.

◆ PnSpline() [2/4]

PnSpline::PnSpline ( std::vector< std::array< double, 3 > > & controlPoints,
std::vector< std::vector< uint32_t > > & controlIndices,
bool degRaise = false )
inline

Construct a PnSpline from control net data.

Parameters
controlPoints3D positions of control points.
controlIndicesConnectivity information for the control mesh. Indices are 0-based. Orientation of the faces must be consistent.
degRaiseIf true, degree raise all patches upto degree 3 for each paramter. Degree greater than 3 will remain unchanged. This is not relevant for PnS3.
Note
The PnSpline does not maintain any references to the input data but stores a copy. The input control points and indices can be safely deleted after construction.

◆ PnSpline() [3/4]

PnSpline::PnSpline ( const PnSpline & other)
inline

Copy constructor.

Parameters
otherAnother PnSpline to copy from.

◆ PnSpline() [4/4]

PnSpline::PnSpline ( PnSpline && other)
inlinenoexcept

Move constructor.

Parameters
otherAnother PnSpline to move from.

Member Function Documentation

◆ getPatch()

PnSPatch PnSpline::getPatch ( uint32_t index) const
inline

Access an individual patch by index.

Parameters
indexPatch index in the range [0, numPatches()).
Returns
A patch object.
Note
The patch must be retrieved again after any update.

◆ numPatches()

uint32_t PnSpline::numPatches ( ) const
inline

Get the number of patches in this PnSpline.

Returns
Number of PnSPatch elements.

◆ operator=() [1/2]

PnSpline & PnSpline::operator= ( const PnSpline & other)
inline

Copy assignment operator.

Parameters
otherAnother PnSpline to copy from.
Returns
Reference to this PnSpline.

◆ operator=() [2/2]

PnSpline & PnSpline::operator= ( PnSpline && other)
inlinenoexcept

Move assignment operator.

Parameters
otherAnother PnSpline to move from.
Returns
Reference to this PnSpline.

◆ updateControlMesh()

std::vector< uint32_t > PnSpline::updateControlMesh ( std::vector< std::array< double, 3 > > & updatedControlPoints,
std::vector< uint32_t > & updateIndices )
inline

Update part of the control mesh.

Parameters
updatedControlPointsNew vertex positions.
updateIndicesIndices of the control points to update.
Returns
Indices of patches that were affected by the update.

This allows incremental updates without rebuilding the entire surface.

The patches affected be retieved using getPatch.


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