SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
slip::Point< CoordType, DIM > Class Template Reference

Define an abstract Point structure. More...

#include <Box.hpp>

Inheritance diagram for slip::Point< CoordType, DIM >:
Inheritance graph

Public Types

typedef CoordType value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef DPoint< CoordType, DIM > dpoint_type
 
typedef Point< CoordType, DIM > self
 
typedef
std::random_access_iterator_tag 
iterator_category
 

Public Member Functions

self operator- () const
 negate all the coordinates of a Point More...
 
std::size_t dim () const
 Returns the dimension of the Point. More...
 
std::size_t size () const
 Returns the dimension of the Point. More...
 
std::size_t max_size () const
 Returns the maximal size of the Point. More...
 
bool empty () const
 Returns true if dimension of the Point is 0. More...
 
const block< value_type, DIM > & coord () const
 Return the coordinates of the Point. More...
 
block< value_type, DIM > & coord ()
 Return the coordinates of the Point. More...
 
void swap (self &other)
 Swaps two Point. More...
 
Constructors & Destructors
 Point ()
 Default constructor. More...
 
 Point (const self &other)
 Constructs a copy of the Point rhs. More...
 
 Point (const CoordType *array)
 Constructs a Point from a CoordType array. More...
 
Assignment operators and methods
selfoperator= (const self &other)
 Assign a Point. More...
 
Element access operators
reference operator[] (const std::size_t i)
 Returns the i'th coordinate of the Point. More...
 
const_reference operator[] (const std::size_t i) const
 Returns the i'th row of the Point. More...
 
Comparison operators
bool operator== (const self &other) const
 compare two Point. More...
 
bool operator!= (const self &other) const
 compare two Point. More...
 
Arithmetic operators
selfoperator+= (const dpoint_type &dp)
 Assign a Point to this point plus a deplacement. More...
 
self operator+ (const dpoint_type &dp) const
 translate a point considering the deplacement a dp More...
 
selfoperator-= (const dpoint_type &dp)
 Assign a Point to this point minus a deplacement. More...
 
self operator- (const dpoint_type &dp) const
 translate a point considering the deplacement a dp More...
 
dpoint_type operator- (const self &other) const
 compute the difference between two points More...
 

Static Public Attributes

static const std::size_t SIZE = DIM
 

Protected Member Functions

template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 

Protected Attributes

block< value_type, DIM > coord_
 The coordinates of the point are stored in this block. More...
 

Friends

class boost::serialization::access
 
i/o operators
std::ostream & operator<< (std::ostream &out, const self &p)
 Write the Point to the ouput stream. More...
 

Detailed Description

template<typename CoordType, std::size_t DIM>
class slip::Point< CoordType, DIM >

Define an abstract Point structure.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.2
Date
2014/03/15
Since
1.0.0
Parameters
CoordTypeType of the coordinates of the Point
DIMdimension of the Point
Todo:
verify RandomAccessContainer Concepts (friend operator==...)

Definition at line 92 of file Box.hpp.

Member Typedef Documentation

template<typename CoordType, std::size_t DIM>
typedef const value_type* slip::Point< CoordType, DIM >::const_pointer

Definition at line 114 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef const value_type& slip::Point< CoordType, DIM >::const_reference

Definition at line 116 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef DPoint<CoordType,DIM> slip::Point< CoordType, DIM >::dpoint_type

Definition at line 119 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef std::random_access_iterator_tag slip::Point< CoordType, DIM >::iterator_category

Definition at line 123 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef value_type* slip::Point< CoordType, DIM >::pointer

Definition at line 113 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef value_type& slip::Point< CoordType, DIM >::reference

Definition at line 115 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef Point<CoordType,DIM> slip::Point< CoordType, DIM >::self

Definition at line 120 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
typedef CoordType slip::Point< CoordType, DIM >::value_type

Definition at line 112 of file Point.hpp.

Constructor & Destructor Documentation

template<typename CoordType , std::size_t DIM>
slip::Point< CoordType, DIM >::Point ( )
inline

Default constructor.

Definition at line 371 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
slip::Point< CoordType, DIM >::Point ( const self other)
inline

Constructs a copy of the Point rhs.

Parameters
other

Definition at line 378 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
slip::Point< CoordType, DIM >::Point ( const CoordType *  array)
inline

Constructs a Point from a CoordType array.

Parameters
array

Definition at line 384 of file Point.hpp.

Member Function Documentation

template<typename CoordType , std::size_t DIM>
const block< CoordType, DIM > & slip::Point< CoordType, DIM >::coord ( ) const
inline

Return the coordinates of the Point.

Definition at line 446 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
block< CoordType, DIM > & slip::Point< CoordType, DIM >::coord ( )
inline

Return the coordinates of the Point.

