ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
active::geometry::Point Class Reference

#include <Point.h>

Inheritance diagram for active::geometry::Point:
Inheritance graph
[legend]
Collaboration diagram for active::geometry::Point:
Collaboration graph
[legend]

Public Types

using Unique = std::unique_ptr<Point>
 Unique pointer.
 
using Shared = std::shared_ptr<Point>
 Shared pointer.
 
using Option = std::optional<Point>
 Optional.
 

Public Member Functions

 Point ()
 
 Point (const double &x, const double &y, const double &z=0.0)
 
 Point (const Point &source2D, double z)
 
virtual ~Point ()=default
 
virtual PointclonePtr () const
 
virtual bool operator== (const Point &ref) const
 
virtual bool operator!= (const Point &ref) const
 
virtual bool operator< (const Point &ref) const
 
Pointoperator= (const Point &source)
 
virtual Point operator+ (const Point &offset) const
 
virtual Pointoperator+= (const Point &offset)
 
virtual Point operator- (const Point &offset) const
 
virtual Pointoperator-= (const Point &offset)
 
virtual Point operator* (const double &mult) const
 
virtual Point operator* (const Matrix3x3 &matrix) const
 
virtual Point operator* (const Matrix4x4 &matrix) const
 
virtual Pointoperator*= (const double &mult)
 
virtual Pointoperator*= (const Matrix3x3 &matrix)
 
virtual Pointoperator*= (const Matrix4x4 &matrix)
 
virtual Point operator/ (const double &mult) const
 
virtual Pointoperator/= (const double &mult)
 
virtual bool isEqual2D (const Point &ref, double prec=math::eps) const
 
virtual bool isEqual3D (const Point &ref, double prec=math::eps) const
 
virtual double lengthFrom2D (const Point &ref) const
 
virtual double lengthFrom3D (const Point &ref) const
 
Point rounded2D (double prec=math::eps) const
 
Point rounded3D (double prec=math::eps) const
 
double azimuthAngleTo (const Point &ref) const
 
double altitudeAngleTo (const Point &ref) const
 
PointmovePolar (double len, double angle)
 
PointmovePolar (double len, double azim, double alt)
 
- Public Member Functions inherited from active::utility::Cloner
virtual ~Cloner ()=default
 

Public Attributes

double x
 X coordinate.
 
double y
 Y coordinate.
 
double z
 Z coordinate.
 

Detailed Description

A class to represent a point in 3-dimensional space, i.e. with x, y, z coordinates

Note that this class serves for both 2D and 3D contexts (rather than having a separate class for each). Functionality that is specific to either context is clearly labelled, e.g. 'isEqual2D' vs 'isEqual3D'.

Constructor & Destructor Documentation

◆ Point() [1/3]

Point::Point ( )

Constructor

Here is the caller graph for this function:

◆ Point() [2/3]

Point::Point ( const double & x,
const double & y,
const double & z = 0.0 )

Constructor

Parameters
xX coordinate
yY coordinate
zZ coordinate

◆ Point() [3/3]

Point::Point ( const Point & source2D,
double z )

Constructor

Parameters
source2DA 2D point, i.e. only the x/y coordinates are relevant
zz coordinate

◆ ~Point()

virtual active::geometry::Point::~Point ( )
virtualdefault

Destructor

Member Function Documentation

◆ altitudeAngleTo()

double Point::altitudeAngleTo ( const Point & ref) const

Calculates the altitude angle from this to the specified point

Parameters
refA point to calculate the angle to
Returns
The altitude angle from this to the specified point (-pi / 2 to pi / 2)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ azimuthAngleTo()

double Point::azimuthAngleTo ( const Point & ref) const

Calculates the azimuth angle from this to the specified point

Parameters
refA point to calculate the angle to
Returns
The azimuth angle from this to the specified point (0 to 2.pi)
Here is the caller graph for this function:

◆ clonePtr()

virtual Point * active::geometry::Point::clonePtr ( ) const
inlinevirtual

Clone method

Returns
A clone of this object

Implements active::utility::Cloner.

Reimplemented in active::geometry::XPoint, and active::geometry::PolyPoint.

Here is the call graph for this function:

◆ isEqual2D()

bool Point::isEqual2D ( const Point & ref,
double prec = math::eps ) const
virtual

Determine if two points are equal in 2D

Parameters
refThe point to compare with this
precPrecision
Returns
True if the points are identical
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEqual3D()

bool Point::isEqual3D ( const Point & ref,
double prec = math::eps ) const
virtual

Determine if two points are equal

Parameters
refThe point to compare with this
precPrecision
Returns
True if the points are identical
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lengthFrom2D()

double Point::lengthFrom2D ( const Point & ref) const
virtual

Calculates the 2D distance from this to a specified point

