27 #include "WBSplineSurface.h"
33 std::vector< WVector3d > deBoorPoints,
35 int numDeBoorPoints2 )
46 for(
int i = 0; i < ( n + k ); i++ )
51 if( ( i >= k ) && ( i < n ) )
62 for(
int i = 0; i < ( n + k ); i++ )
67 if( ( i >= k ) && ( i < n ) )
78 std::vector< WVector3d > deBoorPoints,
81 std::vector<double> knots1,
82 std::vector<double> knots2 )
118 std::vector< WVector3d > uSplineDeBoorPoints;
122 std::vector< WVector3d > tSplineDeBoorPoints;
132 uSplineDeBoorPoints.push_back(
WVector3d( dmyArray[0], dmyArray[1], dmyArray[2] ) );
136 return uSpline.
f( _u );
215 double deltaT = tResolution;
216 double deltaU = uResolution;
226 for( stepU = 0; stepU < stepsU; stepU++ )
228 currentU =
m_knots2[0] + stepU * deltaU;
229 for( stepT = 0; stepT < stepsT; stepT++ )
231 currentT =
m_knots1[0] + stepT * deltaT;
232 WVector3d samplePoint =
f( currentT, currentU );
233 points->push_back( samplePoint );
~WBSplineSurface()
Empty destructor.
std::vector< double > m_knots1
The knots of the spline in the first direction.
void setDeBoorPoints(std::vector< WVector3d > deBoorPoints, int numDeBoorPoints1, int numDeBoorPoints2)
Sets new de Boor points for the splines.
int m_numDeBoorPoints1
number of de Boor points for the spline in the first direction.
int m_numSamplePointsU
The number of sample points in the second direction that were used for the last call to samplePoints(...
int m_numSamplePointsT
The number of sample points in the first direction that were used for the last call to samplePoints()...
void setKnots1(std::vector< double > knots)
Sets new knots for the spline in the first direction.
std::vector< double > getKnots1()
Returns the stored knots in the first direction.
int m_order1
order for the spline in the first direction.
WVector3d f(double t, double u)
Compute a single sample point on the surface for the given parameters.
int getNumSamplePointsT()
Returns the number of sample points in the first direction that were used for the last call to sample...
void setOrder1(int order)
Sets a new order for the spline in the first direction.
int m_numDeBoorPoints2
number of de Boor points for the spline in the second direction.
std::vector< WVector3d > getDeBoorPoints()
Returns the stored de Boor points.
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.
int getNumSamplePointsU()
Returns the number of sample points in the second direction that were used for the last call to sampl...
int getNumDeBoorPoints1()
Returns the number of de Boor points in the first direction.
int getNumDeBoorPoints2()
Returns the number of de Boor points in the second direction.
std::vector< WVector3d > m_deBoorPoints
The de Boor points of the splines.
int getOrder2()
Returns the order of the spline in the second direction.
std::vector< double > m_knots2
The knots of the spline in the second direction.
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 ...
void setOrder2(int order)
Sets a new order for the spline in the second direction.
void setKnots2(std::vector< double > knots)
Sets new knots for the spline in the second direction.
int getOrder1()
Returns the order of the spline in the first direction.
std::vector< double > getKnots2()
Returns the stored knots in the second direction.
int m_order2
order for the spline in the second direction.
WVector3d f(double t)
Compute a single sample point on the spline for the given parameter.