#include <visp3/ustk_core/usBSpline3D.h>
#include <vector>
#include <visp3/core/vpColVector.h>
#include <visp3/core/vpHomogeneousMatrix.h>
int main()
{
std::cout << "Start testUsBSpline3D" << std::endl;
std::cout << "done: usBSpline3D default contructor" << std::endl;
std::cout << "done: usBSpline3D copy contructor" << std::endl;
spline = spline2;
std::cout << "done: usBSpline3D assignment operator" << std::endl;
std::cout << "done: usBSpline3D polymorphic copy" << std::endl;
std::vector<vpColVector> points(4, vpColVector(3, 0));
points.at(1)[0] = 1;
points.at(2)[1] = 2;
points.at(3)[2] = 1;
std::vector<double> params(4, 0);
for (int i = 0; i < 4; i++)
params[i] = i;
curve2.
move(1, 0.5, 0, 1, 0, 0);
curve3.
move(-0.5, 0, -0.5, 0, 1, 0.5);
std::cout << "done: usBSpline3D::addSegment" << std::endl;
std::cout << "done: usBSpline3D::insertSegment" << std::endl;
std::cout << "done: usBSpline3D::setSegment" << std::endl;
std::cout << "done: usBSpline3D::removeSegment" << std::endl;
std::cout << "done: usBSpline3D::removeLastSegment" << std::endl;
std::cout << "done: usBSpline3D::removeSegments" << std::endl;
std::cout << "done: usBSpline3D::getNbSegments" << std::endl;
std::cout << "done: usBSpline3D::getParametricLength" << std::endl;
std::cout << "done: usBSpline3D::getLength" << std::endl;
std::cout << "done: usBSpline3D::clear" << std::endl;
std::vector<double> lengths(3, 1);
std::cout << "done: usBSpline3D::defineFromPoints" << std::endl;
std::cout << "done: usBSpline3D::accessSegment const" << std::endl;
std::cout << "done: usBSpline3D::accessLastSegment const" << std::endl;
std::cout << "done: usBSpline3D::addSegment" << std::endl;
std::cout << "done: usBSpline3D::addSegment" << std::endl;
std::cout << "done: usBSpline3D::getSubSpline" << std::endl;
spline.
move(vpHomogeneousMatrix(0.5, -0.25, 0.1, 1, -1, 0.2));
std::cout << "done: usBSpline3D::move(const vpHomogeneousMatrix&)" << std::endl;
spline.
move(0.5, -0.25, 0.1, 1, -1, 0.2);
std::cout << "done: usBSpline3D::move(double,double,double,double,double,double)" << std::endl;
std::cout << "done: usBSpline3D::getPoint" << std::endl;
std::cout << "done: usBSpline3D::getTangent" << std::endl;
std::cout << "done: usBSpline3D::getDistanceFromPoint" << std::endl;
int index;
double param;
std::cout << "done: usBSpline3D::getParametersFromLength" << std::endl;
vpColVector center3D;
vpColVector direction3D;
std::cout << "done: usBSpline3D::getCurvatureFromShape" << std::endl;
delete spline3;
std::cout << "done: usBSpline3D::~usBSpline3D" << std::endl;
return 0;
}
void setSegment(int i, const usPolynomialCurve3D &poly)
double getLength(int nbSubSeg=50) const
bool getParametersFromLength(double l, int &index, double ¶m) const
void insertSegment(int i, const usPolynomialCurve3D &seg)
void removeSegments(int i, int j)
double getDistanceFromPoint(const vpColVector &point, double start=0, double stop=-1, double threshold=1e-5) const
const usPolynomialCurve3D & accessSegment(int i) const
vpColVector getTangent(double param) const
void addSegment(const usPolynomialCurve3D &seg)
Spline definition.
int getNbSegments() const
Parameters setters and getters.
const usPolynomialCurve3D & accessLastSegment() const
bool move(const vpHomogeneousMatrix &H)
Move.
vpColVector getPoint(double param) const
Measure curve information.
virtual usBSpline3D * clone() const
usBSpline3D getSubSpline(double a, double b) const
double getCurvatureFromShape(double start, double end, vpColVector ¢er3D, vpColVector &direction3D) const
Curvature.
void defineFromPoints(const std::vector< vpColVector > &points, const std::vector< double > &lengths, int order=3)
void removeSegment(int i)
double getParametricLength() const
void defineFromPoints(const std::vector< vpColVector > &points, const std::vector< double > ¶m, unsigned int order=0)
void move(const vpHomogeneousMatrix &H)