OpenWalnut
1.5.0dev
|
A B-spline surface. More...
#include <WBSplineSurface.h>
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< WVector3d > | getDeBoorPoints () |
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< WVector3d > | m_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... | |
A B-spline surface.
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.
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.
order1 | Order of the spline in first direction. |
order2 | Order of the spline in second direction. |
deBoorPoints | The de Boor points for the spline |
numDeBoorPoints1 | The number of de Boor points for the spline in the first direction. |
numDeBoorPoints2 | The 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::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.
order1 | Order of the spline in first direction. |
order2 | Order of the spline in second direction. |
deBoorPoints | The de Boor points for the spline |
numDeBoorPoints1 | The number of de Boor points for the spline in the first direction. |
numDeBoorPoints2 | The number of de Boor points for the spline in the second direction. |
knots1 | The new knots for the spline in the first direction. |
knots2 | The 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 | ( | ) |
Empty destructor.
Definition at line 93 of file WBSplineSurface.cpp.
|
private |
Compute a single sample point on the surface for the given parameters.
t | parameter for first direction. |
u | parameter for second direction. |
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().
std::vector< WVector3d > WBSplineSurface::getDeBoorPoints | ( | ) |
Returns the stored de Boor points.
Definition at line 139 of file WBSplineSurface.cpp.
References m_deBoorPoints.
std::vector< double > WBSplineSurface::getKnots1 | ( | ) |
Returns the stored knots in the first direction.
Definition at line 154 of file WBSplineSurface.cpp.
References m_knots1.
std::vector< double > WBSplineSurface::getKnots2 | ( | ) |
Returns the stored knots in the second direction.
Definition at line 159 of file WBSplineSurface.cpp.
References m_knots2.
int WBSplineSurface::getNumDeBoorPoints1 | ( | ) |
Returns the number of de Boor points in the first direction.
Definition at line 144 of file WBSplineSurface.cpp.
References m_numDeBoorPoints1.
int WBSplineSurface::getNumDeBoorPoints2 | ( | ) |
Returns the number of de Boor points in the second direction.
Definition at line 149 of file WBSplineSurface.cpp.
References m_numDeBoorPoints2.
int WBSplineSurface::getNumSamplePointsT | ( | ) |
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().
int WBSplineSurface::getNumSamplePointsU | ( | ) |
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().
int WBSplineSurface::getOrder1 | ( | ) |
Returns the order of the spline in the first direction.
Definition at line 164 of file WBSplineSurface.cpp.
References m_order1.
int WBSplineSurface::getOrder2 | ( | ) |
Returns the order of the spline in the second direction.
Definition at line 169 of file WBSplineSurface.cpp.
References m_order2.
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.
points | The pointer for returning the sample points. |
tResolution | The resolution in the first direction. |
uResolution | The 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().
void WBSplineSurface::setDeBoorPoints | ( | std::vector< WVector3d > | deBoorPoints, |
int | numDeBoorPoints1, | ||
int | numDeBoorPoints2 | ||
) |
Sets new de Boor points for the splines.
deBoorPoints | The new de Boor points for the splines. |
numDeBoorPoints1 | The number of de Boor points for the spline in the first direction. |
numDeBoorPoints2 | The 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.
void WBSplineSurface::setKnots1 | ( | std::vector< double > | knots | ) |
Sets new knots for the spline in the first direction.
knots | The new knots for the spline in the first direction. |
Definition at line 191 of file WBSplineSurface.cpp.
References m_knots1.
void WBSplineSurface::setKnots2 | ( | std::vector< double > | knots | ) |
Sets new knots for the spline in the second direction.
knots | The new knots for the spline in the second direction. |
Definition at line 196 of file WBSplineSurface.cpp.
References m_knots2.
void WBSplineSurface::setOrder1 | ( | int | order | ) |
Sets a new order for the spline in the first direction.
order | The new order of the spline in the first direction. |
Definition at line 201 of file WBSplineSurface.cpp.
References m_order1.
void WBSplineSurface::setOrder2 | ( | int | order | ) |
Sets a new order for the spline in the second direction.
order | The new order of the spline in the second direction. |
Definition at line 206 of file WBSplineSurface.cpp.
References m_order2.
|
private |
The de Boor points of the splines.
Definition at line 209 of file WBSplineSurface.h.
Referenced by f(), getDeBoorPoints(), setDeBoorPoints(), and WBSplineSurface().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
private |
order for the spline in the first direction.
Definition at line 202 of file WBSplineSurface.h.
Referenced by f(), getOrder1(), setOrder1(), and WBSplineSurface().
|
private |
order for the spline in the second direction.
Definition at line 203 of file WBSplineSurface.h.
Referenced by f(), getOrder2(), setOrder2(), and WBSplineSurface().