Definition at line 453 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
std::size_t slip::Point< CoordType, DIM >::dim ( ) const
inline

Returns the dimension of the Point.

Returns
the dimension (number of coordinates) of the Point

Definition at line 429 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
bool slip::Point< CoordType, DIM >::empty ( ) const
inline

Returns true if dimension of the Point is 0.

Returns
true if the dimension of the Point is 0, false else

Definition at line 441 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
template<class Archive >
void slip::Point< CoordType, DIM >::load ( Archive &  ar,
const unsigned int  version 
)
inlineprotected

Definition at line 357 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
std::size_t slip::Point< CoordType, DIM >::max_size ( ) const
inline

Returns the maximal size of the Point.

Returns
the dimension (number of coordinates) of the Point

Definition at line 437 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
bool slip::Point< CoordType, DIM >::operator!= ( const self other) const
inline

compare two Point.

Parameters
otherPoint to compare
Returns
true if the two point don't have the same coordinates

Definition at line 475 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
Point< CoordType, DIM > slip::Point< CoordType, DIM >::operator+ ( const dpoint_type dp) const
inline

translate a point considering the deplacement a dp

Parameters
dpdeplacement
Returns

Definition at line 505 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
Point< CoordType, DIM > & slip::Point< CoordType, DIM >::operator+= ( const dpoint_type dp)
inline

Assign a Point to this point plus a deplacement.

Parameters
dpdeplacement
Returns

Definition at line 492 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
Point< CoordType, DIM > slip::Point< CoordType, DIM >::operator- ( ) const
inline

negate all the coordinates of a Point

Precondition
CoordType must be a "signed" type
Returns
a Point with negate coordinates

Definition at line 483 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
Point< CoordType, DIM > slip::Point< CoordType, DIM >::operator- ( const dpoint_type dp) const
inline

translate a point considering the deplacement a dp

Parameters
dpdeplacement
Returns

Definition at line 526 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
DPoint< CoordType, DIM > slip::Point< CoordType, DIM >::operator- ( const self other) const
inline

compute the difference between two points

Parameters
otherPoint
Returns
the deplacement between the two points

Definition at line 535 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
Point< CoordType, DIM > & slip::Point< CoordType, DIM >::operator-= ( const dpoint_type dp)
inline

Assign a Point to this point minus a deplacement.

Parameters
dpdeplacement
Returns

Definition at line 514 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
Point< CoordType, DIM > & slip::Point< CoordType, DIM >::operator= ( const self other)
inline

Assign a Point.

Assign elements of Point in other

Parameters
otherPoint to get the values from.
Returns

Definition at line 401 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
bool slip::Point< CoordType, DIM >::operator== ( const self other) const
inline

compare two Point.

Parameters
otherPoint to compare
Returns
true if the two point have the same coordinates

Definition at line 468 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
CoordType & slip::Point< CoordType, DIM >::operator[] ( const std::size_t  i)
inline

Returns the i'th coordinate of the Point.

Parameters
iindex of the coordinate to return
Returns
value of the i'th row of the Point.
Precondition
0 <= i < dim

Definition at line 413 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
const CoordType & slip::Point< CoordType, DIM >::operator[] ( const std::size_t  i) const
inline

Returns the i'th row of the Point.

Parameters
iindex of the coordinate to return
Returns
value of the i'th row of the Point
Precondition
0 <= i < dim

Definition at line 421 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
template<class Archive >
void slip::Point< CoordType, DIM >::save ( Archive &  ar,
const unsigned int  version 
) const
inlineprotected

Definition at line 352 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
std::size_t slip::Point< CoordType, DIM >::size ( ) const
inline

Returns the dimension of the Point.

Returns
the dimension (number of coordinates) of the Point

Definition at line 433 of file Point.hpp.

template<typename CoordType , std::size_t DIM>
void slip::Point< CoordType, DIM >::swap ( self other)
inline

Swaps two Point.

Parameters
otherPoint to swap with

Definition at line 460 of file Point.hpp.

Friends And Related Function Documentation

template<typename CoordType, std::size_t DIM>
friend class boost::serialization::access
friend

Definition at line 350 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
std::ostream& operator<< ( std::ostream &  out,
const self p 
)
friend

Write the Point to the ouput stream.

Parameters
outoutput stream
pPoint to write to the output stream

Definition at line 391 of file Point.hpp.

Member Data Documentation

template<typename CoordType, std::size_t DIM>
block<value_type,DIM> slip::Point< CoordType, DIM >::coord_
protected

The coordinates of the point are stored in this block.

Definition at line 347 of file Point.hpp.

template<typename CoordType, std::size_t DIM>
const std::size_t slip::Point< CoordType, DIM >::SIZE = DIM
static

Definition at line 125 of file Point.hpp.


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