#include <visp3/ustk_core/usPolynomialCurve2D.h>
#include <vector>
#include <visp3/core/vpColVector.h>
#include <visp3/core/vpMatrix.h>
int main()
{
std::cout << "Start testUsPolynomialCurve2D" << std::endl;
std::cout << "done: usPolynomialCurve2D default contructor" << std::endl;
std::cout << "done: usPolynomialCurve2D contructor with inital order" << std::endl;
std::cout << "done: usPolynomialCurve2D copy contructor" << std::endl;
curveDefault = curve;
std::cout << "done: usPolynomialCurve2D assignment operator" << std::endl;
std::cout << "done: usPolynomialCurve2D::setOrder" << std::endl;
std::cout << "done: usPolynomialCurve2D::getOrder" << std::endl;
std::cout << "done: usPolynomialCurve2D::setStartParameter" << std::endl;
std::cout << "done: usPolynomialCurve2D::getStartParameter" << std::endl;
std::cout << "done: usPolynomialCurve2D::setEndParameter" << std::endl;
std::cout << "done: usPolynomialCurve2D::getEndParameter" << std::endl;
std::cout << "done: usPolynomialCurve2D::setBoundaries" << std::endl;
vpMatrix M(2, 4, 0.1);
std::cout << "done: usPolynomialCurve2D::setPolynomialCoefficients" << std::endl;
std::cout << "done: usPolynomialCurve2D::getPolynomialCoefficients" << std::endl;
std::cout << "done: usPolynomialCurve2D::setParametricLength" << std::endl;
std::cout << "done: usPolynomialCurve2D::getParametricLength" << std::endl;
std::cout << "done: usPolynomialCurve2D::setLength" << std::endl;
std::cout << "done: usPolynomialCurve2D::getLength" << std::endl;
vpColVector point = curve.
getPoint(0.25);
std::cout << "done: usPolynomialCurve2D::getPoint" << std::endl;
vpColVector params(5, 0);
for (int i = 0; i < 5; i++)
params[i] = 0.1 * i;
std::cout << "done: usPolynomialCurve2D::getPoints" << std::endl;
std::cout << "done: usPolynomialCurve2D::getStartPoint" << std::endl;
std::cout << "done: usPolynomialCurve2D::getEndPoint" << std::endl;
std::cout << "done: usPolynomialCurve2D::getTangent" << std::endl;
std::cout << "done: usPolynomialCurve2D::getStartTangent" << std::endl;
std::cout << "done: usPolynomialCurve2D::getEndTangent" << std::endl;
std::cout << "done: usPolynomialCurve2D::.getDerivative" << std::endl;
std::vector<vpColVector> points1(3, vpColVector(2, 0));
points1.at(1)[0] = 1;
points1.at(2)[1] = 1;
std::vector<double> params1(3, 0);
for (int i = 0; i < 3; i++)
params1[i] = i;
std::vector<vpColVector> points2(4, vpColVector(2, 0));
points2.at(1)[0] = 1;
points2.at(2)[0] = 2;
points2.at(3)[1] = 1;
std::vector<double> params2(4, 0);
for (int i = 0; i < 4; i++)
params2[i] = i;
std::vector<vpColVector> points3(10, vpColVector(2, 0));
points3.at(1)[0] = 1;
points3.at(2)[0] = 2;
points3.at(3)[0] = 3;
points3.at(4)[1] = 1;
points3.at(5)[1] = 2;
points3.at(6)[1] = 3;
points3.at(7)[0] = 1;
points3.at(8)[0] = 2;
points3.at(9)[0] = 2;
points3.at(7)[1] = 2;
points3.at(8)[1] = 2;
points3.at(9)[1] = 2;
std::vector<double> params3(10, 0);
for (int i = 0; i < 10; i++)
params3[i] = i;
std::vector<double> weights3(10);
for (int i = 0; i < 10; i++)
weights3[i] = 1 + 0.2 * (i % 3 - 1);
vpMatrix point3M(2, 10);
for (int i = 0; i < 10; i++)
point3M.insert(points3.at(i), 0, i);
vpColVector params3V(10);
for (int i = 0; i < 10; i++)
params3V[i] = params3.at(i);
vpColVector weights3V(10);
for (int i = 0; i < 10; i++)
weights3V[i] = weights3.at(i);
std::cout << "done: case 1 usPolynomialCurve2D::defineFromPoints(const std::vector<vpColVector> &points, const "
"std::vector<double> ¶m, unsigned int order)"
<< std::endl;
std::cout << "done: case 2 usPolynomialCurve2D::defineFromPoints(const std::vector<vpColVector> &points, const "
"std::vector<double> ¶m, unsigned int order)"
<< std::endl;
std::cout << "done: case 3 usPolynomialCurve2D::defineFromPoints(const std::vector<vpColVector> &points, const "
"std::vector<double> ¶m, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromPoints(const vpMatrix points, const vpColVector ¶m, unsigned "
"int order)"
<< std::endl;
std::cout
<< "done: usPolynomialCurve2D::defineFromPointsAuto(const std::vector<vpColVector> &points, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromPointsAuto(const vpMatrix &points, unsigned int order)"
<< std::endl;
vpColVector direction(2, 0);
direction[0] = 1;
std::cout << "done: usPolynomialCurve2D::defineFromPointsAuto(const std::vector<vpColVector> &points, const "
"vpColVector &direction, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromPointsAuto(const vpMatrix &points, const vpColVector &direction, "
"unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromWeightedPoints(const std::vector<vpColVector> &points, const "
"std::vector<double> ¶m, const std::vector<double> &weights, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromWeightedPoints(const vpMatrix &points, const vpColVector ¶m, "
"const vpColVector &weights, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromWeightedPointsAuto(const std::vector<vpColVector> &points, const "
"std::vector<double> &weights, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromWeightedPointsAuto(const vpMatrix &points, const vpColVector "
"&weights, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromWeightedPointsAuto(const std::vector<vpColVector> &points, const "
"std::vector<double> &weights, const vpColVector &direction, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::defineFromWeightedPointsAuto(const vpMatrix &points, const vpColVector "
"&weights, const vpColVector &direction, unsigned int order)"
<< std::endl;
std::cout << "done: usPolynomialCurve2D::getCurvature" << std::endl;
std::cout << "done: usPolynomialCurve2D::getMeanAxisDeviation" << std::endl;
std::cout << "done: usPolynomialCurve2D::getControlPoints" << std::endl;
std::cout << "done: usPolynomialCurve2D::setControlPoints(const vpMatrix&)" << std::endl;
std::cout << "done: usPolynomialCurve2D::setControlPoints(double**)" << std::endl;
std::cout << "done: usPolynomialCurve2D::getRenderingPoints" << std::endl;
std::cout << "done: usPolynomialCurve2D::getSubPolynomialCurve" << std::endl;
std::cout << "done: case 1 usPolynomialCurve2D::getNewOrderPolynomialCurve" << std::endl;
std::cout << "done: case 2 usPolynomialCurve2D::getNewOrderPolynomialCurve" << std::endl;
std::cout << "done: usPolynomialCurve2D::changeCoefficientsToFitBoundaries" << std::endl;
std::cout << "done: usPolynomialCurve2D::reverse" << std::endl;
std::cout << "done: usPolynomialCurve2D::changeCoefficientsToFitMetricLength" << std::endl;
curve.
move(0.5, -0.25, 1);
std::cout << "done: usPolynomialCurve2D::move" << std::endl;
std::cout << "done: usPolynomialCurve2D::scale" << std::endl;
return 0;
}
usPolynomialCurve2D getNewOrderPolynomialCurve(unsigned int order) const
void changeCoefficientsToFitBoundaries(double startParameter, double endParameter)
double getCurvature(double param) const
void setStartParameter(double startParameter)
void setBoundaries(double startParameter, double endParamter)
void setControlPoints(const vpMatrix &controlPoints)
void setEndParameter(double endParameter)
void changeCoefficientsToFitMetricLength()
void defineFromPointsAuto(const std::vector< vpColVector > &points, unsigned int order=0)
double getEndParameter() const
double getLength(int nbCountSeg=50) const
vpMatrix getPolynomialCoefficients() const
void setParametricLength(double length)
void defineFromWeightedPointsAuto(const std::vector< vpColVector > &points, const std::vector< double > &weights, unsigned int order=0)
vpMatrix getControlPoints() const
vpColVector getTangent(double parameter) const
void setLength(double length, double precision=1e-4)
double getStartParameter() const
vpColVector getEndTangent() const
double getParametricLength() const
void move(double x, double y, double tz)
void setPolynomialCoefficients(const vpMatrix &polynomialCoefficients)
vpColVector getStartPoint() const
void defineFromWeightedPoints(const std::vector< vpColVector > &points, const std::vector< double > ¶m, const std::vector< double > &weights, unsigned int order=0)
vpColVector getPoint(double parameter) const
vpMatrix getRenderingPoints() const
vpColVector getStartTangent() const
double getMeanAxisDeviation(int nbCountSeg=50) const
vpColVector getEndPoint() const
vpColVector getDerivative(double parameter, unsigned int order) const
vpMatrix getPoints(vpColVector parameters) const
void defineFromPoints(const std::vector< vpColVector > &points, const std::vector< double > ¶m, unsigned int order=0)
unsigned int getOrder() const
usPolynomialCurve2D getSubPolynomialCurve(double startParameter, double endParameter) const
void setOrder(unsigned int order)