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

Represents a polynomial patch in Bernstein–Bézier form. More...

#include <PnSPatch.hpp>

Public Member Functions

 PnSPatch ()
 Default constructor.
 ~PnSPatch ()
 Destructor.
 PnSPatch (const PnSPatch &patch)
 Copy constructor.
 PnSPatch (PnSPatch &&patch) noexcept
 Move constructor.
PnSPatchoperator= (const PnSPatch &a_Other)
 Copy assignment operator.
PnSPatchoperator= (PnSPatch &&other) noexcept
 Move assignment operator.
const double & operator() (uint32_t i, uint32_t j, uint32_t k) const
 Access Bézier coefficient by index.
bool isValid () const
 Check whether this patch is valid.
void degRaise ()
 Perform degree elevation on the patch.
uint32_t getDegreeU () const
 Get the polynomial degree in the u-direction.
uint32_t getDegreeV () const
 Get the polynomial degree in the v-direction.

Private Member Functions

 PnSPatch (Patch *impl)
 Construct a patch from an internal implementation.

Private Attributes

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

Friends

class PnSpline

Detailed Description

Represents a polynomial patch in Bernstein–Bézier form.

A PnSPatch stores the coefficients and degree information of a single spline patch.

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 PnSPatch_impl.hpp.

Constructor & Destructor Documentation

◆ PnSPatch() [1/4]

PnSPatch::PnSPatch ( )

Default constructor.

Constructs an empty patch.

◆ PnSPatch() [2/4]

PnSPatch::PnSPatch ( const PnSPatch & patch)
inline

Copy constructor.

Parameters
patchAnother patch to copy from.

◆ PnSPatch() [3/4]

PnSPatch::PnSPatch ( PnSPatch && patch)
inlinenoexcept

Move constructor.

Parameters
patchAnother patch to move from.

◆ PnSPatch() [4/4]

PnSPatch::PnSPatch ( Patch * impl)
inlineprivate

Construct a patch from an internal implementation.

Parameters
implPointer to underlying implementation.

Only the PnSpline class can call this constructor.

Member Function Documentation

◆ degRaise()

void PnSPatch::degRaise ( )
inline

Perform degree elevation on the patch.

Degree raise the patch upto degree 3 for each paramter. Degree greater than 3 will remain unchanged. This is not relevant for PnS3.

◆ getDegreeU()

uint32_t PnSPatch::getDegreeU ( ) const
inline

Get the polynomial degree in the u-direction.

Returns
Degree in u.

◆ getDegreeV()

uint32_t PnSPatch::getDegreeV ( ) const
inline

Get the polynomial degree in the v-direction.

Returns
Degree in v.

◆ isValid()

bool PnSPatch::isValid ( ) const
inline

Check whether this patch is valid.

Returns
True if the patch is valid.

◆ operator()()

const double & PnSPatch::operator() ( uint32_t i,
uint32_t j,
uint32_t k ) const
inline

Access Bézier coefficient by index.

Parameters
iIndex in the u-direction between 0 and Degree in u-direction.
jIndex in the v-direction between 0 and Degree in v-direction.
kDimension of control point between 0 and 2 (x, y, or z).
Returns
Const reference to the coefficient value.

◆ operator=() [1/2]

PnSPatch & PnSPatch::operator= ( const PnSPatch & a_Other)
inline

Copy assignment operator.

Parameters
a_OtherAnother patch to copy from.
Returns
Reference to this patch.

◆ operator=() [2/2]

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

Move assignment operator.

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

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