Core 1.0
|
A simple set of discs. More...
#include <sphereset.h>
Public Member Functions | |
DiscSet2 () | |
Empty. | |
DiscSet2 (const Disc2 &) | |
Creates a sphere set given one sphere. | |
DiscSet2 (const QVector< Disc2 > &) | |
Creates a set of discs. | |
DiscSet2 (const DiscSet2 &, const Disc2 &) | |
Creates a set of discs and keep only the subset of discs that intersect the second argument sphere. | |
~DiscSet2 () | |
Empty. | |
void | Append (const DiscSet2 &) |
Merge with another set of discs. | |
bool | Intersect (const DiscSet2 &) const |
Check if two sphere-sets intersect. | |
bool | Inside (const Vector2 &) const |
Check if a point is inside or outside the set of sphere. | |
bool | IsEmpty () const |
returns true if the set is empty | |
double | R (const DiscSet2 &) const |
Compute the signed distance between two sphere-sets. | |
Box2 | GetBox () const |
Compute the bounding box of the set of discs. | |
Vector2 | Normal (const Vector2 &) const |
Computes the normal vector between a point and the sphere set. | |
double | R (const Vector2 &) const |
Compute the squared distance between a point and the set of discs. | |
double | Signed (const Vector2 &) const |
Compute the signed distance between a point and the set of discs. | |
void | Rotate (const Matrix2 &) |
Rotates a sphere set. | |
void | Translate (const Vector2 &) |
Translates a sphere set. | |
void | Scale (const double &) |
Uniformly scales a sphere-set. | |
void | Transform (const Frame2 &) |
Transforms a sphere set given a frame transformation. | |
int | Size (void) const |
Returns the number of Spheres. | |
Disc2 | GetSphere (int) const |
Returns the number of Spheres. | |
void | RemoveDuplicates (const double &) |
Removes discs that are close to or embedded in the sphere set. | |
Protected Attributes | |
QVector< Disc2 > | discs |
Set of discs. | |
A simple set of discs.
This class implements functions to compute the distance between a point and a set of discs, or the detect whether two set of discs intersect.
|
explicit |
Creates a sphere set given one sphere.
s | Disc2. |
|
explicit |
Creates a set of discs.
s | Set. |
Creates a set of discs and keep only the subset of discs that intersect the second argument sphere.
ss | Set. |
s | Disc2. |
bool DiscSet2::Inside | ( | const Vector2 & | p | ) | const |
Check if a point is inside or outside the set of sphere.
p | The point. |
bool DiscSet2::Intersect | ( | const DiscSet2 & | set | ) | const |
Check if two sphere-sets intersect.
set | Set of discs. |
Computes the normal vector between a point and the sphere set.
Simply project point onto the discs, and return the corresponding Euclidean distance vector.
p | Point. |
double DiscSet2::R | ( | const DiscSet2 & | set | ) | const |
Compute the signed distance between two sphere-sets.
If two discs intersect, the result will be negative. If one of the set is empty, returns 0.0.
set | Set of discs. |
double DiscSet2::R | ( | const Vector2 & | p | ) | const |
Compute the squared distance between a point and the set of discs.
p | The point. |
void DiscSet2::RemoveDuplicates | ( | const double & | t | ) |
Removes discs that are close to or embedded in the sphere set.
t | Threshold value. |
void DiscSet2::Rotate | ( | const Matrix2 & | r | ) |
Rotates a sphere set.
r | Rotation matrix. |
void DiscSet2::Scale | ( | const double & | s | ) |
Uniformly scales a sphere-set.
s | Scaling factor. |
double DiscSet2::Signed | ( | const Vector2 & | p | ) | const |
Compute the signed distance between a point and the set of discs.
p | The point. |
void DiscSet2::Transform | ( | const Frame2 & | t | ) |
Transforms a sphere set given a frame transformation.
t | Transformation. |
void DiscSet2::Translate | ( | const Vector2 & | t | ) |
Translates a sphere set.
t | Translation vector. |