#include <attributes.hh>
Inheritance diagram for oln::morpho::attr::ball_type< I, Exact >:
Public Types | |
typedef ball_type< I, Exact > | self_type |
Self type of the class. | |
typedef mlc::exact_vt< self_type, Exact >::ret | exact_type |
typedef oln::morpho::attr::attr_traits< exact_type >::value_type | value_type |
typedef oln::morpho::attr::attr_traits< exact_type >::env_type | env_type |
typedef oln::morpho::attr::attr_traits< exact_type >::lambda_type | lambda_type |
typedef abstract::image< typename mlc::exact< I >::ret > | im_type |
Image type. | |
typedef mlc::exact< im_type >::ret::point_type | point_type |
Point type associated to im_type. | |
typedef mlc::exact< im_type >::ret::dpoint_type | dpoint_type |
Dpoint type associated to im_type. | |
typedef std::vector< point_type > | pts_type |
Point vector type. | |
typedef pts_type::const_iterator | cst_iter_type |
const iterator on Point vector. | |
Public Member Functions | |
ball_type () | |
Basic Ctor. | |
ball_type (const lambda_type &lambda) | |
Ctor from a lambda_type value. | |
ball_type (const im_type &, const point_type &p, const env_type &) | |
Ctor from a point and an image. | |
const value_type & | getValue () const |
Accessor to value_. | |
const pts_type & | getPts () const |
Accessor to pts_. | |
const value_type & | getValue_impl () const |
Implementation of getValue(). | |
const pts_type & | getPts_impl () const |
Implementation of getValue(). | |
void | pe_impl (const ball_type &rhs) |
+= operator implementation. | |
bool | less_impl (const lambda_type &lambda) const |
"<" operator implementation. | |
bool | ne_impl (const lambda_type &lambda) const |
!= operator implementation. | |
Protected Attributes | |
value_type | value_ |
Value of the attribute. | |
pts_type | pts_ |
List of point in the ball. |
I | Exact type of images to process. |
Exact | The exact type. |
Definition at line 1119 of file attributes.hh.
|
Basic Ctor.
Definition at line 1137 of file attributes.hh.
01138 { 01139 }; |
|
Ctor from a lambda_type value.
Definition at line 1146 of file attributes.hh. References oln::morpho::attr::ball_type< I, Exact >::pts_.
|
|
Ctor from a point and an image.
Definition at line 1156 of file attributes.hh. References oln::morpho::attr::ball_type< I, Exact >::pts_.
|
|
Accessor to pts_. Virtual method.
Definition at line 1181 of file attributes.hh. Referenced by oln::morpho::attr::ball_type< I, Exact >::pe_impl().
01182 { 01183 mlc_dispatch(getPts)(); 01184 }; |
|
Implementation of getValue(). Override this method in order to provide a new version of getPts().
Definition at line 1208 of file attributes.hh. References oln::morpho::attr::ball_type< I, Exact >::pts_.
01209 { 01210 return pts_; 01211 }; |
|
Accessor to value_. Virtual method.
Definition at line 1169 of file attributes.hh. Referenced by oln::morpho::attr::ball_type< I, Exact >::pe_impl().
01170 { 01171 mlc_dispatch(getValue)(); 01172 }; |
|
Implementation of getValue(). Override this method in order to provide a new version of getValue().
Definition at line 1195 of file attributes.hh.
01196 { 01197 return value_; 01198 }; |
|
"<" operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1249 of file attributes.hh.
01250 { 01251 return value_ < lambda; 01252 }; |
|
!= operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1261 of file attributes.hh.
01262 { 01263 return lambda != value_; 01264 }; |
|
+= operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1220 of file attributes.hh. References oln::morpho::attr::ball_type< I, Exact >::getPts(), oln::morpho::attr::ball_type< I, Exact >::getValue(), and oln::morpho::attr::ball_type< I, Exact >::pts_.
01221 { 01222 value_type last = value_; 01223 std::copy(rhs.getPts().begin(), 01224 rhs.getPts().end(), 01225 std::back_inserter(pts_)); 01226 value_ = ntg_zero_val(value_type); 01227 for (cst_iter_type p1 = pts_.begin(); p1 != pts_.end(); ++p1) 01228 for (cst_iter_type p2 = pts_.begin(); p2 != pts_.end(); ++p2) 01229 { 01230 unsigned d = 0; 01231 dpoint_type p = *p1 - *p2; 01232 for (int i = 0; i < point_traits<point_type>::dim; ++i) 01233 d += p.nth(i) * p.nth(i); 01234 if (d > value_) 01235 value_ = d; 01236 } 01237 value_ /= 2; 01238 value_ = ntg::max(value_, last); 01239 value_ = ntg::max(value_, rhs.getValue()); 01240 }; |