Core 1.0
Public Member Functions | Protected Attributes | List of all members
CubicCurveSet Class Reference

Piecewise cubic curves. More...

#include <curveset.h>

Public Member Functions

 CubicCurveSet ()
 Creates an empty piecewise quadric curve.
 
 CubicCurveSet (const QVector< CubicCurve > &)
 Creates the piecewise quadric curve given a set of CubicCurves. More...
 
 CubicCurveSet (const QVector< Vector > &, const Vector &=Vector::Null, const Vector &=Vector::Null)
 Creates the piecewise cubic curve given a set of control points with the Cattmul-Rom construction. More...
 
 ~CubicCurveSet ()
 Empty.
 
Matrix GetMatrix (const double &) const
 Compute the Frenet vectors at a given point on the curve. More...
 
Frame GetFrame (const double &) const
 Compute the Frenet frame at a given point on the curve. More...
 
int Size () const
 Return the number of elements of the piecewise cubic curve.
 
Box GetBox () const
 Compute the bounding box of the curve.
 
QuadricCurveSet Approximate (double) const
 Approximate a piecewise cubic curve by a piecewise quadric curve. More...
 
double GetLength () const
 Return the length of the curve.
 
double GetLength (int) const
 Return the length of the sub-curve. More...
 
QVector< VectorGetDiscretisation (const double &) const
 Generates a discretization of the curve with a linear curvilign absisca parameterization. More...
 
QVector< VectorGetDiscretisation (const double &, QVector< Vector > &) const
 Generates a discretization of the curve with a linear curvilign absisca parameterization. More...
 
int U (const double &, double &) const
 Compute the parameter of the curve corresponding to the input length. More...
 
double R (const Vector &, double &, int &) const
 Computes the squared distance between a point and a set of cubic curves. More...
 

Protected Attributes

QVector< CubicCurvecurve
 Set of cubic (spline) curves.
 
QVector< double > lengths
 Length of every curve (internal optimization).
 
double length = 0.0
 Total length (internal optimization).
 

Detailed Description

Piecewise cubic curves.

Constructor & Destructor Documentation

◆ CubicCurveSet() [1/2]

CubicCurveSet::CubicCurveSet ( const QVector< CubicCurve > &  control)
explicit

Creates the piecewise quadric curve given a set of CubicCurves.

Parameters
controlSet of cubic curves.

◆ CubicCurveSet() [2/2]

CubicCurveSet::CubicCurveSet ( const QVector< Vector > &  control,
const Vector ta = Vector::Null,
const Vector tb = Vector::Null 
)
explicit

Creates the piecewise cubic curve given a set of control points with the Cattmul-Rom construction.

Parameters
controlSet of points.
taStarting tangent vector
tbEnding tangent vector

Member Function Documentation

◆ Approximate()

QuadricCurveSet CubicCurveSet::Approximate ( double  gamma) const

Approximate a piecewise cubic curve by a piecewise quadric curve.

There are twice as many quadric curves as cubic curves.

See also
CubicCurve::Approximate
Parameters
gammaSubdision parameter, in [0,1].

◆ GetDiscretisation() [1/2]

QVector< Vector > CubicCurveSet::GetDiscretisation ( const double &  s) const

Generates a discretization of the curve with a linear curvilign absisca parameterization.

Parameters
sStepping distance.

◆ GetDiscretisation() [2/2]

QVector< Vector > CubicCurveSet::GetDiscretisation ( const double &  s,
QVector< Vector > &  tangents 
) const

Generates a discretization of the curve with a linear curvilign absisca parameterization.

Parameters
sStepping distance.
tangentsTangents to the curve at sample points.

◆ GetFrame()

Frame CubicCurveSet::GetFrame ( const double &  u) const

Compute the Frenet frame at a given point on the curve.

Parameters
uParameter.

◆ GetLength()

double CubicCurveSet::GetLength ( int  k) const
inline

Return the length of the sub-curve.

Parameters
kCurve index.

◆ GetMatrix()

Matrix CubicCurveSet::GetMatrix ( const double &  u) const

Compute the Frenet vectors at a given point on the curve.

The columns of the returned matrix contain the tangent, binormal and normal vectors.

Parameters
uParameter.

◆ R()

double CubicCurveSet::R ( const Vector p,
double &  u,
int &  k 
) const

Computes the squared distance between a point and a set of cubic curves.

See also
CubicCurve::R()
Parameters
pPoint.
uParameter defining the coordinate of the projection of the argument vertex onto the curve.
kIndex of the curve for which the minimum distance was found.

◆ U()

int CubicCurveSet::U ( const double &  s,
double &  u 
) const

Compute the parameter of the curve corresponding to the input length.

Parameters
sInput length.
uParameter of the i-th curve.
Returns
Identifier of the curve in the piecewise definition.