#include <attributes.hh>
Inheritance diagram for oln::morpho::attr::cube_type< I, Exact >:
Public Types | |
typedef cube_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. | |
enum | { dim = point_traits<point_type>::dim } |
Public Member Functions | |
cube_type () | |
Basic Ctor. | |
cube_type (const lambda_type &lambda) | |
Ctor from a lambda_type value. | |
cube_type (const im_type &, const point_type &p, const env_type &) | |
Ctor from a point and an image. | |
int | getMin (int i) const |
Accessor to minimums. | |
int | getMax (int i) const |
Accessor to maximums. | |
int | getMin_impl (int i) const |
Implementation of getMin(int i). | |
int | getMax_impl (int i) const |
Implementation of getMax(int i). | |
void | pe_impl (const cube_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 | |
std::vector< coord > | mins_ |
std::vector< coord > | maxs_ |
value_type | value_ |
I | Exact type of images to process. |
Exact | The exact type. |
Definition at line 1434 of file attributes.hh.
|
Basic Ctor.
Definition at line 1452 of file attributes.hh.
01453 { 01454 } |
|
Ctor from a lambda_type value.
Definition at line 1461 of file attributes.hh. References oln::coord.
01461 : 01462 mins_(dim), 01463 maxs_(dim), 01464 value_(lambda) 01465 { 01466 for (int i = 0; i < point_traits<point_type>::dim; ++i) 01467 { 01468 maxs_[i] = lambda; 01469 mins_[i] = ntg_zero_val(coord); 01470 } 01471 }; |
|
Ctor from a point and an image.
Definition at line 1478 of file attributes.hh.
01480 : 01481 mins_(dim), maxs_(dim), value_(ntg_zero_val(value_type)) 01482 { 01483 for (int i = 0; i < dim; ++i) 01484 mins_[i] = maxs_[i] = p.nth(i); 01485 } |
|
Accessor to maximums. Virtual method.
Definition at line 1508 of file attributes.hh. Referenced by oln::morpho::attr::cube_type< I, Exact >::pe_impl().
01509 { 01510 mlc_dispatch(getMax)(i); 01511 }; |
|
Implementation of getMax(int i). Override this method in order to provide a new version of getMax(int i).
Definition at line 1536 of file attributes.hh.
01537 {
01538 precondition(i < dim);
01539 return maxs_[i];
01540 };
|
|
Accessor to minimums. Virtual method.
Definition at line 1495 of file attributes.hh. Referenced by oln::morpho::attr::cube_type< I, Exact >::pe_impl().
01496 { 01497 mlc_dispatch(getMin)(i); 01498 }; |
|
Implementation of getMin(int i). Override this method in order to provide a new version of getMin(int i).
Definition at line 1522 of file attributes.hh.
01523 {
01524 precondition(i < dim);
01525 return mins_[i];
01526 };
|
|
"<" operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1569 of file attributes.hh.
01570 {
01571 return value_ < lambda;
01572 }
|
|
!= operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1581 of file attributes.hh.
01582 {
01583 return value_ != lambda;
01584 };
|
|
+= operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1549 of file attributes.hh. References oln::morpho::attr::cube_type< I, Exact >::getMax(), and oln::morpho::attr::cube_type< I, Exact >::getMin().
01550 { 01551 for (int i = 0; i < dim; ++i) 01552 { 01553 mins_[i] = ntg::min(mins_[i], rhs.getMin(i)); 01554 maxs_[i] = ntg::max(maxs_[i], rhs.getMax(i)); 01555 } 01556 value_ = maxs_[0] - mins_[0]; 01557 for (int i = 1; i < dim; ++i) 01558 if (value_ < value_type(maxs_[i] - mins_[i])) 01559 value_ = maxs_[i] - mins_[i]; 01560 } |