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

A simple set of vectors. More...

#include <vectorset.h>

Inheritance diagram for VectorSet:
PointCurve

Public Member Functions

 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...
 

Protected Attributes

QVector< Vectorv
 Set of vectors.
 

Friends

std::ostream & operator<< (std::ostream &, const VectorSet &)
 Overloaded output-stream operator. More...
 

Detailed Description

A simple set of vectors.

This class implements several simple functions to handle point sets: affine transforms, bounding box computation.

Constructor & Destructor Documentation

◆ VectorSet() [1/2]

VectorSet::VectorSet ( const QVector< Vector > &  s)
explicit

Create a set of vectors.

Parameters
sThe set.

◆ VectorSet() [2/2]

VectorSet::VectorSet ( Vector s,
unsigned int  n 
)
explicit

Create a set of vectors.

Parameters
sThe set.
nSize.

Member Function Documentation

◆ Append()

void VectorSet::Append ( const Vector p)

Add a point to the set.

Parameters
pPoint.

◆ Clean()

void VectorSet::Clean ( const double &  e)

Remove redundant points that are within epsilon distance.

Parameters
eEpsilon.

◆ GetBox()

Box VectorSet::GetBox ( ) const

Compute the bounding box.

Simply calls Box::Box(const QVector&).

◆ Load()

void VectorSet::Load ( const QString &  name)

Extract vertexes from an .obj file.

Parameters
nameFile name.

◆ Nearest() [1/2]

int VectorSet::Nearest ( const Vector p) const

Compute the index of the nearest point to the argument point.

Parameters
pPoint.

◆ Nearest() [2/2]

QVector< Vector > VectorSet::Nearest ( const Vector p,
int  n 
) const

Compute the k-nearest points to the argument point.

Parameters
pPoint.
nNumber of points.

◆ NearestIndexes() [1/2]

QVector< int > VectorSet::NearestIndexes ( const Vector p,
int  n 
) const

Compute the set of indexes of the k-nearest points to the argument point.

Parameters
pPoint.
nNumber of points.

◆ NearestIndexes() [2/2]

QVector< int > VectorSet::NearestIndexes ( int  ip,
int  n,
const double &  d = Math::Infinity 
) const

Compute the set of indexes of the k-nearest points to the argument point in the set.

Parameters
ipIndex of the point.
nNumber of points.
dMaximum distance threshold.

◆ Rotate()

void VectorSet::Rotate ( const Matrix r)

Rotate all the points.

Parameters
rRotation matrix.

◆ Scale() [1/2]

void VectorSet::Scale ( const double &  s)

Scale all the points.

Parameters
sScaling factor.

◆ Scale() [2/2]

void VectorSet::Scale ( const Vector s)

Scale all the points.

Parameters
sScaling vector.

◆ Transform() [1/2]

void VectorSet::Transform ( const Frame f)

Transform all the points.

Parameters
fFrame.

◆ Transform() [2/2]

void VectorSet::Transform ( const FrameScaled f)

Transform all the points.

Parameters
fFrame.

◆ Translate()

void VectorSet::Translate ( const Vector t)

Translate all the points.

Parameters
tTranslation vector.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const VectorSet set 
)
friend

Overloaded output-stream operator.

Parameters
setSet.
sStream.