OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions
Extent Class Reference

#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 &center)
 
 Extent (const Point &start, const Size &size)
 
const PointGetStart () const
 
const PointGetEnd () 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)
 

Detailed Description

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.

Definition at line 60 of file extent.hh.

Constructor & Destructor Documentation

Extent ( )

default constructor

Extent ( const Extent r)

copy constructor

Extent ( const Point p1,
const Point p2 
)

initialize with start and end point

Extent ( const Size s)

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

Extent ( const Size size,
const Point center 
)

initialize with center point and size

Extent ( const Point start,
const Size size 
)

initialize with Size and start point

Member Function Documentation

bool Contains ( const Point p) const

Returns true if the given point is within extent.

bool Contains ( const Extent e) const

Returns true if the given exten 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.

bool operator!= ( const Extent b) const
inline

Definition at line 137 of file extent.hh.

bool operator== ( const Extent b) const
inline

Definition at line 136 of file extent.hh.

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)
Point WrapAround ( const Point p)

Wrap point around.


The documentation for this class was generated from the following file: