oln::abstract::window_base< Sup, Exact > Struct Template Reference

Window Base. More...

#include <window_base.hh>

Inheritance diagram for oln::abstract::window_base< Sup, Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::abstract::window_base< Sup, Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { dim = struct_elt_traits<Exact >::dim }
typedef window_base< Sup,
Exact > 
self_type
 Set self type.
typedef struct_elt_traits<
Exact >::point_type 
point_type
 The associate image's type of point.
typedef struct_elt_traits<
Exact >::dpoint_type 
dpoint_type
 The associate image's type of dpoint (move point).
typedef Exact exact_type
 Set exact type.
typedef Sup super_type
 Set type of class inherited.

Static Public Member Functions

static std::string name ()
 Return the name of the type.

Protected Member Functions

bool has_ (const dpoint_type &dp) const
 Test if the set of points contains this one.
unsigned card_ () const
 Get the number of points.
bool is_centered_ () const
 Test if the set of points is centered.
bool is_equal (const exact_type &win) const
 Compare two sets of points.
coord get_delta () const
 Get the delta of the set of points.
coord delta_update (const dpoint_type &dp)
 Update delta.
void sym_ ()
 Set a set of point to opposite.
const dpoint_type at (unsigned i) const
 Get the nth structuring element.
 window_base ()
 CTor.
 window_base (unsigned size)
 Used only by sub-classes.

Protected Attributes

std::vector< dpoint_typedp_
 The list of point.
max_accumulator< coorddelta_
 Delta : the maximale point of the list.
bool centered_
 Is the set of point centered ?

Friends

class struct_elt< Exact >
class neighborhood< Exact >

Detailed Description

template<class Sup, class Exact>
struct oln::abstract::window_base< Sup, Exact >

Window Base.

A window is a set of points and this class defines how to deal with. This class regroups common things for window, w_window (weight window) and neighborhood. Here, a set of point is a window or a weigh window or a neighborhood.

Definition at line 103 of file window_base.hh.


Member Typedef Documentation

template<class Sup, class Exact>
typedef struct_elt_traits<Exact>::point_type oln::abstract::window_base< Sup, Exact >::point_type

The associate image's type of point.

Warning:
Prefer the macros oln_point_type(Pointable) and oln_point_type_(Pointable) (the same without the 'typename' keyword)

Definition at line 115 of file window_base.hh.

template<class Sup, class Exact>
typedef struct_elt_traits<Exact>::dpoint_type oln::abstract::window_base< Sup, Exact >::dpoint_type

The associate image's type of dpoint (move point).

Warning:
Prefer the macros oln_dpoint_type(Pointable) and oln_dpoint_type_(Pointable) (the same without the 'typename' keyword)

Reimplemented in oln::abstract::neighborhoodnd< Exact >, oln::abstract::w_windownd< Exact >, oln::abstract::windownd< Exact >, oln::neighborhood1d, oln::neighborhood2d, oln::neighborhood3d, oln::w_window1d< T >, oln::w_window2d< T >, oln::w_window3d< T >, oln::window1d, oln::window2d, oln::window3d, oln::abstract::neighborhoodnd< oln::neighborhood1d >, oln::abstract::neighborhoodnd< oln::neighborhood2d >, oln::abstract::neighborhoodnd< oln::neighborhood3d >, oln::abstract::w_windownd< oln::w_window2d< T > >, oln::abstract::w_windownd< oln::w_window2d< T2 > >, oln::abstract::w_windownd< oln::w_window3d< T > >, oln::abstract::w_windownd< oln::w_window1d< T > >, oln::abstract::windownd< oln::window1d >, oln::abstract::windownd< oln::window3d >, oln::abstract::windownd< oln::window2d >, and oln::w_window2d< T2 >.

Definition at line 122 of file window_base.hh.


Constructor & Destructor Documentation

template<class Sup, class Exact>
oln::abstract::window_base< Sup, Exact >::window_base (  )  [inline, protected]

CTor.

Used only by sub-classes

Definition at line 251 of file window_base.hh.

00251                     : super_type(), dp_(), delta_(0)
00252       {
00253         centered_ = false;
00254       }

