Public Member Functions | Private Attributes | Friends | List of all members
ecl::CartesianPoint< T, 2 > Class Template Reference

Specialisation for a cartesian point of dimension 2. More...

#include <cartesian_point.hpp>

Public Member Functions

 CartesianPoint (const T &value=T())
 Default constructor - sets all elements to the same value. More...
 
 CartesianPoint (const ecl::linear_algebra::Matrix< T, 2, 1 > &vec)
 Initialises with the specified input vector. More...
 
 CartesianPoint (const CartesianPoint< T, 2 > &point)
 Default copy constructor. More...
 
 CartesianPoint (const T &x_i, const T &y_i)
 
distance (const CartesianPoint< T, 2 > &other)
 
double get_angle (void)
 
double Norm (void)
 
Normalize (void)
 
bool operator!= (const CartesianPoint< T, 2 > &other) const
 
CartesianPoint< T, 2 > operator* (double d) const
 
CartesianPoint< T, 2 > operator+ (const CartesianPoint< T, 2 > &v) const
 
void operator+= (const CartesianPoint< T, 2 > &other)
 
CartesianPoint< T, 2 > operator- (const CartesianPoint< T, 2 > &v) const
 
ecl::linear_algebra::CommaInitializer< ecl::linear_algebra::Matrix< T, 2, 1 > > operator<< (const T &value)
 
const CartesianPoint< T, 2 > & operator= (const CartesianPoint< T, 2 > &v)
 
bool operator== (const CartesianPoint< T, 2 > &other) const
 
T & operator[] (const unsigned int &index)
 
const T operator[] (const unsigned int &index) const
 
ecl::linear_algebra::Matrix< T, 2, 1 > & positionVector ()
 Representation of the position vector in eigen vector format. More...
 
const ecl::linear_algebra::Matrix< T, 2, 1 > & positionVector () const
 Representation of the position vector in const eigen vector format. More...
 
void rotate (const double &angle)
 
unsigned int size ()
 Size/dimension of the cartesian point. More...
 
const T & x () const
 Returns a constant reference to the x co-ordinate. More...
 
x ()
 Returns a copy of the x co-ordinate. More...
 
void x (const T &value)
 Sets the x-cor.dinate. More...
 
const T & y () const
 Returns a constant reference to the y co-ordinate. More...
 
y ()
 Returns a copy of the y co-ordinate. More...
 
void y (const T &value)
 Sets the y-cordinate. More...
 
virtual ~CartesianPoint ()
 

Private Attributes

ecl::linear_algebra::Matrix< T, 2, 1 > elements
 

Friends

template<typename OutputStream , typename Type >
OutputStream & operator<< (OutputStream &ostream, const CartesianPoint< Type, 2 > &point)
 

Detailed Description

template<typename T>
class ecl::CartesianPoint< T, 2 >

Specialisation for a cartesian point of dimension 2.

It introduces handles to x(), y(), z() for convenience, whilst still permitting a vector representation of the underlying storage container via the positionVector() method.

Template Parameters
T: the underlying element type.
See also
CartesianPoint2d, CartesianPoint2f, CartesianPoint2i.

Definition at line 299 of file cartesian_point.hpp.

Constructor & Destructor Documentation

◆ CartesianPoint() [1/4]

template<typename T >
ecl::CartesianPoint< T, 2 >::CartesianPoint ( const T &  value = T())
inline

Default constructor - sets all elements to the same value.

Definition at line 304 of file cartesian_point.hpp.

◆ CartesianPoint() [2/4]

template<typename T >
ecl::CartesianPoint< T, 2 >::CartesianPoint ( const ecl::linear_algebra::Matrix< T, 2, 1 > &  vec)
inline

Initialises with the specified input vector.

Parameters
vec: input three dimensional vector.

Definition at line 310 of file cartesian_point.hpp.

◆ CartesianPoint() [3/4]

template<typename T >
ecl::CartesianPoint< T, 2 >::CartesianPoint ( const CartesianPoint< T, 2 > &  point)
inline

Default copy constructor.

Parameters
point: copy this point directly.

Definition at line 316 of file cartesian_point.hpp.

◆ CartesianPoint() [4/4]

template<typename T >
ecl::CartesianPoint< T, 2 >::CartesianPoint ( const T &  x_i,
const T &  y_i 
)
inline

Definition at line 318 of file cartesian_point.hpp.

◆ ~CartesianPoint()

template<typename T >
virtual ecl::CartesianPoint< T, 2 >::~CartesianPoint ( )
inlinevirtual

Definition at line 322 of file cartesian_point.hpp.

Member Function Documentation

◆ distance()

template<typename T >
T ecl::CartesianPoint< T, 2 >::distance ( const CartesianPoint< T, 2 > &  other)
inline

Definition at line 444 of file cartesian_point.hpp.

◆ get_angle()

template<typename T >
double ecl::CartesianPoint< T, 2 >::get_angle ( void  )
inline

Definition at line 434 of file cartesian_point.hpp.

◆ Norm()

template<typename T >
double ecl::CartesianPoint< T, 2 >::Norm ( void  )
inline

Definition at line 481 of file cartesian_point.hpp.

◆ Normalize()

template<typename T >
T ecl::CartesianPoint< T, 2 >::Normalize ( void  )
inline

Definition at line 450 of file cartesian_point.hpp.

◆ operator!=()

template<typename T >
bool ecl::CartesianPoint< T, 2 >::operator!= ( const CartesianPoint< T, 2 > &  other) const
inline

Definition at line 417 of file cartesian_point.hpp.

◆ operator*()

template<typename T >
CartesianPoint<T,2> ecl::CartesianPoint< T, 2 >::operator* ( double  d) const
inline

Definition at line 466 of file cartesian_point.hpp.

◆ operator+()

