OpenStructure
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() [1/6]

Extent ( )

default constructor

◆ Extent() [2/6]

Extent ( const Extent r)

copy constructor

◆ Extent() [3/6]

Extent ( const Point p1,
const Point p2 
)

initialize with start and end point

◆ Extent() [4/6]

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() [5/6]

Extent ( const Size size,
const Point center 
)

initialize with center point and size

◆ Extent() [6/6]

Extent ( const Point start,
const Size size 
)

initialize with Size and start point

Member Function Documentation

◆ Contains() [1/2]

bool Contains ( const Extent e) const

Returns true if the given exten is within extent.

◆ Contains() [2/2]

bool Contains ( const Point p) const

Returns true if the given point is within extent.

◆ GetCenter()

Point GetCenter ( ) const

return center

◆ GetDepth()

int GetDepth ( ) const

◆ GetDim()

int GetDim ( ) const

Return dimension.

◆ GetEnd()

const Point& GetEnd ( ) const

Return upper/right/back corner.

◆ GetHeight()

int GetHeight ( ) const

◆ GetSize()

Size GetSize ( ) const

Return size of extent.

◆ GetStart()

const Point& GetStart ( ) const

Return lower/left/front corner.

◆ GetVolume()

int GetVolume ( ) const

◆ GetWidth()

int GetWidth ( ) const

◆ Mirror()

Extent Mirror ( int  planes)

Return new extent mirrored according to planes.

◆ operator!=()

bool operator!= ( const Extent b) const
inline

Definition at line 137 of file extent.hh.

◆ operator==()

bool operator== ( const Extent b) const
inline

Definition at line 136 of file extent.hh.

◆ Point2Offset()

unsigned int Point2Offset ( const Point p)

Generates a continues, uniqe index per point contained within extent.

◆ SetEnd()

void SetEnd ( const Point e)

Set end point, changing size.

◆ SetStart()

void SetStart ( const Point o)

Set start point, changing size.

◆ Shift()

void Shift ( const Point p)

◆ WrapAround()

Point WrapAround ( const Point p)

Wrap point around.


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