#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 oln::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 1098 of file morpho/attributes.hh.
oln::morpho::attr::ball_type< I, Exact >::ball_type | ( | ) | [inline] |
Basic Ctor.
Definition at line 1116 of file morpho/attributes.hh.
oln::morpho::attr::ball_type< I, Exact >::ball_type | ( | const lambda_type & | lambda | ) | [inline] |
Ctor from a lambda_type value.
Definition at line 1125 of file morpho/attributes.hh.
oln::morpho::attr::ball_type< I, Exact >::ball_type | ( | const im_type & | , | |
const point_type & | p, | |||
const env_type & | ||||
) | [inline] |
Ctor from a point and an image.
Definition at line 1135 of file morpho/attributes.hh.
References oln::morpho::attr::ball_type< I, Exact >::pts_.
01135 : 01136 value_(ntg_zero_val(value_type)), pts_() 01137 01138 { 01139 pts_.push_back(p); 01140 };
const value_type& oln::morpho::attr::ball_type< I, Exact >::getValue | ( | ) | const [inline] |
Accessor to value_.
Virtual method.
Definition at line 1148 of file morpho/attributes.hh.
Referenced by oln::morpho::attr::ball_type< I, Exact >::pe_impl().
01149 { 01150 mlc_dispatch(getValue)(); 01151 };
const pts_type& oln::morpho::attr::ball_type< I, Exact >::getPts | ( | ) | const [inline] |
Accessor to pts_.
Virtual method.
Definition at line 1160 of file morpho/attributes.hh.
Referenced by oln::morpho::attr::ball_type< I, Exact >::pe_impl().
01161 { 01162 mlc_dispatch(getPts)(); 01163 };
const value_type& oln::morpho::attr::ball_type< I, Exact >::getValue_impl | ( | ) | const [inline] |
Implementation of getValue().
Override this method in order to provide a new version of getValue().
Definition at line 1174 of file morpho/attributes.hh.
References oln::morpho::attr::ball_type< I, Exact >::value_.
01175 { 01176 return value_; 01177 };
const pts_type& oln::morpho::attr::ball_type< I, Exact >::getPts_impl | ( | ) | const [inline] |
Implementation of getValue().
Override this method in order to provide a new version of getPts().
Definition at line 1187 of file morpho/attributes.hh.
References oln::morpho::attr::ball_type< I, Exact >::pts_.
01188 { 01189 return pts_; 01190 };
void oln::morpho::attr::ball_type< I, Exact >::pe_impl | ( | const ball_type< I, Exact > & | rhs | ) | [inline] |
+= operator implementation.
This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1199 of file morpho/attributes.hh.
References oln::morpho::attr::ball_type< I, Exact >::getPts(), oln::morpho::attr::ball_type< I, Exact >::getValue(), oln::morpho::attr::ball_type< I, Exact >::pts_, and oln::morpho::attr::ball_type< I, Exact >::value_.
01200 { 01201 value_type last = value_; 01202 std::copy(rhs.getPts().begin(), 01203 rhs.getPts().end(), 01204 std::back_inserter(pts_)); 01205 value_ = ntg_zero_val(value_type); 01206 for (cst_iter_type p1 = pts_.begin(); p1 != pts_.end(); ++p1) 01207 for (cst_iter_type p2 = pts_.begin(); p2 != pts_.end(); ++p2) 01208 { 01209 unsigned d = 0; 01210 dpoint_type p = *p1 - *p2; 01211 for (int i = 0; i < point_traits<point_type>::dim; ++i) 01212 d += p.nth(i) * p.nth(i); 01213 if (d > value_) 01214 value_ = d; 01215 } 01216 value_ /= 2; 01217 value_ = ntg::max(value_, last); 01218 value_ = ntg::max(value_, rhs.getValue()); 01219 };
bool oln::morpho::attr::ball_type< I, Exact >::less_impl | ( | const lambda_type & | lambda | ) | const [inline] |
"<" operator implementation.
This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1228 of file morpho/attributes.hh.
References oln::morpho::attr::ball_type< I, Exact >::value_.
01229 { 01230 return value_ < lambda; 01231 };
bool oln::morpho::attr::ball_type< I, Exact >::ne_impl | ( | const lambda_type & | lambda | ) | const [inline] |
!= operator implementation.
This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1240 of file morpho/attributes.hh.
References oln::morpho::attr::ball_type< I, Exact >::value_.
01241 { 01242 return lambda != value_; 01243 };