OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WBSplineSurface Class Reference

A B-spline surface. More...

#include <WBSplineSurface.h>

+ Collaboration diagram for WBSplineSurface:

Public Member Functions

 WBSplineSurface (int order1, int order2, std::vector< WVector3d > deBoorPoints, int numDeBoorPoints1, int numDeBoorPoints2)
 Constructor for the surface that takes the orders and de Boor points of the underlying splines while constructing normalized knotVectors automatically. More...
 
 WBSplineSurface (int order1, int order2, std::vector< WVector3d > deBoorPoints, int numDeBoorPoints1, int numDeBoorPoints2, std::vector< double > knots1, std::vector< double > knots2)
 Constructor for the surface that takes the orders, de Boor points knots of the underlying splines. More...
 
 ~WBSplineSurface ()
 Empty destructor. More...
 
std::vector< WVector3dgetDeBoorPoints ()
 Returns the stored de Boor points. More...
 
int getNumDeBoorPoints1 ()
 Returns the number of de Boor points in the first direction. More...
 
int getNumDeBoorPoints2 ()
 Returns the number of de Boor points in the second direction. More...
 
std::vector< double > getKnots1 ()
 Returns the stored knots in the first direction. More...
 
std::vector< double > getKnots2 ()
 Returns the stored knots in the second direction. More...
 
int getOrder1 ()
 Returns the order of the spline in the first direction. More...
 
int getOrder2 ()
 Returns the order of the spline in the second direction. More...
 
int getNumSamplePointsT ()
 Returns the number of sample points in the first direction that were used for the last call to samplePoints(). More...
 
int getNumSamplePointsU ()
 Returns the number of sample points in the second direction that were used for the last call to samplePoints(). More...
 
void setDeBoorPoints (std::vector< WVector3d > deBoorPoints, int numDeBoorPoints1, int numDeBoorPoints2)
 Sets new de Boor points for the splines. More...
 
void setKnots1 (std::vector< double > knots)
 Sets new knots for the spline in the first direction. More...
 
void setKnots2 (std::vector< double > knots)
 Sets new knots for the spline in the second direction. More...
 
void setOrder1 (int order)
 Sets a new order for the spline in the first direction. More...
 
void setOrder2 (int order)
 Sets a new order for the spline in the second direction. More...
 
void samplePoints (std::vector< WVector3d > *points, double tResolution, double uResolution)
 Compute sample points on the spline surface for a given resolution in the two directions. More...
 

Private Member Functions

WVector3d f (double t, double u)
 Compute a single sample point on the surface for the given parameters. More...
 

Private Attributes

int m_order1
 order for the spline in the first direction. More...
 
int m_order2
 order for the spline in the second direction. More...
 
int m_numDeBoorPoints1
 number of de Boor points for the spline in the first direction. More...
 
int m_numDeBoorPoints2
 number of de Boor points for the spline in the second direction. More...
 
int m_numSamplePointsT
 The number of sample points in the first direction that were used for the last call to samplePoints(). More...
 
int m_numSamplePointsU
 The number of sample points in the second direction that were used for the last call to samplePoints(). More...
 
std::vector< WVector3dm_deBoorPoints
 The de Boor points of the splines. More...
 
std::vector< double > m_knots1
 The knots of the spline in the first direction. More...
 
std::vector< double > m_knots2
 The knots of the spline in the second direction. More...
 

Detailed Description

A B-spline surface.

Author
Patrick Oesterling

numDeBoorPoints1 -> t-parameter (knots1) 0 1 2 3 4 5 ..... n ___________________________ u | | | | | | | | | | m |__________________________| D | | | | | | | | | | e |__________________________| B | | | | | | | | | | o |__________________________| o | | | | | | | | | | r |__________________________| P | | | | | | | | | | 2 |__________________________| -> | | | | | | | | | | u |__________________________|

Definition at line 58 of file WBSplineSurface.h.

Constructor & Destructor Documentation

◆ WBSplineSurface() [1/2]

WBSplineSurface::WBSplineSurface ( int  order1,
int  order2,
std::vector< WVector3d deBoorPoints,
int  numDeBoorPoints1,
int  numDeBoorPoints2 
)

Constructor for the surface that takes the orders and de Boor points of the underlying splines while constructing normalized knotVectors automatically.

Parameters
order1Order of the spline in first direction.
order2Order of the spline in second direction.
deBoorPointsThe de Boor points for the spline
numDeBoorPoints1The number of de Boor points for the spline in the first direction.
numDeBoorPoints2The number of de Boor points for the spline in the second direction.

Definition at line 31 of file WBSplineSurface.cpp.

