
2005-04-27 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr> * oln/core/abstract/image_with_extension.hh (real): Fix signature ---such an image is mutable so 'real' should be const and should return non-const. * oln/core/gen/regular_fwd_niter.hh (friend): Fix bug. * oln/core/gen/regular_bkd_niter.hh: Likewise. * oln/core/gen/image_with_nbh.hh (concrete_type): Fix bug. (image_with_nbh()): New ctor. (image_with_nbh(size)): New ctor. (nbh_): Fix bug ---change type so that nbh is really owned. * oln/core/gen/regular_window.hh (operator-): Rename as... (impl_op_minus): ...this and fix bug. (dp): New method. 2005-04-20 Damien Thivolle <damien@lrde.epita.fr> * oln/morpho/reconstruction.hh: Remove a comment. Index: oln/core/abstract/image_with_extension.hh =================================================================== --- oln/core/abstract/image_with_extension.hh (revision 165) +++ oln/core/abstract/image_with_extension.hh (working copy) @@ -73,16 +73,11 @@ { } - const I& real() const + I& real() const { - return this->image_.unbox(); + return const_cast<I&>(this->image_.unbox()); } - I& real() - { - return this->image_.unbox(); - } - ~image_with_extension () { // FIXME : This class must check all properties Index: oln/core/gen/regular_fwd_niter.hh =================================================================== --- oln/core/gen/regular_fwd_niter.hh (revision 165) +++ oln/core/gen/regular_fwd_niter.hh (working copy) @@ -55,6 +55,7 @@ } friend class abstract::iter<self_type>; + friend class abstract::niter<self_type>; protected: @@ -70,7 +71,7 @@ bool impl_is_valid() const { - return this->pos_ != this->nbh_.card(); + return this->pos_ != int(this->nbh_.card()); } void impl_invalidate() Index: oln/core/gen/regular_bkd_niter.hh =================================================================== --- oln/core/gen/regular_bkd_niter.hh (revision 165) +++ oln/core/gen/regular_bkd_niter.hh (working copy) @@ -55,6 +55,7 @@ } friend class abstract::iter<self_type>; + friend class abstract::niter<self_type>; protected: Index: oln/core/gen/image_with_nbh.hh =================================================================== --- oln/core/gen/image_with_nbh.hh (revision 165) +++ oln/core/gen/image_with_nbh.hh (working copy) @@ -48,6 +48,7 @@ { typedef is_a<abstract::image_with_nbh> image_neighbness_type; typedef N neighb_type; + typedef image_with_nbh< oln_type_of(I, concrete), N> concrete_type; }; template <typename I, typename N> @@ -58,6 +59,16 @@ public: + image_with_nbh() + { + } + + image_with_nbh(const oln_type_of(I, size)& size) + { + I tmp(size); // FIXME: hack + this->image_ = tmp; + } + image_with_nbh(abstract::image<I>& image, const abstract::neighborhood<N>& nbh) : super_type(image), @@ -65,6 +76,13 @@ { } + image_with_nbh(abstract::image<I>& image, + const abstract::neighborhood<N>& nbh) : + super_type(image), + nbh_(nbh.exact()) + { + } + const N& impl_nbh_get() const { return nbh_; @@ -72,7 +90,7 @@ protected: - const N& nbh_; + N nbh_; }; Index: oln/core/gen/regular_window.hh =================================================================== --- oln/core/gen/regular_window.hh (revision 165) +++ oln/core/gen/regular_window.hh (working copy) @@ -97,11 +97,17 @@ return this->dp_[i]; } - const self_type operator-() const + dpoint_type& dp(unsigned i) { - self_type tmp; + precondition(i < this->card()); + return this->dp_[i]; + } + + const E impl_op_minus() const + { + E tmp = this->exact(); // FIXME: use clone(?) for (unsigned i = 0; i < this->card(); ++i) - tmp.add_(- this->dp_[i]); + tmp.dp(i) = - tmp.dp(i); return tmp; }