oln::abstract::point< Exact > Struct Template Reference

#include <point.hh>

Inheritance diagram for oln::abstract::point< Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::abstract::point< Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef point< Exact > self_type
typedef Exact exact_type
typedef point_traits< Exact
>::dpoint_type 
dpoint_type
enum  { dim = point_traits<Exact>::dim }

Public Member Functions

const exact_type & point_ref () const
 Return the current point casted in exact_type.

coord nth (const unsigned dim) const
 Give the value of the nth coordinate of the point.

coordnth (const unsigned dim)
 Return a reference to the nth coordinate of the point.

exact_type & operator+= (const abstract::dpoint< dpoint_type > &dp)
 Add a delta point dp to the current point.

exact_type & operator-= (const abstract::dpoint< dpoint_type > &dp)
 Subtract a delta point dp from the current point.

dpoint_type operator- (const self_type &p) const
 Subtract a point p from the current point.

exact_type operator+ (const abstract::dpoint< dpoint_type > &dp) const
 Give the result of the addition of a delta point dp and the current point.

exact_type operator- (const abstract::dpoint< dpoint_type > &dp) const
 Give the result of the subtraction of a delta point dp and the current point.

exact_type operator- () const
 Return a point whose coordinates are the opposite of the current point coordinates.

bool operator== (const self_type &p) const
 Test if p and the current point have the same coordinates.

bool operator!= (const self_type &p) const
 Test if p and the current point do not have the same coordinates.


Static Public Member Functions

std::string name ()

Detailed Description

template<class Exact>
struct oln::abstract::point< Exact >

The abstract class from whom derives all the others point classes.

Definition at line 71 of file point.hh.


Member Function Documentation

template<class Exact>
bool oln::abstract::point< Exact >::operator!= const self_type &  p  )  const [inline]
 

Test if p and the current point do not have the same coordinates.

Returns:
False if p and the current point have the same coordinates, true otherwise.

Definition at line 201 of file point.hh.

00202       {
00203         for (unsigned i = 0; i < dim; ++i)
00204           if (p.nth(i) != nth(i))
00205             return true;
00206         return false;
00207       }

template<class Exact>
exact_type oln::abstract::point< Exact >::operator+ const abstract::dpoint< dpoint_type > &  dp  )  const [inline]
 

Give the result of the addition of a delta point dp and the current point.

Returns:
The result of the addition of dp and the current point.

Definition at line 148 of file point.hh.

00149       {
00150         return this->exact().plus_dp(dp.exact());
00151       }

template<class Exact>
exact_type& oln::abstract::point< Exact >::operator+= const abstract::dpoint< dpoint_type > &  dp  )  [inline]
 

Add a delta point dp to the current point.

Returns:
The current point plus dp.

Definition at line 112 of file point.hh.

00113       {
00114         return this->exact().plus_assign_dp(dp.exact());
00115       }

template<class Exact>
exact_type oln::abstract::point< Exact >::operator- const abstract::dpoint< dpoint_type > &  dp  )  const [inline]
 

Give the result of the subtraction of a delta point dp and the current point.

Returns:
The result of the subtraction of dp and the current point.

Definition at line 161 of file point.hh.

00162       {
00163         return this->exact().minus_dp(dp.exact());
00164       }

template<class Exact>
dpoint_type oln::abstract::point< Exact >::operator- const self_type &  p  )  const [inline]
 

Subtract a point p from the current point.

Returns:
A reference to this current point minus p.

Definition at line 135 of file point.hh.

00136       {
00137         return this->exact().minus_p(p.exact());
00138       }

template<class Exact>
exact_type& oln::abstract::point< Exact >::operator-= const abstract::dpoint< dpoint_type > &  dp  )  [inline]
 

Subtract a delta point dp from the current point.

Returns:
The current point minus dp.

Definition at line 124 of file point.hh.

00125       {
00126         return this->exact().minus_assign_dp(dp.exact());
00127       }

template<class Exact>
bool oln::abstract::point< Exact >::operator== const self_type &  p  )  const [inline]
 

Test if p and the current point have the same coordinates.

Returns:
True if p and the current point have the same coordinates, false otherwise.

Definition at line 184 of file point.hh.

00185       {
00186         for (unsigned i = 0; i < dim; ++i)
00187           if (p.nth(i) != nth(i))
00188             return false;
00189         return true;
00190       }


The documentation for this struct was generated from the following file:
Generated on Thu Apr 15 20:15:12 2004 for Olena by doxygen 1.3.6-20040222