|
Core 1.0
|
A simple set of vectors in the plane. More...
#include <vectorset.h>
Public Member Functions | |
| VectorSet2 () | |
| Empty. | |
| VectorSet2 (const QVector< Vector2 > &) | |
| Create a set of vectors. | |
| ~VectorSet2 () | |
| Empty. | |
| VectorSet2 | VectorToPoint () const |
| Convert a series of displacements into positions. | |
| void | Reverse () |
| Reverse the order of the elements. | |
| int | Size () const |
| Return the size of the set. | |
| Vector2 | At (int) const |
| Access to element. | |
| Vector2 & | operator[] (int) |
| Access to element. | |
| Vector2 | Barycenter () const |
| Compute the barycenter. | |
| void | Vibrate (const double &) |
| Randomly move the points. | |
| Box2 | GetBox () const |
| Compute the bounding box. | |
| Convex2 | GetHull () const |
| Compute the convex hull of the set. | |
| void | Rotate (const Matrix2 &) |
| Rotate all the points. | |
| void | Rotate (const double &) |
| Rotate all the points. | |
| void | Translate (const Vector2 &) |
| Translate all the points. | |
| void | Scale (const double &) |
| Scale all the points. | |
| void | Scale (const Vector2 &) |
| Scale all the points. | |
| VectorSet2 | Transformed (const Frame2 &) const |
| Compute the transformed set. | |
| VectorSet2 | Translated (const Vector2 &) const |
| Compute the translated set. | |
| VectorSet2 | Rotated (const double &) const |
| Compute the rotated set. | |
| VectorSet2 | Scaled (const Vector2 &) const |
| Compute the scaled set. | |
| VectorSet2 | Cut (const Box2 &) const |
| Return the subset of points that lie inside the box. | |
| VectorSet2 | Cut (const Octogon2 &) const |
| Return the subset of points that lie inside the octogon. | |
| QVector< Vector2 > & | Get () |
| Access to the internal structure. | |
| const QVector< Vector2 > & | Get () const |
| Access to the internal structure. | |
| int | Nearest (const Vector2 &) const |
| Compute the index of the nearest point to the argument point. | |
| QVector< Vector2 > | Nearest (const Vector2 &, int) const |
| Compute the k-nearest points to the argument point. | |
| QVector< int > | NearestIndexes (const Vector2 &, int) const |
| Compute the set of indexes of the k-nearest points to the argument point. | |
| 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. | |
| void | Draw (const double &, QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draws the set of vectors as a set of discs. | |
| VectorSet2 | operator+ (const VectorSet2 &) const |
| Append a vector set to another one. | |
| void | operator+= (const VectorSet2 &) |
| Append a vector set. | |
Protected Attributes | |
| QVector< Vector2 > | v |
| Vectors. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const VectorSet2 &set) |
| Overloaded output-stream operator. | |
| VectorSet2::VectorSet2 | ( | const QVector< Vector2 > & | s | ) |
Create a set of vectors.
| s | The set. |
| VectorSet2 VectorSet2::Cut | ( | const Box2 & | box | ) | const |
Return the subset of points that lie inside the box.
| box | The box. |
| VectorSet2 VectorSet2::Cut | ( | const Octogon2 & | octogon | ) | const |
Return the subset of points that lie inside the octogon.
| octogon | The octogon. |
| void VectorSet2::Draw | ( | const double & | r, |
| QGraphicsScene & | scene, | ||
| const QPen & | pen = QPen(), | ||
| const QBrush & | brush = QBrush() ) const |
Draws the set of vectors as a set of discs.
| r | Radius. |
| scene | Graphics scene. |
| pen | The pen. |
| brush | The brush. |
| Box2 VectorSet2::GetBox | ( | ) | const |
Compute the bounding box.
Simply calls Box::Box(const QVector&).
| int VectorSet2::Nearest | ( | const Vector2 & | 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 > VectorSet2::NearestIndexes | ( | const Vector2 & | 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 > VectorSet2::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. |
| VectorSet2 VectorSet2::operator+ | ( | const VectorSet2 & | b | ) | const |
Append a vector set to another one.
| b | Added set. |
| void VectorSet2::operator+= | ( | const VectorSet2 & | b | ) |
Append a vector set.
| b | Added set. |
| void VectorSet2::Rotate | ( | const double & | a | ) |
Rotate all the points.
| a | Rotation angle. |
| void VectorSet2::Rotate | ( | const Matrix2 & | r | ) |
Rotate all the points.
| r | Rotation matrix. |
| VectorSet2 VectorSet2::Rotated | ( | const double & | a | ) | const |
Compute the rotated set.
| a | Rotation matrix. |
| void VectorSet2::Scale | ( | const double & | s | ) |
Scale all the points.
| s | Scaling factor. |
| void VectorSet2::Scale | ( | const Vector2 & | s | ) |
Scale all the points.
| s | Scaling vector. |
| VectorSet2 VectorSet2::Scaled | ( | const Vector2 & | s | ) | const |
Compute the scaled set.
| s | Scaling vector. |
| VectorSet2 VectorSet2::Transformed | ( | const Frame2 & | frame | ) | const |
Compute the transformed set.
| frame | The frame. |
| void VectorSet2::Translate | ( | const Vector2 & | t | ) |
Translate all the points.
| t | Translation vector. |
| VectorSet2 VectorSet2::Translated | ( | const Vector2 & | t | ) | const |
Compute the translated set.
| t | Translation vector. |
| VectorSet2 VectorSet2::VectorToPoint | ( | ) | const |
Convert a series of displacements into positions.
Only the first vector will be kept as origin.
| void VectorSet2::Vibrate | ( | const double & | epsilon | ) |
Randomly move the points.
Move points using a random direction.
| epsilon | Moving distance. |
|
friend |
Overloaded output-stream operator.
| set | Set. |
| s | Stream. |