Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

mln::win::rectangle2d Struct Reference
[2D windows]

Rectangular window defined on the 2D square grid. More...

#include <rectangle2d.hh>

Inheritance diagram for mln::win::rectangle2d:
Inheritance graph

List of all members.

Public Types

typedef dpsites_fwd_piter
< rectangle2d
bkd_qiter
 Backward site iterator associated type.
typedef Window< void > category
typedef psite center_t
 Type of the window center.
typedef dpoint2d dpsite
 DPsite associated type.
typedef rectangle2d exact_t
typedef dpsites_fwd_piter
< rectangle2d
fwd_qiter
 Forward site iterator associated type.
typedef dpoint2d::psite psite
 Psite associated type.
typedef fwd_qiter qiter
 Site iterator associated type.
typedef window< dpoint2dregular
 Regular window associated type.
typedef dpoint2d::site site
 Site associated type.

Public Member Functions

unsigned area () const
 Give the rectangle area.
unsigned delta () const
 Give the maximum coordinate gap between the window center and a window point.
unsigned delta_ () const
 Give the maximum coordinate gap between the window center and a window point.
const dpoint2ddp (unsigned i) const
 Give the i-th delta-point.
bool has (const dpoint2d &dp) const
 Test if the delta-point dp belongs to the window.
unsigned height () const
 Give the rectangle height.
bool is_centered () const
 Test if the window is centered; return true.
bool is_empty () const
 Test if the window is empty (null size; no delta-point).
bool is_neighbable_ () const
 Test if this window can be a neighborhood.
bool is_symmetric () const
 Test if the window is symmetric; return true.
bool is_valid () const
 return true by default.
void print (std::ostream &ostr) const
 Print into ostr the window definition.
void print_ (std::ostream &ostr) const
 rectangle2d (unsigned height, unsigned width)
 Constructor.
unsigned size () const
 Give the number of delta-points.
const std::vector< dpoint2d > & std_vector () const
 Give the std vector of delta-points.
void sym ()
 Apply a central symmetry to the target window; a no-op here.
const std::vector< dpoint2d > & vect () const
 Give the vector of delta-points.
unsigned width () const
 Give the rectangle width.

Protected Member Functions

void insert (const dpoint2d &d)

Protected Attributes

unsigned height_
unsigned width_
mln::window< dpoint2dwin_

Detailed Description

Rectangular window defined on the 2D square grid.

A rectangle2d is a 2D window with rectangular shape. It is centered and symmetric.

For instance:

     *  o o o o o
     *  o o x o o
     *  o o o o o
     * 

is defined with height = 3 and width = 5.

Definition at line 64 of file rectangle2d.hh.


Member Typedef Documentation

Backward site iterator associated type.

Definition at line 67 of file classical_window_base.hh.

typedef Window<void> mln::Window< rectangle2d >::category [inherited]

Reimplemented from mln::Object< rectangle2d >.

Definition at line 89 of file concept/window.hh.

Type of the window center.

Definition at line 62 of file window_base.hh.

DPsite associated type.

Definition at line 53 of file window_base.hh.

typedef rectangle2d mln::Object< rectangle2d >::exact_t [inherited]

Definition at line 173 of file object.hh.

Forward site iterator associated type.

Definition at line 64 of file classical_window_base.hh.

Psite associated type.

Definition at line 56 of file window_base.hh.

Site iterator associated type.

Definition at line 70 of file classical_window_base.hh.

Regular window associated type.

Definition at line 60 of file classical_window_base.hh.

Site associated type.

Definition at line 59 of file window_base.hh.


Constructor & Destructor Documentation

mln::win::rectangle2d::rectangle2d ( unsigned  height,
unsigned  width 
) [inline]

Constructor.

Parameters:
[in] height Height of the rectangle2d.
[in] width Width of the rectangle2d.
Precondition:
Height and width are odd.

Definition at line 106 of file rectangle2d.hh.

References mln::internal::classical_window_base< dpoint2d, rectangle2d >::insert().


Member Function Documentation

unsigned mln::win::rectangle2d::area (  )  const [inline]

Give the rectangle area.

Definition at line 132 of file rectangle2d.hh.

References height_, and width_.

unsigned mln::internal::classical_window_base< dpoint2d , rectangle2d >::delta (  )  const [inherited]

Give the maximum coordinate gap between the window center and a window point.

unsigned mln::win::rectangle2d::delta_ (  )  const [inline]

Give the maximum coordinate gap between the window center and a window point.

Reimplemented from mln::internal::classical_window_base< dpoint2d, rectangle2d >.

Definition at line 138 of file rectangle2d.hh.

References height_, and width_.

const dpoint2d & mln::internal::classical_window_base< dpoint2d , rectangle2d >::dp ( unsigned  i  )  const [inherited]

Give the i-th delta-point.

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::has ( const dpoint2d dp  )  const [inherited]

Test if the delta-point dp belongs to the window.

unsigned mln::win::rectangle2d::height (  )  const [inline]

Give the rectangle height.

Definition at line 120 of file rectangle2d.hh.

References height_.

void mln::internal::classical_window_base< dpoint2d , rectangle2d >::insert ( const dpoint2d d  )  [protected, inherited]

Referenced by rectangle2d().

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::is_centered (  )  const [inherited]

Test if the window is centered; return true.

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::is_empty (  )  const [inherited]

Test if the window is empty (null size; no delta-point).

bool mln::internal::window_base< dpoint2d , rectangle2d >::is_neighbable_ (  )  const [inherited]

Test if this window can be a neighborhood.

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::is_symmetric (  )  const [inherited]

Test if the window is symmetric; return true.

bool mln::internal::window_base< dpoint2d , rectangle2d >::is_valid (  )  const [inherited]

return true by default.

void mln::internal::classical_window_base< dpoint2d , rectangle2d >::print ( std::ostream &  ostr  )  const [inherited]

Print into ostr the window definition.

void mln::win::rectangle2d::print_ ( std::ostream &  ostr  )  const [inline]

Reimplemented from mln::internal::classical_window_base< dpoint2d, rectangle2d >.

Definition at line 152 of file rectangle2d.hh.

References height_, and width_.

unsigned mln::internal::classical_window_base< dpoint2d , rectangle2d >::size (  )  const [inherited]

Give the number of delta-points.

const std::vector< dpoint2d > & mln::win::rectangle2d::std_vector (  )  const [inline]
void mln::internal::classical_window_base< dpoint2d , rectangle2d >::sym (  )  [inherited]

Apply a central symmetry to the target window; a no-op here.

const std::vector<dpoint2d >& mln::internal::classical_window_base< dpoint2d , rectangle2d >::vect (  )  const [inherited]

Give the vector of delta-points.

unsigned mln::win::rectangle2d::width (  )  const [inline]

Give the rectangle width.

Definition at line 126 of file rectangle2d.hh.

References width_.


Member Data Documentation

unsigned mln::win::rectangle2d::height_ [protected]

Definition at line 98 of file rectangle2d.hh.

Referenced by area(), delta_(), height(), and print_().

unsigned mln::win::rectangle2d::width_ [protected]

Definition at line 98 of file rectangle2d.hh.

Referenced by area(), delta_(), print_(), and width().

Definition at line 118 of file classical_window_base.hh.

Referenced by std_vector().