Core 1.0
BezierPatch Class Reference

Bézier patches of dimension n<16. More...

#include <bezier.h>

Inheritance diagram for BezierPatch:
BezierCubicPatch

Public Member Functions

 BezierPatch ()
 Empty.
 
 BezierPatch (int, int)
 Create a Bézier patch.
 
 BezierPatch (const QVector< Vector > &, int, int)
 Create a Bézier patch.
 
virtual Vector Vertex (const double &, const double &) const
 Compute a point on the patch.
 
virtual Vector Normal (const double &, const double &) const
 Compute the normal at a given point on the patch.
 
virtual void Tangents (const double &, const double &, Vector &, Vector &) const
 Compute the partial derivatives at a given point on the patch.
 
Vector Vertex (int, int) const
 Return the control point.
 
Vector operator() (int, int) const
 Return the control point.
 
Box GetBox () const
 Compute the bouding box.
 
Mesh GetMesh (int, int) const
 Create the mesh of the patch.
 
void Rotate (const Matrix &)
 Rotates a patch.
 
void Translate (const Vector &)
 Translation.
 
void Scale (const Vector &)
 Scale.
 

Protected Member Functions

constexpr int Index (int, int) const
 Compute the linear index of a control point.
 

Protected Attributes

QVector< Vectorc
 Array of control points.
 
int ny = 0
 Array size.
 

Detailed Description

Bézier patches of dimension n<16.

Constructor & Destructor Documentation

◆ BezierPatch() [1/2]

BezierPatch::BezierPatch ( int nx,
int ny )
explicit

Create a Bézier patch.

All control points are set to Vector::Null.

Parameters
nx,nyNumber of control points.

◆ BezierPatch() [2/2]

BezierPatch::BezierPatch ( const QVector< Vector > & c,
int nx,
int ny )
explicit

Create a Bézier patch.

Parameters
cSet of control points.
nx,nyNumber of control points.

Member Function Documentation

◆ GetMesh()

Mesh BezierPatch::GetMesh ( int nu,
int nv ) const

Create the mesh of the patch.

Parameters
nu,nvSubdivisons.

◆ Index()

int BezierPatch::Index ( int i,
int j ) const
inlineconstexprprotected

Compute the linear index of a control point.

Parameters
i,jControl point indexes.

◆ Normal()

Vector BezierPatch::Normal ( const double & u,
const double & v ) const
virtual

Compute the normal at a given point on the patch.

Parameters
u,vCoordinates.

Reimplemented in BezierCubicPatch.

◆ operator()()

Vector BezierPatch::operator() ( int i,
int j ) const

Return the control point.

Parameters
i,jIndexes.

◆ Rotate()

void BezierPatch::Rotate ( const Matrix & r)

Rotates a patch.

Parameters
rRotation matrix.

◆ Scale()

void BezierPatch::Scale ( const Vector & s)

Scale.

Parameters
sScaling vector.

◆ Tangents()

void BezierPatch::Tangents ( const double & u,
const double & v,
Vector & tu,
Vector & tv ) const
virtual

Compute the partial derivatives at a given point on the patch.

Parameters
u,vCoordinates.
tu,tvTangent vectors, not normalized.

◆ Translate()

void BezierPatch::Translate ( const Vector & t)

Translation.

Parameters
tTranslation vector.

◆ Vertex() [1/2]

Vector BezierPatch::Vertex ( const double & u,
const double & v ) const
virtual

Compute a point on the patch.

Parameters
u,vCoordinates.

Reimplemented in BezierCubicPatch.

◆ Vertex() [2/2]

Vector BezierPatch::Vertex ( int i,
int j ) const

Return the control point.

Parameters
i,jIndexes.