$darkmode
Public Types | |
enum | { Dimension = 3 } |
typedef P3ScalarType | ScalarType |
Public Member Functions | |
Data Access. | |
access to data is done by overloading of [] or explicit naming of coords (x,y,z) | |
P3ScalarType & | operator[] (const int i) |
const P3ScalarType & | operator[] (const int i) const |
const P3ScalarType & | X () const |
const P3ScalarType & | Y () const |
const P3ScalarType & | Z () const |
P3ScalarType & | X () |
P3ScalarType & | Y () |
P3ScalarType & | Z () |
const P3ScalarType * | V () const |
P3ScalarType * | V () |
P3ScalarType & | V (const int i) |
const P3ScalarType & | V (const int i) const |
Classical overloading of operators | |
Point3 | operator+ (Point3 const &p) const |
Point3 | operator- (Point3 const &p) const |
Point3 | operator* (const P3ScalarType s) const |
Point3 | operator/ (const P3ScalarType s) const |
P3ScalarType | operator* (Point3 const &p) const |
Dot product. | |
P3ScalarType | dot (const Point3 &p) const |
Point3 | operator^ (Point3 const &p) const |
Cross product. | |
Point3 & | operator+= (Point3 const &p) |
Point3 & | operator-= (Point3 const &p) |
Point3 & | operator*= (const P3ScalarType s) |
Point3 & | operator/= (const P3ScalarType s) |
P3ScalarType | Norm () const |
P3ScalarType | SquaredNorm () const |
Point3 & | Scale (const P3ScalarType sx, const P3ScalarType sy, const P3ScalarType sz) |
Point3 & | Scale (const Point3 &p) |
Point3 & | Normalize () |
void | normalize (void) |
Point3 | normalized (void) const |
void | ToPolarRad (P3ScalarType &ro, P3ScalarType &theta, P3ScalarType &phi) const |
void | FromPolarRad (const P3ScalarType &ro, const P3ScalarType &theta, const P3ScalarType &phi) |
Box3< P3ScalarType > | GetBBox (Box3< P3ScalarType > &bb) const |
size_t | MaxCoeffId () const |
Comparison Operators. | |
Note that the reverse z prioritized ordering, useful in many situations. | |
bool | operator== (Point3 const &p) const |
bool | operator!= (Point3 const &p) const |
bool | operator< (Point3 const &p) const |
bool | operator> (Point3 const &p) const |
bool | operator<= (Point3 const &p) const |
bool | operator>= (Point3 const &p) const |
Point3 | operator- (void) const |
Protected Attributes | |
P3ScalarType | _v [3] |
The only data member. Hidden to user. | |
Standard Constructors and Initializers | |
No casting operators have been introduced to avoid automatic unattended (and costly) conversion between different point types | |
Point3 () | |
Point3 (const P3ScalarType nx, const P3ScalarType ny, const P3ScalarType nz) | |
Point3 (Point3 const &p)=default | |
template<class Q > | |
Point3 (Point3< Q > const &p) | |
Point3 (const P3ScalarType nv[3]) | |
Point3 & | operator= (Point3 const &p)=default |
template<class Q > | |
Point3 & | operator= (Point3< Q > const &p) |
void | SetZero () |
P3ScalarType | Ext (const int i) const |
template<class Q > | |
void | Import (const Point3< Q > &b) |
template<class EigenVector > | |
void | FromEigenVector (const EigenVector &b) |
template<class EigenVector > | |
void | ToEigenVector (EigenVector &b) const |
template<class EigenVector > | |
EigenVector | ToEigenVector (void) const |
template<class Q > | |
static Point3 | Construct (const Point3< Q > &b) |
template<class Q > | |
static Point3 | Construct (const Q &P0, const Q &P1, const Q &P2) |
static Point3 | Construct (const Point3< ScalarType > &b) |
static Point3 | Zero (void) |
static Point3 | One (void) |
|
inlinedefault |
Default copy constructor
|
inline |
Copy from Point with different template
|
inline |
Padding function: give a default 0 value to all the elements that are not in the [0..2] range. Useful for managing in a consistent way object that could have point2 / point3 / point4
|
inline |
Convert from polar coordinates to cartesian coordinates.
Theta is the azimuth angle and ranges between [0, 2PI) radians. Phi is the elevation angle (not the polar angle) and ranges between [-PI/2, PI/2] radians.
|
inlinedefault |
Default copy assignment
|
inline |
Copy assignment from Point with different template
|
inline |
Convert to polar coordinates from cartesian coordinates.
Theta is the azimuth angle and ranges between [0, 2PI) degrees. Phi is the elevation angle (not the polar angle) and ranges between [-PI/2, PI/2] degrees.
/note Note that instead of the classical polar angle, which ranges between 0 and PI degrees we opt for the elevation angle to obtain a more intuitive spherical coordinate system.