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

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

#include <cartesian_point.hpp>

List of all members.

Public Member Functions

 CartesianPoint (const T &value=T())
 Default constructor - sets all elements to the same value.
 CartesianPoint (const ecl::linear_algebra::Matrix< T, 2, 1 > &vec)
 Initialises with the specified input vector.
 CartesianPoint (const CartesianPoint< T, 2 > &point)
 Default copy constructor.
 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) ecl_assert_throw_decl(StandardException)
const T operator[] (const unsigned int &index) const ecl_assert_throw_decl(StandardException)
ecl::linear_algebra::Matrix< T, 2, 1 > & positionVector ()
 Representation of the position vector in eigen vector format.
const
ecl::linear_algebra::Matrix< T, 2, 1 > & 
positionVector () const
 Representation of the position vector in const eigen vector format.
void rotate (const double &angle)
unsigned int size ()
 Size/dimension of the cartesian point.
const T & x () const
 Returns a constant reference to the x co-ordinate.
x ()
 Returns a copy of the x co-ordinate.
void x (const T &value)
 Sets the x-cor.dinate.
const T & y () const
 Returns a constant reference to the y co-ordinate.
y ()
 Returns a copy of the y co-ordinate.
void y (const T &value)
 Sets the y-cordinate.
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

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.

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.

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.

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.

template<typename T >
virtual ecl::CartesianPoint< T, 2 >::~CartesianPoint ( ) [inline, virtual]

Definition at line 322 of file cartesian_point.hpp.


Member Function Documentation

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

Definition at line 444 of file cartesian_point.hpp.

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

Definition at line 434 of file cartesian_point.hpp.

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

Definition at line 481 of file cartesian_point.hpp.

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

Definition at line 450 of file cartesian_point.hpp.

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.

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

Definition at line 466 of file cartesian_point.hpp.

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.

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

Definition at line 439 of file cartesian_point.hpp.

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.

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.

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.

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.

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

Definition at line 344 of file cartesian_point.hpp.

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.

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.

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.

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

Definition at line 423 of file cartesian_point.hpp.

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.

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.

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.

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.

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.

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.

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

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

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 Wed Aug 26 2015 11:27:46