template<class Sup, class Exact>
oln::abstract::window_base< Sup, Exact >::window_base ( unsigned  size  )  [inline, protected]

Used only by sub-classes.

Set the number of points this object will get. Used only by sub-classes

Definition at line 263 of file window_base.hh.

00263                                  : super_type(), dp_(), delta_(0)
00264       {
00265         dp_.reserve(size);
00266         centered_ = false;
00267       }


Member Function Documentation

template<class Sup, class Exact>
bool oln::abstract::window_base< Sup, Exact >::has_ ( const dpoint_type dp  )  const [inline, protected]

Test if the set of points contains this one.

Definition at line 152 of file window_base.hh.

Referenced by oln::abstract::windownd< oln::window2d >::add_(), oln::abstract::w_windownd< oln::w_window1d< T > >::add_(), and oln::abstract::neighborhoodnd< oln::neighborhood3d >::add_().

00153       {
00154         return std::find(dp_.begin(), dp_.end(), dp) != dp_.end();
00155       }

template<class Sup, class Exact>
unsigned oln::abstract::window_base< Sup, Exact >::card_ (  )  const [inline, protected]

Get the number of points.

Returns:
The number of points.

Definition at line 162 of file window_base.hh.

Referenced by oln::abstract::w_windownd< oln::w_window1d< T > >::set_().

00163       {
00164         return dp_.size();
00165       }

template<class Sup, class Exact>
bool oln::abstract::window_base< Sup, Exact >::is_centered_ (  )  const [inline, protected]

Test if the set of points is centered.

Returns:
True if it's centered.
Centered means :

Definition at line 176 of file window_base.hh.

00177       {
00178         return centered_;
00179       }

template<class Sup, class Exact>
bool oln::abstract::window_base< Sup, Exact >::is_equal ( const exact_type win  )  const [inline, protected]

Compare two sets of points.

Definition at line 187 of file window_base.hh.

00188       {
00189         for (typename std::vector<dpoint_type>::const_iterator it = dp_.begin(); it != dp_.end(); ++it)
00190           if (std::find(win.dp_.begin(), win.dp_.end(), *it) == win.dp_.end())
00191             return false;
00192         return true;
00193       }

template<class Sup, class Exact>
coord oln::abstract::window_base< Sup, Exact >::get_delta (  )  const [inline, protected]

Get the delta of the set of points.

Returns:
Delta.
Delta is the bigger element of the set of points.

Definition at line 202 of file window_base.hh.

00203       {
00204         return delta_;
00205       }

template<class Sup, class Exact>
coord oln::abstract::window_base< Sup, Exact >::delta_update ( const dpoint_type dp  )  [inline, protected]

Update delta.

Definition at line 216 of file window_base.hh.

Referenced by oln::abstract::windownd< oln::window2d >::add_(), oln::abstract::w_windownd< oln::w_window1d< T > >::add_(), and oln::abstract::neighborhoodnd< oln::neighborhood3d >::add_().

00217       {
00218         return this->exact().delta_update_(dp);
00219       }

template<class Sup, class Exact>
void oln::abstract::window_base< Sup, Exact >::sym_ (  )  [inline, protected]

Set a set of point to opposite.

Each point of the set of point is assigned to its opposite.

Definition at line 227 of file window_base.hh.

00228       {
00229         for (unsigned i = 0; i < this->card(); ++i)
00230           dp_[i] = - dp_[i];
00231       }

template<class Sup, class Exact>
const dpoint_type oln::abstract::window_base< Sup, Exact >::at ( unsigned  i  )  const [inline, protected]

Get the nth structuring element.

Definition at line 240 of file window_base.hh.

00241       {
00242         precondition(i < this->card());
00243         return dp_[i];
00244       }


Friends And Related Function Documentation

template<class Sup, class Exact>
friend class struct_elt< Exact > [friend]

Todo:
FIXME: this has been commented out to satisfy icc and comeau. I don't know who is right between them and gcc.

Definition at line 133 of file window_base.hh.


The documentation for this struct was generated from the following file:
Generated on Tue Feb 20 20:25:26 2007 for Olena by  doxygen 1.5.1