Milena (Olena)  User documentation 2.0a Id
 All Classes Namespaces Functions Variables Typedefs Enumerator Groups Pages
mln::win::octagon2d Struct Reference

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

#include <octagon2d.hh>

Inherits mln::internal::classical_window_base< dpoint2d, octagon2d >.

Public Member Functions

unsigned area () const
 Give the area.
 
unsigned length () const
 Give the octagon length, that is, its width.
 
 octagon2d (unsigned length)
 Constructor.
 

Detailed Description

Octagon window defined on the 2D square grid.

An octagon2d is centered and symmetric.

The length L of the octagon is such as L = 6 * l + 1 where l >= 0.

For instance:

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

is defined with L = 7 (l = 1).

Definition at line 67 of file octagon2d.hh.

Constructor & Destructor Documentation

mln::win::octagon2d::octagon2d ( unsigned  length)
inline

Constructor.

Parameters
[in]lengthLength, of the octagon.
Precondition
length is such as length = 6*x + 1 where x >= 0.

Definition at line 101 of file octagon2d.hh.

Member Function Documentation

unsigned mln::win::octagon2d::area ( ) const
inline

Give the area.

Definition at line 157 of file octagon2d.hh.

unsigned mln::win::octagon2d::length ( ) const
inline

Give the octagon length, that is, its width.

Definition at line 145 of file octagon2d.hh.