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

This is a Box1d class, a specialized version of slip::Box<CoordType,DIM> with DIM = 1. More...

#include <Box1d.hpp>

Inheritance diagram for slip::Box1d< CoordType >:
Inheritance graph

Public Types

typedef Box1d< CoordType > self
 
typedef Box< CoordType, 1 > base
 
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
 

Public Member Functions

std::string name () const
 Returns the name of the class. More...
 
CoordType length () const
 compute the length of the Box1d. More...
 
CoordType width () const
 compute the width of the Box1d. 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
 Box1d ()
 Constructs a Box3d. More...
 
 Box1d (const Point< CoordType, 1 > &p1, const Point< CoordType, 1 > &p2)
 Constructs a Box1d from a CoordType array. More...
 
 Box1d (const CoordType &x1, const CoordType &x2)
 Constructs a Box1d. More...
 
 Box1d (const Point< CoordType, 1 > &pc, const CoordType &w)
 Constructs a plane Box1d using a central point and a width. More...
 
Element access operators
void upper_left (const Point< CoordType, 1 > &p1)
 Accessor/Mutator of the upper_left point (p1) of Box1d. More...
 
Point< CoordType, 1 > & upper_left ()
 Accessor/Mutator of the upper_left point (p1) of Box1d. More...
 
const Point< CoordType, 1 > & upper_left () const
 Accessor/Mutator of the upper_left point (p1) of Box1d. More...
 
void bottom_right (const Point< CoordType, 1 > &p2)
 Accessor/Mutator of the bottom_right point (p2) of Box1d. More...
 
Point< CoordType, 1 > & bottom_right ()
 Accessor/Mutator of the bottom_right point (p2) of Box1d. More...
 
const Point< CoordType, 1 > & bottom_right () const
 Accessor/Mutator of the bottom_right point (p2) of Box1d. More...
 
void set_coord (const CoordType &x1, const CoordType &x2)
 Mutator of the coordinates of the Box1d. More...
 
Comparison operators
bool operator== (const self &other) const
 compare two Box. More...
 
bool operator!= (const self &other) const
 compare two Box. More...
 

Protected Attributes

point_type p1_
 
point_type p2_
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename CoordType>
class slip::Box1d< CoordType >

This is a Box1d class, a specialized version of slip::Box<CoordType,DIM> with DIM = 1.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.2
Date
2014/03/15
Since
1.0.0
Description:
The box is defined by its two extremal 1d points p1 and p2.
p1--------p2
Parameters
CoordTypeType of the coordinates of the Box1d.

Definition at line 110 of file Box1d.hpp.

Member Typedef Documentation

template<typename CoordType>
typedef Box<CoordType,1> slip::Box1d< CoordType >::base

Definition at line 114 of file Box1d.hpp.

typedef value_type* slip::Box< CoordType, DIM >::boxer
inherited

Definition at line 124 of file Box.hpp.

typedef const value_type* slip::Box< CoordType, DIM >::const_boxer
inherited

Definition at line 125 of file Box.hpp.

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

Definition at line 127 of file Box.hpp.

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

Definition at line 129 of file Box.hpp.

typedef Point<CoordType,DIM> slip::Box< CoordType, DIM >::point_type
inherited

Definition at line 128 of file Box.hpp.

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

Definition at line 126 of file Box.hpp.

template<typename CoordType>
typedef Box1d<CoordType> slip::Box1d< CoordType >::self

Definition at line 113 of file Box1d.hpp.

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

Definition at line 123 of file Box.hpp.

Constructor & Destructor Documentation

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

Constructs a Box3d.

Remarks
call the default constructors of Point<CoordType,1>

Definition at line 240 of file Box1d.hpp.

template<typename CoordType >
slip::Box1d< CoordType >::Box1d ( const Point< CoordType, 1 > &  p1,
const Point< CoordType, 1 > &  p2 
)
inline

Constructs a Box1d from a CoordType array.

Parameters
p1first extremal point
p2second extremal point

Definition at line 246 of file Box1d.hpp.

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

Constructs a Box1d.

Parameters
x1coordinate of the minimal point p1
x2coordinate of the maximal point p2

Definition at line 253 of file Box1d.hpp.

