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

Piecewise quadric curves. More...

#include <curveset.h>

Public Member Functions

 QuadricCurveSet ()
 Creates an empty piecewise quadric curve.
 
 QuadricCurveSet (const QVector< Vector > &)
 Creates the piecewise quadric curve given a set of control points. More...
 
 QuadricCurveSet (const QVector< QuadricCurve > &)
 Create a set of quadric curves. More...
 
 ~QuadricCurveSet ()
 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
 Returns the number of elements of the piecewise quadric curve. More...
 
QuadricCurve operator() (int) const
 Read only access to the elements of the piecewise quadric curve.
 
QVector< VectorGetDiscretisation (const double &) 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
 This function returns the squared distance between a point and a set of quadric curves. More...
 
Box GetBox () const
 Compute the bounding box of the curve.
 
double GetLength () const
 Return the length of the curve.
 
double GetLength (int) const
 Return the length of the sub-curve. More...
 
QuadricCurveSetoperator+= (const QuadricCurveSet &)
 Appends a piecewise cubic curve to an existing piecewise cubic curve. More...
 

Protected Attributes

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

Detailed Description

Piecewise quadric curves.

The array of quadric curves is stored using a QVector container so as to simplify memory management.

Constructor & Destructor Documentation

◆ QuadricCurveSet() [1/2]

QuadricCurveSet::QuadricCurveSet ( const QVector< Vector > &  p)
explicit

Creates the piecewise quadric curve given a set of control points.

Parameters
pControl vertices.

◆ QuadricCurveSet() [2/2]

QuadricCurveSet::QuadricCurveSet ( const QVector< QuadricCurve > &  s)
explicit

Create a set of quadric curves.

Parameters
sSet of quadric curves.

Member Function Documentation

◆ GetDiscretisation()

QVector< Vector > QuadricCurveSet::GetDiscretisation ( const double &  step) const

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

Parameters
stepStepping distance.

◆ GetFrame()

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

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

Parameters
uParameter.

◆ GetLength()

double QuadricCurveSet::GetLength ( int  k) const
inline

Return the length of the sub-curve.

Parameters
kCurve index.

◆ GetMatrix()

Matrix QuadricCurveSet::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.

◆ operator+=()

QuadricCurveSet & QuadricCurveSet::operator+= ( const QuadricCurveSet c)

Appends a piecewise cubic curve to an existing piecewise cubic curve.

Parameters
cArgument piecewise cubic curve.

◆ R()

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

This function returns the squared distance between a point and a set of quadric curves.

See also
QuadicCurve::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.

◆ Size()

int QuadricCurveSet::Size ( ) const
inline

Returns the number of elements of the piecewise quadric curve.

Parameters
kCurve index.

◆ U()

int QuadricCurveSet::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.