template<typename T >
CartesianPoint<T,2> ecl::CartesianPoint< T, 2 >::operator+ ( const CartesianPoint< T, 2 > &  v) const
inline

Definition at line 471 of file cartesian_point.hpp.

◆ operator+=()

template<typename T >
void ecl::CartesianPoint< T, 2 >::operator+= ( const CartesianPoint< T, 2 > &  other)
inline

Definition at line 439 of file cartesian_point.hpp.

◆ operator-()

template<typename T >
CartesianPoint<T,2> ecl::CartesianPoint< T, 2 >::operator- ( const CartesianPoint< T, 2 > &  v) const
inline

Definition at line 476 of file cartesian_point.hpp.

◆ operator<<()

template<typename T >
ecl::linear_algebra::CommaInitializer< ecl::linear_algebra::Matrix<T,2,1> > ecl::CartesianPoint< T, 2 >::operator<< ( const T &  value)
inline

Provides a comma initialisation facility. This initiates the comma initialiser with an iterator to the underlying elements and then leaves the initialiser to do the rest. The initialiser will do range checking if NDEBUG is not defined.

CartesianPoint<double,2> point; // At this point it is initialised with default values.
point << 1.0,2.0,2.0; // If NDEBUG is not defined, this will throw if you exceed the range.
Parameters
value: the first of three points to enter.
Returns
BoundedListInitialiser : the comma initialiser mechanism.

Definition at line 340 of file cartesian_point.hpp.

◆ operator=()

template<typename T >
const CartesianPoint<T,2>& ecl::CartesianPoint< T, 2 >::operator= ( const CartesianPoint< T, 2 > &  v)
inline

Definition at line 354 of file cartesian_point.hpp.

◆ operator==()

template<typename T >
bool ecl::CartesianPoint< T, 2 >::operator== ( const CartesianPoint< T, 2 > &  other) const
inline

Definition at line 411 of file cartesian_point.hpp.

◆ operator[]() [1/2]

template<typename T >
T& ecl::CartesianPoint< T, 2 >::operator[] ( const unsigned int &  index)
inline

Definition at line 344 of file cartesian_point.hpp.

◆ operator[]() [2/2]

template<typename T >
const T ecl::CartesianPoint< T, 2 >::operator[] ( const unsigned int &  index) const
inline

Definition at line 349 of file cartesian_point.hpp.

◆ positionVector() [1/2]

template<typename T >
ecl::linear_algebra::Matrix<T,2,1>& ecl::CartesianPoint< T, 2 >::positionVector ( )
inline

Representation of the position vector in eigen vector format.

Converts representation to an eigen vector reference - oft necessary in mathematics calculations.

Returns
Matrix<T,2,1> : a reference to the underlying storage container.

Definition at line 366 of file cartesian_point.hpp.

◆ positionVector() [2/2]

template<typename T >
const ecl::linear_algebra::Matrix<T,2,1>& ecl::CartesianPoint< T, 2 >::positionVector ( ) const
inline

Representation of the position vector in const eigen vector format.

Converts representation to a const eigen vector reference - oft necessary in mathematics calculations.

Returns
Matrix<T,2,1> : a reference to the underlying storage container.

Definition at line 375 of file cartesian_point.hpp.

◆ rotate()

template<typename T >
void ecl::CartesianPoint< T, 2 >::rotate ( const double &  angle)
inline

Definition at line 423 of file cartesian_point.hpp.

◆ size()

template<typename T >
unsigned int ecl::CartesianPoint< T, 2 >::size ( )
inline

Size/dimension of the cartesian point.

Size/dimension of the cartesian point.

Returns
unsigned int : size/dimension.

Definition at line 384 of file cartesian_point.hpp.

◆ x() [1/3]

template<typename T >
const T& ecl::CartesianPoint< T, 2 >::x ( ) const
inline

Returns a constant reference to the x co-ordinate.

Returns
const T& : x value.

Definition at line 391 of file cartesian_point.hpp.

◆ x() [2/3]

template<typename T >
T ecl::CartesianPoint< T, 2 >::x ( )
inline

Returns a copy of the x co-ordinate.

Returns
T : x value.

Definition at line 403 of file cartesian_point.hpp.

◆ x() [3/3]

template<typename T >
void ecl::CartesianPoint< T, 2 >::x ( const T &  value)
inline

Sets the x-cor.dinate.

Definition at line 487 of file cartesian_point.hpp.

◆ y() [1/3]

template<typename T >
const T& ecl::CartesianPoint< T, 2 >::y ( ) const
inline

Returns a constant reference to the y co-ordinate.

Returns
const T& : y value.

Definition at line 397 of file cartesian_point.hpp.

◆ y() [2/3]

template<typename T >
T ecl::CartesianPoint< T, 2 >::y ( )
inline

Returns a copy of the y co-ordinate.

Returns
T : y value.

Definition at line 409 of file cartesian_point.hpp.

◆ y() [3/3]

template<typename T >
void ecl::CartesianPoint< T, 2 >::y ( const T &  value)
inline

Sets the y-cordinate.

Definition at line 488 of file cartesian_point.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename T >
template<typename OutputStream , typename Type >
OutputStream& operator<< ( OutputStream &  ostream,
const CartesianPoint< Type, 2 > &  point 
)
friend

Insertion operator for sending the array to an output stream. This is raw, and has no formatting.

Parameters
ostream: the output stream.
point: the point to be inserted.
Returns
OutputStream : continue streaming with the updated output stream.

Definition at line 514 of file cartesian_point.hpp.

Member Data Documentation

◆ elements

template<typename T >
ecl::linear_algebra::Matrix<T,2,1> ecl::CartesianPoint< T, 2 >::elements
private

Definition at line 496 of file cartesian_point.hpp.


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


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:49