oln::morpher::piece_morpher< SrcType, Exact > Struct Template Reference

The default piece morpher class. More...

#include <piece_morpher.hh>

Inheritance diagram for oln::morpher::piece_morpher< SrcType, Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::morpher::piece_morpher< SrcType, Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef piece_morpher< SrcType,
Exact > 
self_type
 The self type.

typedef image_id< self_type
>::exact_type 
exact_type
 The exact type of the morpher.

typedef super_piece_morpher<
SrcType, exact_type
super_type
 The upper class.

typedef image_id< exact_type
>::point_type 
point_type
 The morpher point type.

typedef image_id< exact_type
>::dpoint_type 
dpoint_type
 The morpher dpoint type.

typedef image_id< exact_type
>::size_type 
size_type
 The morpher size type.

typedef image_id< exact_type
>::value_type 
value_type
 The morpher value type.


Public Member Functions

 piece_morpher (const SrcType &ima, const dpoint_type p, const size_type s)
 Construct the piece morpher with an image ima.

 piece_morpher (const self_type &r)
 Construct the piece morpher with another piece morpher.

 piece_morpher ()
 Empty constructor.

value_typeat (const point_type &p)
 Return the stored value at the point.
  • p The point.


const value_type at (const point_type &p) const
 Return the stored value at the point.
  • p The point.


self_typeassign (self_type &rhs)
self_typeoperator= (SrcType &rhs)
 This operator= assigns rhs to the current image.


Static Public Member Functions

std::string name ()
 Useful to debug.


Detailed Description

template<class SrcType, class Exact>
struct oln::morpher::piece_morpher< SrcType, Exact >

The default piece morpher class.

Using this class, a piece of picture is a picture.

See also:
oln::morpher::abstract::generic_morpher

oln::morpher::piece_morph

Definition at line 166 of file piece_morpher.hh.


Constructor & Destructor Documentation

template<class SrcType, class Exact>
oln::morpher::piece_morpher< SrcType, Exact >::piece_morpher  )  [inline]
 

Empty constructor.

Needed by mlc_hierarchy::any_with_diamond.

Definition at line 197 of file piece_morpher.hh.

00198       {}


Member Function Documentation

template<class SrcType, class Exact>
self_type& oln::morpher::piece_morpher< SrcType, Exact >::assign self_type rhs  )  [inline]
 

Perform a shallow copy from the decorated image of rhs to the current decorated image. The points will be shared by the two images.

Definition at line 228 of file piece_morpher.hh.

References oln::morpher::piece_morpher< SrcType, Exact >::at().

00229       {
00230         oln_iter_type(SrcType)  it(rhs);
00231 
00232         for_all(it)
00233           this->at(it) = rhs[it];
00234         return this->exact();
00235       }

template<class SrcType, class Exact>
const value_type oln::morpher::piece_morpher< SrcType, Exact >::at const point_type p  )  const [inline]
 

Return the stored value at the point.

  • p The point.

Returns:
The stored value.

Reimplemented from oln::abstract::image_with_impl< Impl, Exact >.

Definition at line 218 of file piece_morpher.hh.

00219       {
00220         return this->ima_[p + p_];
00221       }

template<class SrcType, class Exact>
value_type& oln::morpher::piece_morpher< SrcType, Exact >::at const point_type p  )  [inline]
 

Return the stored value at the point.

  • p The point.

Returns:
The stored value.

Reimplemented from oln::abstract::image_with_impl< Impl, Exact >.

Definition at line 206 of file piece_morpher.hh.

Referenced by oln::morpher::piece_morpher< SrcType, Exact >::assign().

00207       {
00208         return const_cast<value_type &>
00209           ( const_cast<SrcType &>(this->ima_)[p + p_] );
00210       }


The documentation for this struct was generated from the following file:
Generated on Thu Apr 15 20:16:37 2004 for Olena by doxygen 1.3.6-20040222