References m_deBoorPoints, m_knots1, m_knots2, m_numDeBoorPoints1, m_numDeBoorPoints2, m_order1, and m_order2.

◆ WBSplineSurface() [2/2]

WBSplineSurface::WBSplineSurface ( int  order1,
int  order2,
std::vector< WVector3d deBoorPoints,
int  numDeBoorPoints1,
int  numDeBoorPoints2,
std::vector< double >  knots1,
std::vector< double >  knots2 
)

Constructor for the surface that takes the orders, de Boor points knots of the underlying splines.

Parameters
order1Order of the spline in first direction.
order2Order of the spline in second direction.
deBoorPointsThe de Boor points for the spline
numDeBoorPoints1The number of de Boor points for the spline in the first direction.
numDeBoorPoints2The number of de Boor points for the spline in the second direction.
knots1The new knots for the spline in the first direction.
knots2The new knots for the spline in the second direction.

Definition at line 76 of file WBSplineSurface.cpp.

References m_deBoorPoints, m_knots1, m_knots2, m_numDeBoorPoints1, m_numDeBoorPoints2, m_order1, and m_order2.

◆ ~WBSplineSurface()

WBSplineSurface::~WBSplineSurface ( )

Empty destructor.

Definition at line 93 of file WBSplineSurface.cpp.

Member Function Documentation

◆ f()

WVector3d WBSplineSurface::f ( double  t,
double  u 
)
private

Compute a single sample point on the surface for the given parameters.

Parameters
tparameter for first direction.
uparameter for second direction.
Returns
Sample point at (t,u).

Definition at line 97 of file WBSplineSurface.cpp.

References WBSpline::f(), m_deBoorPoints, m_numDeBoorPoints1, m_numDeBoorPoints2, m_order1, and m_order2.

Referenced by samplePoints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeBoorPoints()

std::vector< WVector3d > WBSplineSurface::getDeBoorPoints ( )

Returns the stored de Boor points.

Returns
All de Boor points of the B-spline

Definition at line 139 of file WBSplineSurface.cpp.

References m_deBoorPoints.

◆ getKnots1()

std::vector< double > WBSplineSurface::getKnots1 ( )

Returns the stored knots in the first direction.

Returns
Number of knots in the first direction

Definition at line 154 of file WBSplineSurface.cpp.

References m_knots1.

◆ getKnots2()

std::vector< double > WBSplineSurface::getKnots2 ( )

Returns the stored knots in the second direction.

Returns
Number of knots in the second direction

Definition at line 159 of file WBSplineSurface.cpp.

References m_knots2.

◆ getNumDeBoorPoints1()

int WBSplineSurface::getNumDeBoorPoints1 ( )

Returns the number of de Boor points in the first direction.

Returns
Number of de Boor points in first direction

Definition at line 144 of file WBSplineSurface.cpp.

References m_numDeBoorPoints1.

◆ getNumDeBoorPoints2()

int WBSplineSurface::getNumDeBoorPoints2 ( )

Returns the number of de Boor points in the second direction.

Returns
Number of de Boor points in second direction

Definition at line 149 of file WBSplineSurface.cpp.

References m_numDeBoorPoints2.

◆ getNumSamplePointsT()

int WBSplineSurface::getNumSamplePointsT ( )

Returns the number of sample points in the first direction that were used for the last call to samplePoints().

Returns
the number of sample points in the first direction that were used for the last call to samplePoints().

Definition at line 174 of file WBSplineSurface.cpp.

References m_numSamplePointsT.

Referenced by WSurface::execute().

+ Here is the caller graph for this function:

◆ getNumSamplePointsU()

int WBSplineSurface::getNumSamplePointsU ( )

Returns the number of sample points in the second direction that were used for the last call to samplePoints().

Returns
the number of sample points in the second direction that were used for the last call to samplePoints().

Definition at line 179 of file WBSplineSurface.cpp.

References m_numSamplePointsU.

Referenced by WSurface::execute().

+ Here is the caller graph for this function:

◆ getOrder1()

int WBSplineSurface::getOrder1 ( )

Returns the order of the spline in the first direction.

Returns
The order of the spline in the first direction.

Definition at line 164 of file WBSplineSurface.cpp.

References m_order1.

◆ getOrder2()

int WBSplineSurface::getOrder2 ( )

Returns the order of the spline in the second direction.

Returns
The order of the spline in the second direction.

Definition at line 169 of file WBSplineSurface.cpp.

References m_order2.

◆ samplePoints()

void WBSplineSurface::samplePoints ( std::vector< WVector3d > *  points,
double  tResolution,
double  uResolution 
)

