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

Piecewise point curve. More...

#include <curvepoint.h>

Inheritance diagram for PointCurve:
VectorSet

Public Member Functions

 PointCurve ()
 Empty.
 
 PointCurve (const CubicCurve &, int, const double &=0.0, const double &=1.0)
 Creates a point curve from a cubic curve. More...
 
 PointCurve (const QuadricCurve &, int, const double &=0.0, const double &=1.0)
 Creates a point curve from a quadric curve. More...
 
 PointCurve (const QVector< Vector > &, bool=false)
 Creates a curve with points. More...
 
 ~PointCurve ()
 Empty.
 
int Size () const
 Return the size of the sampled curve.
 
Vector Tangent (int) const
 Compute the tangent at a given point. More...
 
bool IsClosed () const
 Check if the curve is closed.
 
double R (const Vector &, double &, int &) const
 Computes the projection of p onto the piecewise linear curve and returns the squared distance. More...
 
double Length () const
 Compute the length of the curve.
 
- Public Member Functions inherited from VectorSet
 VectorSet ()
 Empty.
 
 VectorSet (const QVector< Vector > &)
 Create a set of vectors. More...
 
 VectorSet (Vector *, unsigned int)
 Create a set of vectors. More...
 
void Reverse ()
 Reverse the order of the elements.
 
 ~VectorSet ()
 Empty.
 
Vector At (int) const
 Access to element.
 
Vectoroperator[] (int)
 Access to element.
 
int Size () const
 Return the size of the set.
 
Vector Barycenter () const
 Compute the barycenter.
 
void Append (const Vector &)
 Add a point to the set. More...
 
Box GetBox () const
 Compute the bounding box. More...
 
void Rotate (const Matrix &)
 Rotate all the points. More...
 
void Translate (const Vector &)
 Translate all the points. More...
 
void Scale (const double &)
 Scale all the points. More...
 
void Scale (const Vector &)
 Scale all the points. More...
 
void Transform (const Frame &)
 Transform all the points. More...
 
void Transform (const FrameScaled &)
 Transform all the points. More...
 
QVector< Vector > & Get ()
 Access to the internal structure.
 
const QVector< Vector > & Get () const
 Access to the internal structure.
 
void Clean (const double &)
 Remove redundant points that are within epsilon distance. More...
 
void Load (const QString &)
 Extract vertexes from an .obj file. More...
 
int Nearest (const Vector &) const
 Compute the index of the nearest point to the argument point. More...
 
QVector< VectorNearest (const Vector &, int) const
 Compute the k-nearest points to the argument point. More...
 
QVector< int > NearestIndexes (const Vector &, int) const
 Compute the set of indexes of the k-nearest points to the argument point. More...
 
QVector< int > NearestIndexes (int, int, const double &=Math::Infinity) const
 Compute the set of indexes of the k-nearest points to the argument point in the set. More...
 

Static Public Member Functions

static double Length (const QVector< Vector > &, bool=false)
 Compute the length of a discrete curve. More...
 

Protected Attributes

bool closed
 Closed curve flag.
 
- Protected Attributes inherited from VectorSet
QVector< Vectorv
 Set of vectors.
 

Detailed Description

Piecewise point curve.

Constructor & Destructor Documentation

◆ PointCurve() [1/3]

PointCurve::PointCurve ( const CubicCurve c,
int  n,
const double &  a = 0.0,
const double &  b = 1.0 
)
explicit

Creates a point curve from a cubic curve.

Samples are obtained by a simple discretization of the interval

Parameters
cCubic curve.
nNumber of points.
a,bInterval.

◆ PointCurve() [2/3]

PointCurve::PointCurve ( const QuadricCurve c,
int  n,
const double &  a = 0.0,
const double &  b = 1.0 
)
explicit

Creates a point curve from a quadric curve.

Samples are obtained by a simple discretization of the interval

Parameters
cQuadric curve.
nNumber of points.
a,bInternval.

◆ PointCurve() [3/3]

PointCurve::PointCurve ( const QVector< Vector > &  p,
bool  closed = false 
)
explicit

Creates a curve with points.

Parameters
pSet of points.
closedFlag defining whether the curve is closed (true) or open (false).

Member Function Documentation

◆ Length()

double PointCurve::Length ( const QVector< Vector > &  p,
bool  closed = false 
)
static

Compute the length of a discrete curve.

Parameters
pArray of points.
closedBoolean.

◆ R()

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

Computes the projection of p onto the piecewise linear curve and returns the squared distance.

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.

◆ Tangent()

Vector PointCurve::Tangent ( int  i) const

Compute the tangent at a given point.

Parameters
iIndex.