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

Define an abstract Box structure. More...

#include <Box.hpp>

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

Public Types

typedef CoordType value_type
 
typedef value_typeboxer
 
typedef const value_typeconst_boxer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef Point< CoordType, DIM > point_type
 
typedef DPoint< CoordType, DIM > dpoint_type
 
typedef Box< CoordType, DIM > self
 

Public Member Functions

std::string name () const
 Returns the name of the class. More...
 
bool contains (const point_type &p) const
 Returns true if the box contains the point p. More...
 
void translate (const dpoint_type &dp)
 Translate the window along the deplacement dp the dimensions of the window are conserved. More...
 
bool is_consistent () const
 verify if the window is consistent, that is to say if the first point p1 has the smaller coordinates than p2 More...
 
void swap (self &other)
 Swaps two Box. More...
 
Constructors & Destructors
 Box ()
 Default constructor (protected to avoid default construction) More...
 
 Box (const self &other)
 Constructs a copy of the Box rhs. More...
 
 Box (const point_type &p1, const point_type &p2)
 Constructs a Box from a CoordType array. More...
 
Assignment operators and methods
selfoperator= (const self &other)
 Assign a Box. More...
 
Comparison operators
bool operator== (const self &other) const
 compare two Box. More...
 
bool operator!= (const self &other) const
 compare two Box. More...
 

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

point_type p1_
 
point_type p2_
 

Friends

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

Detailed Description

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

Define an abstract Box structure.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.1
Date
2006/07/26
Since
1.0.0
Parameters
CoordTypeType of the coordinates of the Box
DIMdimension of the Box

Definition at line 98 of file Box.hpp.

Member Typedef Documentation

template<typename CoordType, std::size_t DIM>
typedef value_type* slip::Box< CoordType, DIM >::boxer

Definition at line 124 of file Box.hpp.

template<typename CoordType, std::size_t DIM>
typedef const value_type* slip::Box< CoordType, DIM >::const_boxer

Definition at line 125 of file Box.hpp.

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

Definition at line 127 of file Box.hpp.

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

Definition at line 129 of file Box.hpp.

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

Definition at line 128 of file Box.hpp.

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

Definition at line 126 of file Box.hpp.

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

Definition at line 130 of file Box.hpp.

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

Definition at line 123 of file Box.hpp.

Constructor & Destructor Documentation

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

Default constructor (protected to avoid default construction)

Definition at line 288 of file Box.hpp.

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

Constructs a copy of the Box rhs.

Parameters
other

Definition at line 293 of file Box.hpp.

template<typename CoordType , std::size_t DIM>
slip::Box< CoordType, DIM >::Box ( const point_type p1,
const point_type p2 
)
inline

Constructs a Box from a CoordType array.

Parameters
p1first extremal point
p2second extremal point

Definition at line 299 of file Box.hpp.

Member Function Documentation

template<typename CoordType , std::size_t DIM>
bool slip::Box< CoordType, DIM >::contains ( const point_type p) const
inline

Returns true if the box contains the point p.

Parameters
ppoint to analyse
Returns

Definition at line 324 of file Box.hpp.

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

verify if the window is consistent, that is to say if the first point p1 has the smaller coordinates than p2

Returns
true if the "p1 < p2"

Definition at line 342 of file Box.hpp.

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

Definition at line 272 of file Box.hpp.

template<typename CoordType , std::size_t DIM>
std::string slip::Box< CoordType, DIM >::name ( ) const
inline

Returns the name of the class.

Definition at line 319 of file Box.hpp.

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

compare two Box.

Parameters
otherBox to compare
Returns
true if the two box don't have the same coordinates

Definition at line 377 of file Box.hpp.

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

Assign a Box.

Assign elements of Box in other

Parameters
otherBox to get the values from.
Returns

Definition at line 306 of file Box.hpp.

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

compare two Box.

Parameters
otherBox to compare
Returns
true if the two box have the same coordinates

Definition at line 370 of file Box.hpp.

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

Definition at line 266 of file Box.hpp.

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

Swaps two Box.

Parameters
otherBox to swap with

Definition at line 354 of file Box.hpp.

template<typename CoordType , std::size_t DIM>
void slip::Box< CoordType, DIM >::translate ( const dpoint_type dp)
inline

Translate the window along the deplacement dp the dimensions of the window are conserved.

Parameters
dpdeplacement of the window
Returns

Definition at line 334 of file Box.hpp.

Friends And Related Function Documentation

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

Definition at line 264 of file Box.hpp.

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

Write the Box to the ouput stream.

Parameters
outoutput stream
bBox to write to the output stream

Definition at line 362 of file Box.hpp.

Member Data Documentation

template<typename CoordType, std::size_t DIM>
point_type slip::Box< CoordType, DIM >::p1_
protected

First extremal coordinate of the box

Definition at line 257 of file Box.hpp.

template<typename CoordType, std::size_t DIM>
point_type slip::Box< CoordType, DIM >::p2_
protected

Second extremal coordinate of the box

Definition at line 261 of file Box.hpp.


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