template<typename CoordType >
slip::Box1d< CoordType >::Box1d ( const Point< CoordType, 1 > &  pc,
const CoordType &  w 
)
inline

Constructs a plane Box1d using a central point and a width.

Parameters
pccentral point
wwidth of the box (real width and size=2*w+1)

Definition at line 260 of file Box1d.hpp.

Member Function Documentation

template<typename CoordType >
void slip::Box1d< CoordType >::bottom_right ( const Point< CoordType, 1 > &  p2)
inline

Accessor/Mutator of the bottom_right point (p2) of Box1d.

Returns
reference to the bottom_right Point2d of the Box1d

Definition at line 283 of file Box1d.hpp.

template<typename CoordType >
Point< CoordType, 1 > & slip::Box1d< CoordType >::bottom_right ( )
inline

Accessor/Mutator of the bottom_right point (p2) of Box1d.

Returns
reference to the bottom_right Point2d of the Box1d

Definition at line 287 of file Box1d.hpp.

template<typename CoordType >
const Point< CoordType, 1 > & slip::Box1d< CoordType >::bottom_right ( ) const
inline

Accessor/Mutator of the bottom_right point (p2) of Box1d.

Returns
reference to the bottom_right Point2d of the Box1d

Definition at line 291 of file Box1d.hpp.

bool slip::Box< CoordType, DIM >::contains ( const point_type p) const
inherited

Returns true if the box contains the point p.

Parameters
ppoint to analyse
Returns
bool slip::Box< CoordType, DIM >::is_consistent ( ) const
inherited

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"
template<typename CoordType >
CoordType slip::Box1d< CoordType >::length ( ) const
inline

compute the length of the Box1d.

Returns
the area

Definition at line 311 of file Box1d.hpp.

template<typename T >
std::string slip::Box1d< T >::name ( ) const
inline

Returns the name of the class.

Definition at line 306 of file Box1d.hpp.

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

compare two Box.

Parameters
otherBox to compare
Returns
true if the two box don't have the same coordinates
bool slip::Box< CoordType, DIM >::operator== ( const self other) const
inherited

compare two Box.

Parameters
otherBox to compare
Returns
true if the two box have the same coordinates
template<typename CoordType >
void slip::Box1d< CoordType >::set_coord ( const CoordType &  x1,
const CoordType &  x2 
)
inline

Mutator of the coordinates of the Box1d.

Parameters
x1coordinate of the minimal point p1
x2coordinate of the maximal point p2
Returns

Definition at line 296 of file Box1d.hpp.

void slip::Box< CoordType, DIM >::swap ( self other)
inherited

Swaps two Box.

Parameters
otherBox to swap with
void slip::Box< CoordType, DIM >::translate ( const dpoint_type dp)
inherited

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

Parameters
dpdeplacement of the window
Returns
template<typename CoordType >
void slip::Box1d< CoordType >::upper_left ( const Point< CoordType, 1 > &  p1)
inline

Accessor/Mutator of the upper_left point (p1) of Box1d.

Returns
reference to the upper_left Point1d of the Box1d

Definition at line 270 of file Box1d.hpp.

template<typename CoordType >
Point< CoordType, 1 > & slip::Box1d< CoordType >::upper_left ( )
inline

Accessor/Mutator of the upper_left point (p1) of Box1d.

Returns
reference to the upper_left Point2d of the Box1d

Definition at line 274 of file Box1d.hpp.

template<typename CoordType >
const Point< CoordType, 1 > & slip::Box1d< CoordType >::upper_left ( ) const
inline

Accessor/Mutator of the upper_left point (p1) of Box1d.

Returns
reference to the upper_left Point2d of the Box1d

Definition at line 278 of file Box1d.hpp.

template<typename CoordType >
CoordType slip::Box1d< CoordType >::width ( ) const
inline

compute the width of the Box1d.

Returns
the width

Definition at line 315 of file Box1d.hpp.

Friends And Related Function Documentation

template<typename CoordType>
friend class boost::serialization::access
friend

Definition at line 220 of file Box1d.hpp.

Member Data Documentation

point_type slip::Box< CoordType, DIM >::p1_
protectedinherited

First extremal coordinate of the box

Definition at line 257 of file Box.hpp.

point_type slip::Box< CoordType, DIM >::p2_
protectedinherited

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: