Core 1.0
|
A simple set of vectors. More...
#include <vectorset.h>
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. | |
Vector & | operator[] (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< Vector > | Nearest (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< Vector > | v |
Set of vectors. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const VectorSet &) |
Overloaded output-stream operator. More... | |
A simple set of vectors.
This class implements several simple functions to handle point sets: affine transforms, bounding box computation.
|
explicit |
Create a set of vectors.
s | The set. |
|
explicit |
Create a set of vectors.
s | The set. |
n | Size. |
void VectorSet::Append | ( | const Vector & | p | ) |
Add a point to the set.
p | Point. |
void VectorSet::Clean | ( | const double & | e | ) |
Remove redundant points that are within epsilon distance.
e | Epsilon. |
Box VectorSet::GetBox | ( | ) | const |
Compute the bounding box.
Simply calls Box::Box(const QVector&).
void VectorSet::Load | ( | const QString & | name | ) |
Extract vertexes from an .obj file.
name | File name. |
int VectorSet::Nearest | ( | const Vector & | p | ) | const |
Compute the index of the nearest point to the argument point.
p | Point. |
Compute the k-nearest points to the argument point.
p | Point. |
n | Number of points. |
QVector< int > VectorSet::NearestIndexes | ( | const Vector & | p, |
int | n | ||
) | const |
Compute the set of indexes of the k-nearest points to the argument point.
p | Point. |
n | Number of points. |
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.
ip | Index of the point. |
n | Number of points. |
d | Maximum distance threshold. |
void VectorSet::Rotate | ( | const Matrix & | r | ) |
Rotate all the points.
r | Rotation matrix. |
void VectorSet::Scale | ( | const double & | s | ) |
Scale all the points.
s | Scaling factor. |
void VectorSet::Scale | ( | const Vector & | s | ) |
Scale all the points.
s | Scaling vector. |
void VectorSet::Transform | ( | const Frame & | f | ) |
Transform all the points.
f | Frame. |
void VectorSet::Transform | ( | const FrameScaled & | f | ) |
Transform all the points.
f | Frame. |
void VectorSet::Translate | ( | const Vector & | t | ) |
Translate all the points.
t | Translation vector. |
|
friend |
Overloaded output-stream operator.
set | Set. |
s | Stream. |