OpenStructure
|
#include <extent.hh>
Inherited by ExtentMask.
Public Member Functions | |
Extent () | |
Extent (const Extent &r) | |
Extent (const Point &p1, const Point &p2) | |
Extent (const Size &s) | |
Extent (const Size &size, const Point ¢er) | |
Extent (const Point &start, const Size &size) | |
const Point & | GetStart () const |
const Point & | GetEnd () const |
void | SetStart (const Point &o) |
void | SetEnd (const Point &e) |
bool | Contains (const Point &p) const |
bool | Contains (const Extent &e) const |
Point | GetCenter () const |
Size | GetSize () const |
int | GetWidth () const |
int | GetHeight () const |
int | GetDepth () const |
int | GetVolume () const |
int | GetDim () const |
Point | WrapAround (const Point &p) |
Extent | Mirror (int planes) |
unsigned int | Point2Offset (const Point &p) |
bool | operator== (const Extent &b) const |
bool | operator!= (const Extent &b) const |
void | Shift (const Point &p) |
Defines lower and upper valid indices.
Is part of the basic characteristic of each Data instance. Encapsulates a start and end index. Size and Dimension are directly extracted from Extent.
Extent | ( | ) |
default constructor
initialize with Size
The extent will go from -(size-1)/2 to (size-1)/2 for odd sizes, and from -(size/2-1) to size/2 for even images
not explicit on purpose, facilitates easier creation code
bool Contains | ( | const Extent & | e | ) | const |
Returns true if the given exten is within extent.
bool Contains | ( | const Point & | p | ) | const |
Returns true if the given point is within extent.
Point GetCenter | ( | ) | const |
return center
int GetDepth | ( | ) | const |
int GetDim | ( | ) | const |
Return dimension.
const Point& GetEnd | ( | ) | const |
Return upper/right/back corner.
int GetHeight | ( | ) | const |
Size GetSize | ( | ) | const |
Return size of extent.
const Point& GetStart | ( | ) | const |
Return lower/left/front corner.
int GetVolume | ( | ) | const |
int GetWidth | ( | ) | const |
Extent Mirror | ( | int | planes | ) |
Return new extent mirrored according to planes.
unsigned int Point2Offset | ( | const Point & | p | ) |
Generates a continues, uniqe index per point contained within extent.
void SetEnd | ( | const Point & | e | ) |
Set end point, changing size.
void SetStart | ( | const Point & | o | ) |
Set start point, changing size.
void Shift | ( | const Point & | p | ) |