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 Attributes | Friends | List of all members
slip::Point2d< T > Class Template Reference

This is a point2d class, a specialized version of Point<CoordType,DIM> with DIM = 2. More...

#include <Array2d.hpp>

Inheritance diagram for slip::Point2d< T >:
Inheritance graph

Public Types

typedef Point2d< CoordType > self
 
typedef Point< CoordType, 2 > base
 
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
std::random_access_iterator_tag 
iterator_category
 

Public Member Functions

std::string name () const
 Returns the name of the class. More...
 
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
 Point2d ()
 Constructs a Point2d. More...
 
 Point2d (const CoordType *array)
 Constructs a Point from a CoordType array. More...
 
 Point2d (const CoordType &x1, const CoordType &x2)
 Constructs a Point2d. More...
 
Element access operators
void x1 (const CoordType &x)
 Accessor of the first coordinate of Point2d. More...
 
CoordType & x1 ()
 Accessor/Mutator of the first coordinate of Point2d. More...
 
const CoordType & x1 () const
 Accessor/Mutator of the first coordinate of Point2d. More...
 
void x2 (const CoordType &x)
 Accessor of the second coordinate of Point2d. More...
 
CoordType & x2 ()
 Accessor/Mutator of the second coordinate of Point2d. More...
 
const CoordType & x2 () const
 Accessor/Mutator of the first coordinate of Point2d. 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
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...
 
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...
 

Static Public Attributes

static const std::size_t SIZE
 

Protected Attributes

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

Friends

class boost::serialization::access
 

Detailed Description

template<class T>
class slip::Point2d< T >

This is a point2d class, a specialized version of Point<CoordType,DIM> with DIM = 2.

O------ x2
|
|
|
|
Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.2
Date
2014/03/14
Since
1.0.0
Parameters
CoordTypeType of the coordinates of the Point2d

Definition at line 132 of file Array2d.hpp.

Member Typedef Documentation

template<class T>
typedef Point<CoordType,2> slip::Point2d< T >::base

Definition at line 112 of file Point2d.hpp.

typedef const value_type* slip::Point< CoordType, DIM >::const_pointer
inherited

Definition at line 114 of file Point.hpp.

typedef const value_type& slip::Point< CoordType, DIM >::const_reference
inherited

Definition at line 116 of file Point.hpp.

typedef DPoint<CoordType,DIM> slip::Point< CoordType, DIM >::dpoint_type
inherited

Definition at line 119 of file Point.hpp.

typedef std::random_access_iterator_tag slip::Point< CoordType, DIM >::iterator_category
inherited

Definition at line 123 of file Point.hpp.

typedef value_type* slip::Point< CoordType, DIM >::pointer
inherited

Definition at line 113 of file Point.hpp.

typedef value_type& slip::Point< CoordType, DIM >::reference
inherited

Definition at line 115 of file Point.hpp.

template<class T>
typedef Point2d<CoordType> slip::Point2d< T >::self

Definition at line 111 of file Point2d.hpp.

typedef CoordType slip::Point< CoordType, DIM >::value_type
inherited

Definition at line 112 of file Point.hpp.

Constructor & Destructor Documentation

template<typename CoordType >
slip::Point2d< CoordType >::Point2d ( )
inline

Constructs a Point2d.

Definition at line 227 of file Point2d.hpp.

template<typename CoordType >
slip::Point2d< CoordType >::Point2d ( const CoordType *  array)
inline

Constructs a Point from a CoordType array.

Parameters
array

Definition at line 235 of file Point2d.hpp.

template<typename CoordType >
slip::Point2d< CoordType >::Point2d ( const CoordType &  x1,
const CoordType &  x2 
)
inline

Constructs a Point2d.

Parameters
x1first coordinate of the Point2d
x2second coordinate of the Point2d

Definition at line 241 of file Point2d.hpp.

Member Function Documentation

const block<value_type,DIM>& slip::Point< CoordType, DIM >::coord ( ) const
inherited

Return the coordinates of the Point.

block<value_type,DIM>& slip::Point< CoordType, DIM >::coord ( )
inherited

Return the coordinates of the Point.

std::size_t slip::Point< CoordType, DIM >::dim ( ) const
inherited

Returns the dimension of the Point.

Returns
the dimension (number of coordinates) of the Point
bool slip::Point< CoordType, DIM >::empty ( ) const
inherited

Returns true if dimension of the Point is 0.

