WARPXM v1.10.0
|
WxBox represents a n-dimensional box of elements specified by lower coordinates and upper coordinates. More...
#include <wxbox.h>
WxBox represents a n-dimensional box of elements specified by lower coordinates and upper coordinates.
Public Member Functions | |
WxBox () | |
WxBox (unsigned ndims) | |
Create a 'ndims' dimensional box. | |
WxBox (unsigned ndims, const TYPE *lower, const TYPE *upper) | |
Constucts a box with given 'lower' and 'upper' bounds. | |
WxBox (unsigned ndims, const TYPE *length) | |
Constucts a box given lengths of each side. | |
WxBox (TYPE s1, TYPE e1) | |
The following constructors constuct a box with explicit passing of lower s* and upper e* coordinates. | |
WxBox (TYPE s1, TYPE e1, TYPE s2, TYPE e2) | |
Rank-2 ctor. | |
WxBox (TYPE s1, TYPE e1, TYPE s2, TYPE e2, TYPE s3, TYPE e3) | |
Rank-3 ctor. | |
WxBox (TYPE s1, TYPE e1, TYPE s2, TYPE e2, TYPE s3, TYPE e3, TYPE s4, TYPE e4) | |
Rank-4 ctor. | |
WxBox (const WxBox< TYPE > &b) | |
Copy constructor and assignment operators. | |
WxBox & | operator= (const WxBox< TYPE > &b) |
virtual | ~WxBox () |
virtual void | setup (const WxCryptSet &wxc) |
Constructs a box specified in a cryptset. | |
void | resize (const unsigned dim, const TYPE newLength) |
Modify upper indicex based on newly supplied length. | |
unsigned | ndims () const |
Dimensionality of box. | |
TYPE | lower (unsigned dim) const |
Lower bound along dimension 'dim'. | |
void | lower (unsigned dim, TYPE low) |
Set lower bound along dimension 'dim'. | |
TYPE | upper (unsigned dim) const |
Upper bound along dimension 'dim'. | |
void | upper (unsigned dim, TYPE upp) |
Set upper bound along dimension 'dim'. | |
std::pair< TYPE, TYPE > | boundsPair (unsigned dim) const |
Pair of upper and lower bound along dimension 'dim'. | |
virtual bool | isEmpty () const |
Determine if box is empty. | |
virtual TYPE | length (unsigned dim) const |
Length of edge along dimension 'dim'. | |
TYPE | area () const |
Area of box. | |
TYPE | size () const |
Area of box. | |
std::string | coordinateString () const |
String of box coordinates. | |
WxBox< TYPE > | intersect (const WxBox< TYPE > &box) const |
Computes intersection of this box with supplied box. | |
WxBox< TYPE > | extend (const TYPE low[], const TYPE upp[]) const |
Returns a box which is extended by the given amount along each side in each dimension. | |
WxBox< TYPE > | extend (const TYPE uniformPad[]) const |
Returns a box which is extended by the given amount along both sides in each dimension. | |
WxBox< TYPE > | extend (TYPE uniformPad) const |
Returns a box which is extended by the given amount along both sides in every dimension. | |
WxBox< TYPE > | extDim (TYPE low, TYPE upp) const |
Returns a new box which has one greater dimension than this one. | |
void | extrude (const WxBox &box) |
Increases the rank of this box to match that of the supplied box argument. | |
WxBox< TYPE > | reduceDim (unsigned int newDim) const |
Returns a new box which has up to new number of dimensions. | |
bool | operator== (const WxBox< TYPE > &b) const |
Check if this box is equal to one supplied. | |
bool | contains (const TYPE coord[]) const |
Check if the box contains the given point. | |
bool | encloses (const WxBox< TYPE > &candidateBox) const |
Check if the box encloses the given box. | |
bool | compareShape (const WxBox< TYPE > &candidateBox) const |
Check if all side lengths of the supplied box match this one. | |
Public Member Functions inherited from WxObject | |
virtual | ~WxObject () |
Dtor: destroy object. | |
void | setIo (WxIoBase &io) |
Set the I/O pointer for use in object. | |
void | setMsg (WxMsgBase &msg) |
Set the msg pointer for use in object. | |
WxIoBase & | getIo () |
Return reference to I/O object. | |
const WxIoBase & | getIo () const |
Return constant reference to I/O object. | |
WxMsgBase & | getMsg () |
Return reference to msg object. | |
const WxMsgBase & | getMsg () const |
Return const reference to msg object. | |
virtual void | setup (const WxCryptSet &wxc) |
Setup object using supplied crypset. | |
virtual void | init () |
Initialize the object. | |
virtual void | finishBuild () |
Finish building the object. | |
virtual void | load (WxIoBase &io, const WxIoNodeType &grpNode) |
Load object from file. | |
virtual void | dump (WxIoBase &io, WxIoNodeType &grpNode) const |
Dump object to file. | |
virtual std::string | name () const |
Get name of object. | |
void | setName (const std::string &nm) |
Set object's name. | |
Static Public Attributes | |
static const int | max_dims = 8 |
Maximum rank box that can be represented. | |
Protected Attributes | |
unsigned | _ndims |
TYPE | _lower [max_dims] |
TYPE | _upper [max_dims] |
TYPE | _length [max_dims] |
Additional Inherited Members | |
Protected Member Functions inherited from WxObject | |
WxObject () | |
Create object, that will be initialized subsequently. | |
WxObject (const std::string &name) | |
Create object with given name bypassing object setup phase Protected because there is no reason to have a WxObject directly, as it is meant to be a parent class. | |
WxBox< TYPE >::WxBox | ( | unsigned | ndims, |
const TYPE * | lower, | ||
const TYPE * | upper | ||
) |
Constucts a box with given 'lower' and 'upper' bounds.
ndims | Dimensionality of the box |
lower | Array of lower corner coordinates |
upper | Array of upper corner coordinates |
Constucts a box given lengths of each side.
All lower[] values will be 0.
ndims | Dimensionality of the box |
length | Array of upper corner coordinates |
The following constructors constuct a box with explicit passing of lower s* and upper e* coordinates.
Rank-1 ctor
WxBox< TYPE >::WxBox | ( | TYPE | s1, |
TYPE | e1, | ||
TYPE | s2, | ||
TYPE | e2, | ||
TYPE | s3, | ||
TYPE | e3 | ||
) |
Rank-3 ctor.
WxBox< TYPE >::WxBox | ( | TYPE | s1, |
TYPE | e1, | ||
TYPE | s2, | ||
TYPE | e2, | ||
TYPE | s3, | ||
TYPE | e3, | ||
TYPE | s4, | ||
TYPE | e4 | ||
) |
Rank-4 ctor.
Copy constructor and assignment operators.
TYPE WxBox< TYPE >::area | ( | ) | const |
Area of box.
|
inline |
Pair of upper and lower bound along dimension 'dim'.
dim | Direction |
bool WxBox< TYPE >::compareShape | ( | const WxBox< TYPE > & | candidateBox | ) | const |
Check if all side lengths of the supplied box match this one.
candidateBox | Box to check |
bool WxBox< TYPE >::contains | ( | const TYPE | coord[] | ) | const |
Check if the box contains the given point.
Points lying on box edges are considered contained.
coord | Point to check |
std::string WxBox< TYPE >::coordinateString | ( | ) | const |
String of box coordinates.
Check if the box encloses the given box.
Overlapping edges are considered contained.
candidateBox | Box to check |
Returns a new box which has one greater dimension than this one.
low | lower coordinate for new dimension |
upp | upper coordinate for new dimension |
WxBox< TYPE > WxBox< TYPE >::extend | ( | const TYPE | low[], |
const TYPE | upp[] | ||
) | const |
Returns a box which is extended by the given amount along each side in each dimension.
low | extend region along lower edge in direction dim is low[dim] |
upp | extend region along upper edge in direction dim is upp[dim] |
Returns a box which is extended by the given amount along both sides in each dimension.
uniformPad | extend region along both edges in direction dim is ng[dim] |
Returns a box which is extended by the given amount along both sides in every dimension.
uniformPad | extend region along both edges in every dimension by same amount |
Increases the rank of this box to match that of the supplied box argument.
Positions of the new dimensions' corners match that of the supplied box argument. If supplied box argument has lower or equal rank as this box, nothing is modified.
box | template box to use for extrusion. |
Computes intersection of this box with supplied box.
box | to intersect with |
|
virtual |
|
inlinevirtual |
Length of edge along dimension 'dim'.
dim | Direction |
Reimplemented in WxRange.
|
inline |
Lower bound along dimension 'dim'.
dim | Direction |
|
inline |
Set lower bound along dimension 'dim'.
dim | Direction |
|
inline |
Dimensionality of box.
Check if this box is equal to one supplied.
b | Box to compare with |
Returns a new box which has up to new number of dimensions.
This box is projected into the lower dimensional box. Projection maintains the lower dimension shape of this box
newDim | requested new dimensionality of the projection |
void WxBox< TYPE >::resize | ( | const unsigned | dim, |
const TYPE | newLength | ||
) |
Modify upper indicex based on newly supplied length.
Number of dimensions remains the same. Lower coordinate remain the same.
dimension | to modify |
new | length to adjust box upper limit to. |
|
virtual |
Constructs a box specified in a cryptset.
The cryptset should have variables
Lower = [dim0Low, dim1Low, ...] Upper = [dim0Upper, dim1Upper, ...]
Lower and Upper vectors must have same length that establishes the number of box dimensions.
wxc | WxCryptSet to initialize box with. |
Reimplemented from WxObject.
|
inline |
Area of box.
|
inline |
Upper bound along dimension 'dim'.
dim | Direction |
|
inline |
Set upper bound along dimension 'dim'.
dim | Direction |
|
protected |
|
static |
Maximum rank box that can be represented.