Compute sample points on the spline surface for a given resolution in the two directions.

The sample points are stored in the vector given by the first argument.

Parameters
pointsThe pointer for returning the sample points.
tResolutionThe resolution in the first direction.
uResolutionThe resolution in the second direction.

Definition at line 211 of file WBSplineSurface.cpp.

References f(), m_knots1, m_knots2, m_numSamplePointsT, and m_numSamplePointsU.

Referenced by WSurface::execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDeBoorPoints()

void WBSplineSurface::setDeBoorPoints ( std::vector< WVector3d deBoorPoints,
int  numDeBoorPoints1,
int  numDeBoorPoints2 
)

Sets new de Boor points for the splines.

Parameters
deBoorPointsThe new de Boor points for the splines.
numDeBoorPoints1The number of de Boor points for the spline in the first direction.
numDeBoorPoints2The number of de Boor points for the spline in the second direction.

Definition at line 184 of file WBSplineSurface.cpp.

References m_deBoorPoints, m_numDeBoorPoints1, and m_numDeBoorPoints2.

◆ setKnots1()

void WBSplineSurface::setKnots1 ( std::vector< double >  knots)

Sets new knots for the spline in the first direction.

Parameters
knotsThe new knots for the spline in the first direction.

Definition at line 191 of file WBSplineSurface.cpp.

References m_knots1.

◆ setKnots2()

void WBSplineSurface::setKnots2 ( std::vector< double >  knots)

Sets new knots for the spline in the second direction.

Parameters
knotsThe new knots for the spline in the second direction.

Definition at line 196 of file WBSplineSurface.cpp.

References m_knots2.

◆ setOrder1()

void WBSplineSurface::setOrder1 ( int  order)

Sets a new order for the spline in the first direction.

Parameters
orderThe new order of the spline in the first direction.

Definition at line 201 of file WBSplineSurface.cpp.

References m_order1.

◆ setOrder2()

void WBSplineSurface::setOrder2 ( int  order)

Sets a new order for the spline in the second direction.

Parameters
orderThe new order of the spline in the second direction.

Definition at line 206 of file WBSplineSurface.cpp.

References m_order2.

Member Data Documentation

◆ m_deBoorPoints

std::vector< WVector3d > WBSplineSurface::m_deBoorPoints
private

The de Boor points of the splines.

Definition at line 209 of file WBSplineSurface.h.

Referenced by f(), getDeBoorPoints(), setDeBoorPoints(), and WBSplineSurface().

◆ m_knots1

std::vector<double> WBSplineSurface::m_knots1
private

The knots of the spline in the first direction.

Definition at line 211 of file WBSplineSurface.h.

Referenced by getKnots1(), samplePoints(), setKnots1(), and WBSplineSurface().

◆ m_knots2

std::vector<double> WBSplineSurface::m_knots2
private

The knots of the spline in the second direction.

Definition at line 212 of file WBSplineSurface.h.

Referenced by getKnots2(), samplePoints(), setKnots2(), and WBSplineSurface().

◆ m_numDeBoorPoints1

int WBSplineSurface::m_numDeBoorPoints1
private

number of de Boor points for the spline in the first direction.

Definition at line 204 of file WBSplineSurface.h.

Referenced by f(), getNumDeBoorPoints1(), setDeBoorPoints(), and WBSplineSurface().

◆ m_numDeBoorPoints2

int WBSplineSurface::m_numDeBoorPoints2
private

number of de Boor points for the spline in the second direction.

Definition at line 205 of file WBSplineSurface.h.

Referenced by f(), getNumDeBoorPoints2(), setDeBoorPoints(), and WBSplineSurface().

◆ m_numSamplePointsT

int WBSplineSurface::m_numSamplePointsT
private

The number of sample points in the first direction that were used for the last call to samplePoints().

Definition at line 206 of file WBSplineSurface.h.

Referenced by getNumSamplePointsT(), and samplePoints().

◆ m_numSamplePointsU

int WBSplineSurface::m_numSamplePointsU
private

The number of sample points in the second direction that were used for the last call to samplePoints().

Definition at line 207 of file WBSplineSurface.h.

Referenced by getNumSamplePointsU(), and samplePoints().

◆ m_order1

int WBSplineSurface::m_order1
private

order for the spline in the first direction.

Definition at line 202 of file WBSplineSurface.h.

Referenced by f(), getOrder1(), setOrder1(), and WBSplineSurface().

◆ m_order2

int WBSplineSurface::m_order2
private

order for the spline in the second direction.

Definition at line 203 of file WBSplineSurface.h.

Referenced by f(), getOrder2(), setOrder2(), and WBSplineSurface().


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