Returns
true if the dimension of the Point is 0, false else
std::size_t slip::Point< CoordType, DIM >::max_size ( ) const
inherited

Returns the maximal size of the Point.

Returns
the dimension (number of coordinates) of the Point
template<typename CoordType >
std::string slip::Point2d< CoordType >::name ( ) const
inline

Returns the name of the class.

Definition at line 276 of file Point2d.hpp.

bool slip::Point< CoordType, DIM >::operator!= ( const self other) const
inherited

compare two Point.

Parameters
otherPoint to compare
Returns
true if the two point don't have the same coordinates
self slip::Point< CoordType, DIM >::operator+ ( const dpoint_type dp) const
inherited

translate a point considering the deplacement a dp

Parameters
dpdeplacement
Returns
self& slip::Point< CoordType, DIM >::operator+= ( const dpoint_type dp)
inherited

Assign a Point to this point plus a deplacement.

Parameters
dpdeplacement
Returns
self slip::Point< CoordType, DIM >::operator- ( ) const
inherited

negate all the coordinates of a Point

Precondition
CoordType must be a "signed" type
Returns
a Point with negate coordinates
self slip::Point< CoordType, DIM >::operator- ( const dpoint_type dp) const
inherited

translate a point considering the deplacement a dp

Parameters
dpdeplacement
Returns
dpoint_type slip::Point< CoordType, DIM >::operator- ( const self other) const
inherited

compute the difference between two points

Parameters
otherPoint
Returns
the deplacement between the two points
self& slip::Point< CoordType, DIM >::operator-= ( const dpoint_type dp)
inherited

Assign a Point to this point minus a deplacement.

Parameters
dpdeplacement
Returns
bool slip::Point< CoordType, DIM >::operator== ( const self other) const
inherited

compare two Point.

Parameters
otherPoint to compare
Returns
true if the two point have the same coordinates
reference slip::Point< CoordType, DIM >::operator[] ( const std::size_t  i)
inherited

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
const_reference slip::Point< CoordType, DIM >::operator[] ( const std::size_t  i) const
inherited

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
std::size_t slip::Point< CoordType, DIM >::size ( ) const
inherited

Returns the dimension of the Point.

Returns
the dimension (number of coordinates) of the Point
void slip::Point< CoordType, DIM >::swap ( self other)
inherited

Swaps two Point.

Parameters
otherPoint to swap with
template<typename CoordType >
void slip::Point2d< CoordType >::x1 ( const CoordType &  x)
inline

Accessor of the first coordinate of Point2d.

Parameters
xthe first coordinate of the Point2d

Definition at line 250 of file Point2d.hpp.

template<typename CoordType >
CoordType & slip::Point2d< CoordType >::x1 ( )
inline

Accessor/Mutator of the first coordinate of Point2d.

Returns
reference to the first coordinate of the Point2d

Definition at line 254 of file Point2d.hpp.

template<typename CoordType >
const CoordType & slip::Point2d< CoordType >::x1 ( ) const
inline

Accessor/Mutator of the first coordinate of Point2d.

Returns
reference to the first coordinate of the Point2d

Definition at line 258 of file Point2d.hpp.

template<typename CoordType >
void slip::Point2d< CoordType >::x2 ( const CoordType &  x)
inline

Accessor of the second coordinate of Point2d.

Parameters
xthe second coordinate of the Point2d

Definition at line 262 of file Point2d.hpp.

template<typename CoordType >
CoordType & slip::Point2d< CoordType >::x2 ( )
inline

Accessor/Mutator of the second coordinate of Point2d.

Returns
reference to the second coordinate of the Point2d

Definition at line 267 of file Point2d.hpp.

template<typename CoordType >
const CoordType & slip::Point2d< CoordType >::x2 ( ) const
inline

Accessor/Mutator of the first coordinate of Point2d.

Returns
reference to the first coordinate of the Point2d

Definition at line 271 of file Point2d.hpp.

Friends And Related Function Documentation

template<class T>
friend class boost::serialization::access
friend

Definition at line 188 of file Point2d.hpp.

Member Data Documentation

block<value_type,DIM> slip::Point< CoordType, DIM >::coord_
protectedinherited

The coordinates of the point are stored in this block.

Definition at line 347 of file Point.hpp.

const std::size_t slip::Point< CoordType, DIM >::SIZE
staticinherited

Definition at line 125 of file Point.hpp.


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