Parameters
refThe point to compare with this
Returns
The 2D distance between the points

Reimplemented in active::geometry::PolyPoint.

Here is the caller graph for this function:

◆ lengthFrom3D()

double Point::lengthFrom3D ( const Point & ref) const
virtual

Calculates the distant from a specified point to this in 3D

Parameters
refA point to calculate the distance from
Returns
The distance from the point to this
Here is the caller graph for this function:

◆ movePolar() [1/2]

Point & Point::movePolar ( double len,
double angle )

Offset a point in the x/y plane by the specified distance and angle

Parameters
lenThe distance to move the point
angleThe angle on which the point will move
Returns
A reference to this
Here is the caller graph for this function:

◆ movePolar() [2/2]

Point & Point::movePolar ( double len,
double azim,
double alt )

Offset a point in the x/y/z plane by the specified distance and azimuth/altitude angle

Parameters
lenThe distance to move the point
azimThe azimuth angle on which the point will move
altThe altitude angle on which the point will move
Returns
A reference to this

◆ operator!=()

virtual bool active::geometry::Point::operator!= ( const Point & ref) const
inlinevirtual

Inequality operator

Parameters
refThe point to compare with this
Returns
True if the points are different
Here is the call graph for this function:

◆ operator*() [1/3]

Point Point::operator* ( const double & mult) const
virtual

Multiplication operator

Parameters
multThe factor to multiply the point by
Returns
The result of the multiplication of this and the specified factor
Here is the call graph for this function:

◆ operator*() [2/3]

Point Point::operator* ( const Matrix3x3 & matrix) const
virtual

Multiplication operator

Parameters
matrixThe matrix to multiply the point by
Returns
The result of the multiplication

◆ operator*() [3/3]

Point Point::operator* ( const Matrix4x4 & matrix) const
virtual

Multiplication operator

Parameters
matrixThe matrix to multiply the point by
Returns
The result of the multiplication

◆ operator*=() [1/3]

Point & Point::operator*= ( const double & mult)
virtual

Multiplication and assignment operator

Parameters
multThe factor to multiply the point by
Returns
A reference to this

◆ operator*=() [2/3]

Point & Point::operator*= ( const Matrix3x3 & matrix)
virtual

Multiplication and assignment operator

Parameters
matrixThe matrix to multiply the point by
Returns
A reference to this

◆ operator*=() [3/3]

Point & Point::operator*= ( const Matrix4x4 & matrix)
virtual

Multiplication and assignment operator

Parameters
matrixThe matrix to multiply the point by
Returns
A reference to this

◆ operator+()

Point Point::operator+ ( const Point & offset) const
virtual

Addition operator

Parameters
offsetThe point to add
Returns
The sum of this and the specified points
Here is the call graph for this function:

◆ operator+=()

Point & Point::operator+= ( const Point & offset)
virtual

Addition and assignment operator

Parameters
offsetThe point to add
Returns
A reference to this

◆ operator-()

Point Point::operator- ( const Point & offset) const
virtual

Substraction operator

Parameters
offsetThe point to substract
Returns
The result of this less the specified point
Here is the call graph for this function:

◆ operator-=()

Point & Point::operator-= ( const Point & offset)
virtual

Substraction and assignment operator

Parameters
offsetThe point to substract
Returns
A reference to this

◆ operator/()

Point Point::operator/ ( const double & mult) const
virtual

Division operator

Parameters
multThe factor to divide the point by
Returns
The result of the division of this by the specified factor
Here is the call graph for this function:

◆ operator/=()

Point & Point::operator/= ( const double & mult)
virtual

Division and assignment operator

Parameters
multThe factor to divide the point by
Returns
A reference to this

◆ operator<()

bool Point::operator< ( const Point & ref) const
virtual

Less-than operator

Parameters
refThe point to compare with this
Returns
True if this is less than ref
Here is the call graph for this function:

◆ operator=()

Point & Point::operator= ( const Point & source)

Assignment operator

Parameters
sourceThe point to assign
Returns
A reference to this
Here is the caller graph for this function:

◆ operator==()

virtual bool active::geometry::Point::operator== ( const Point & ref) const
inlinevirtual

Equality operator

Parameters
refThe point to compare with this
Returns
True if the points are identical
Here is the call graph for this function:

◆ rounded2D()

Point Point::rounded2D ( double prec = math::eps) const

Return the point with coordinates rounded to the specified level of precision

Returns
The point with rounded coordinates (z set to 0.0)
Here is the call graph for this function:

◆ rounded3D()

Point Point::rounded3D ( double prec = math::eps) const

Return the point with coordinates rounded to the specified level of precision

Returns
The point with rounded coordinates
Here is the call graph for this function:

The documentation for this class was generated from the following files: