#include <DirectionCone.h>
Public Member Functions | |
DirectionCone () | |
Constructor making an undefined direction cone. | |
DirectionCone (const Point &pt) | |
Constructor making a direction cone whose central direction is given by 'pt', and whose angle is zero. | |
DirectionCone (const Point ¢re, double angle) | |
Constructor making a direction cone whose central direction is given by 'centre', and whose angle (in radians) is 'angle'. | |
~DirectionCone () | |
Do not inherit from this class -- nonvirtual destructor. | |
void | setFromArray (const double *start, const double *end, int dim) |
Re-define an already-existing DirectionCone from an array of 'dim'-dimensional vectors stored in the memory area between 'start' and 'end'. | |
int | dimension () const |
Return the dimension of the Euclidean space in which this DirectionCone is defined. | |
const Point & | centre () const |
Return the central direction of the DirectionCone. | |
double | angle () const |
Return the angle of the DirectionCone. | |
int | greaterThanPi () const |
Inform if the DirectionCone's angle is greater then PI. | |
bool | overlaps (const DirectionCone &cone) const |
Return 'true' if there exists at least one direction that is covered by both 'this' and the 'cone' DirectionCones. | |
bool | perpendicularOverlaps (const DirectionCone &cone) const |
Return 'true' if there exist a direction in one cone that is perpendicular to a direction in the other cone. | |
bool | containsDirection (const Point &pt, double tol=0.0) const |
Return 'true' if the direction specified by 'pt' is contained within the DirectionCone. | |
void | addUnionWith (const Point &pt) |
If necessary, increase the angle of the DirectionCone so that it covers the direction represented by 'pt'. | |
void | addUnionWith (const DirectionCone &cone) |
If necessary, increase the angle of the DirectionCone so that it covers all directions covered by 'cone'. | |
void | read (std::istream &is) |
Read DirectionCone from stream. | |
void | write (std::ostream &os) const |
Write DirectionCone to stream. |
All directions whose angle with the central direction is less than 'alpha' is considered to be covered by the cone. If ever 'alpha' equals or exceeds 180 degrees, any possible direction will end up being covered by the cone.
Definition at line 52 of file DirectionCone.h.
Go::DirectionCone::DirectionCone | ( | const Point & | pt | ) | [inline] |
Constructor making a direction cone whose central direction is given by 'pt', and whose angle is zero.
The length of 'pt' should be assured to be greater than zero, if not, then the DirectionCone will not be well defined.
Definition at line 61 of file DirectionCone.h.
References Go::Point::length(), and Go::Point::normalize().
Go::DirectionCone::DirectionCone | ( | const Point & | centre, | |
double | angle | |||
) | [inline] |
Constructor making a direction cone whose central direction is given by 'centre', and whose angle (in radians) is 'angle'.
The length of 'centre' should be assured to be greater than zero; if not, then the DirectionCone will not be well defined.
Definition at line 72 of file DirectionCone.h.
References Go::Point::length(), and Go::Point::normalize().
void Go::DirectionCone::setFromArray | ( | const double * | start, | |
const double * | end, | |||
int | dim | |||
) |
Re-define an already-existing DirectionCone from an array of 'dim'-dimensional vectors stored in the memory area between 'start' and 'end'.
The first vector in this range will define the central direction of the DirectionCone, and cone's angle will be set wide enough to contain all the other directions given. NB: the length of the range (end - start) must be an exact multiplum of 'dim'.
int Go::DirectionCone::greaterThanPi | ( | ) | const [inline] |
Inform if the DirectionCone's angle is greater then PI.
If this is the case, then naturally ANY spatial direction is included in the cone.
Definition at line 105 of file DirectionCone.h.