IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::BoundingBoxBase Class Reference

Base class for bounding boxes that define minimal and maximal co-ordinates of objects, groups of objects, and regions in space. More...

Inheritance diagram for IG::Num::BoundingBoxBase:
Collaboration diagram for IG::Num::BoundingBoxBase:

List of all members.

Public Member Functions

 BoundingBoxBase (int dimension)
 Creates a bounding box of the specified dimension and initializes it in such a way that minimal co-ordinate components equal to BoundingBoxBase.UndefinedMin and maximal co-ordinate components equal do BoundingBoxBase.UndefinedMax.
 BoundingBoxBase (IVector coordinates)
 Creates a bounding box and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified vector.
 BoundingBoxBase (IVector min, IVector max)
 Constructs a bounding box of the specified dimension and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified vectors.
 BoundingBoxBase (IBoundingBox bounds)
 Constructs a bounding box of the specified dimension and initializes it in such a way that its bounds correspond to those of the specified bounding box. The specified bounding box must be different than null, otherwise exception is thrown.
 BoundingBoxBase (double[] coordinates)
 Creates a bounding box and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified array.
 BoundingBoxBase (double[] min, double[] max)
 Creates a bounding box and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified arrays.
void SetDimensionAndReset (int newDimension)
 Changes dimension of the current bounding box to the specified dimension and resets the bounding box. Existent bounds information is lost.
void Reset ()
 Resets all components of vector of minimal coordinates to BoundingBoxBase.UndefinedMin, and all components of vector of maximal coordinates to BoundingBoxBase.UndefinedMax. After this method is called, Update() called on any co-ordinate of the bounding box will set both bounds of that coordinate exactly to the value of coordinate passed as argument.
void Reset (int componentIndex)
 Resets the specified component of vector of minimal coordinates to UndefinedMin, and the same component of vector of maximal coordinates to UndefinedMax. After this method is called, the first Update() called on this component will set the bounds exactly to value that is passed as argument.
void ResetMin (int componentIndex)
 Resets the specified minimal coordinate value to UndefinedMin. After this method is called, the first update called on this coordinate component will set its lower bound exactly to the value that is passed as argument.
void ResetMax (int componentIndex)
 Resets the specified maximal coordinate value to UndefinedMax. After this method is called, the first update called on this coordinate component will set its upper bound exactly to the value that is passed as argument.
bool LiesOutside (IVector coordinates)
 Returns true if the speciifed co-ordinates lie outside of the bounding box, and false otherwise. If the specified coordinates are null then false is returned, if dimensions do not match then exception is thrown.
bool LiesOutside (params double[] coordinates)
 Returns true if the speciifed co-ordinates lie outside of the bounding box, and false otherwise. If the specified coordinates are null then false is returned.
bool LiesOutside (int componentIndex, double coordinate)
 Returns true of the specified co-ordinate lies outside of the bounding box, and false otherwise.
bool LiesOutside (IBoundingBox bounds)
 Returns true if the specified bounding box lise outside of the current bounding box, and false otherwise. If the specified bounding box is null then false is returned.
void Update (IVector coordinates)
 Updates the bounding box in such a way that the specified vector fits in it. If the specified vector is null then this method has no effect.
void Update (params IVector[] points)
 Updates the bounding box in such a way that all specified vectors fit in it. If any of the specified vector is null then this entry has no effect, and if the array is null then the method call has no effect.
void Update (params double[] coordinates)
 Updates the bounding box in such a way that a vector with the specified co-ordinates fits in it. If the specified array of co-ordinate values is null then this method has no effect.Number of specified co-ordinates must match dimension of the bounding box.
void Update (int componentIndex, double coordinate)
 Updates the bounding box in such a way that the specified value of the specified co-ordinate component (defined by co-ordinate index) fits in it.
void Update (int componentIndex, params double[] coordinates)
 Updates the bounding box in such a way that all specified values of the specified co-ordinate component fit in it. If the specified array of the coordinate values is null then this method has no effect.Update is performed for a particular coordinate of the bounding box, and all specified values are taken into account.
void Update (IBoundingBox bounds)
 Updates the bounding box in such a way that the specified other bounding box fits in it. If the specified bounding box is null then this method has no effect. WARNING: Components of the bounding box that are not defined can not result in any changes in the current bounding box..
void UpdateAll (params double[] coordinates)
 Updates the current bounding box in such a way that in all components, all specified coordinates fit in it. This is for example useful to define a hypercube (equal minimum and maximum in all components), in this case just minimal and maximal bounds are specified as arguments.
void Shrink (IBoundingBox outerBounds)
 Reduces (if necessary) the current bounding box in such a way that the specified bounding box contains it. Minimal and maximal components of the current bounding box that don't fall in the specified bounding box are changed such that they lie just on the border of the bounding box, and others remain intact.
void Shrink (int which, double minBound, double maxBound)
 Reduces (if necessary) the current bounding box in such a way that the specified component falls within the interval specified by the lower and upper bound.
void ExpandOrShrinkInterval (int componentIndex, double factor)
 Symmetrically expands or shrinks the interval between the bounds for the specified component for the specified factor. Factors greater than 1 mean expansion, factors lesser than 1 mean shrinkage, and fators lesser than 0 are invalid.If lower or upper bound of the specified component is not defined then this method has no effect.
void ExpandOrShrinkInterval (double factor)
 Symmetrically expands or shrinks the intervals between the bounds for all components for the specified factor. Factors greater than 1 mean expansion, factors lesser than 1 mean shrinkage, and fators lesser than 0 are invalid.
void ExpandOrShrinkInterval (double factor, double zeroIntervalLengthReplacemnt)
 Symmetrically expands or shrinks the intervals between the bounds for all components for the specified factor, and takes care that minimal interval lengths are not 0. Factors greater than 1 mean expansion, factors lesser than 1 mean shrinkage, and fators lesser than 0 are invalid. Remark: components where minimal bound is set above maximal are not treated specially.
void SetMin (int componentIndex, double min)
 Sets minimal value for the specified coponent of the bounding box.
void SetMax (int componentIndex, double max)
 Sets maximal value for the specified coponent of the bounding box.
void SetBounds (int componentIndex, double min, double max)
 Sets minimal and maximal value for the specified coponent of the bounding box.
double GetMin (int componentIndex)
 Returns the lower bound on the specified co-ordinate component of the bounding box. If lower bound is not defined for this component then double.MinValue is returned.
double GetMax (int componentIndex)
 Returns the upper bound on the specified co-ordinate component of the bounding box. If upper bound is not defined for this component then double.MaxValue is returned.
void GetMin (ref IVector min)
 Gets the vector of lower bounds on co-ordinates of the current bounding box and stores it in the specified object. Components for which lower bounds are not defined are set to double.MinValue.
void GetMax (ref IVector max)
 Gets the vector of upper bounds on co-ordinates of the current bounding box and stores it in the specified object. Components for which upper bounds are not defined are set to double.MaxValue.
double GetIntervalLength (int componentIndex)
 Returns interval length for the specified co-ordinate component (i.e. difference between the upper and lower bound), or 0 if either lower or upper bound is not defined for this component.
void GetIntervalLengths (ref IVector intervals)
 Gets the interval lengths for co-ordinates of the current bounding box (i.e. differences) and stores them in the specified vector object. Elements for which either upper or lower bounds are not defined are set to 0.
bool IsMinDefined (int componentIndex)
 Returns true if maximum value is defined for the specified component, false otherwise.
bool IsMaxDefined (int componentIndex)
 Returns true if maximum value is defined for the specified component, false otherwise.
override string ToString ()
void GetRandomPoint (ref IVector point)
 Creates a random point contained in the current bounding box by using the global random number generator, and stores that point into the specified vector. The random point is generated according to a uniform distribution within the bounding box.
void GetRandomPoint (ref IVector point, IRandomGenerator rand)
 Creates a random point contained in the current bounding box by using the specified random number generator, and stores that point into the specified vector. The random point is generated according to a uniform distribution within the bounding box.
void Copy (IBoundingBox original, IBoundingBox copy)
 Copies state of the specified bounding box to anotherv(target) bounding box. The target bounding box must be allocated and of the same dimension as the original bounding box.

Static Public Member Functions

static BoundingBox Create (int dimension, double min, double max)
 Creates and returns a bounding box with specified dimension and minimum and maximum bounds equal in all components.
static BoundingBox Create (params IVector[] points)
 Creates and returns a minimal bounding box that contains all the specified points.
static double Map (IBoundingBox original, IBoundingBox target, int whichComponent, double value)
 Mapping from one bounding box to another. Returns a single component mapped by a mapping that maps the original to the target bounding box. If one of the bounding boxes is not specified then the performed mapping is identity mapping and does not change the value.
static void Map (IBoundingBox original, IBoundingBox target, IVector value, ref IVector result)
 Mapping from one bounding box to another. Maps a vector from the original to the target space. Mapped vector is stored to a specified vector. If one of the bounding boxes is not specified then the performed mapping is identity mapping and does not change the value.

Protected Member Functions

abstract IVector CreateVector (int dim)
 Creates and returns a new vector that is consistent with the definition of bounding box.
void ResetMin ()
 Sets all components of vector of minimal coordinates to UndefinedMin.
void ResetMax ()
 Sets all components of vector of maximal coordinates to UndefinedMax.

Protected Attributes

const double UndefinedMin = double.MinValue
const double UndefinedMax = double.MaxValue

Properties

IVector MinAuxiliary [get, set]
 Auxiliary property, gets or sets vector of minimal co-ordinates. Setter just sets reference to the vector passed and does not create a copy.
IVector MaxAuxiliary [get, set]
 Auxiliary property, gets or sets vector of maximal co-ordinates. Setter just sets reference to the vector passed and does not create a copy.
int Dimension [get, set]
 Gets dimension of the bounding box space.
virtual IVector Min [get, set]
 Gets or sets the vector of minimal co-ordinates of the bounding box. Getter always creates and returns a new vector whose elements are minimal components of the bounding box.Setter copies components rather than vector reference (if the vector assigned is null then exception is thrown). When setting the vector, its dimension must match current dimension of the bounding box, otherwise exception is thrown.
virtual IVector Max [get, set]
 Gets or sets the vector of maximal co-ordinates of the bounding box. Getter always creates and returns a new vector whose elements are maximal components of the bounding box.Setter copies components rather than vector reference (if the vector assigned is null then exception is thrown). When setting the vector, its dimension must match current dimension of the bounding box, otherwise exception is thrown.

Private Attributes

IVector _minAux
IVector _maxAux
int _dimension = 0

Detailed Description

Base class for bounding boxes that define minimal and maximal co-ordinates of objects, groups of objects, and regions in space.

$A Igor Mar10 Nov10;


Constructor & Destructor Documentation

IG::Num::BoundingBoxBase::BoundingBoxBase ( int  dimension) [inline]

Creates a bounding box of the specified dimension and initializes it in such a way that minimal co-ordinate components equal to BoundingBoxBase.UndefinedMin and maximal co-ordinate components equal do BoundingBoxBase.UndefinedMax.

Parameters:
dimensionDimension of the space in which bounding box is defined.
IG::Num::BoundingBoxBase::BoundingBoxBase ( IVector  coordinates) [inline]

Creates a bounding box and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified vector.

Parameters:
coordinatesVector of coordinates to which minimal and maximal co-ordines of the bounding box are set.
IG::Num::BoundingBoxBase::BoundingBoxBase ( IVector  min,
IVector  max 
) [inline]

Constructs a bounding box of the specified dimension and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified vectors.

Parameters:
minVector of minimal coordinates.
maxVector of maximal coordinates.
IG::Num::BoundingBoxBase::BoundingBoxBase ( IBoundingBox  bounds) [inline]

Constructs a bounding box of the specified dimension and initializes it in such a way that its bounds correspond to those of the specified bounding box. The specified bounding box must be different than null, otherwise exception is thrown.

Parameters:
boundsBounds with which the constructed bounding box is initialized.
IG::Num::BoundingBoxBase::BoundingBoxBase ( double[]  coordinates) [inline]

Creates a bounding box and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified array.

Parameters:
coordinatesArray of coordinates to which minimal and maximal co-ordines of the bounding box are set.
IG::Num::BoundingBoxBase::BoundingBoxBase ( double[]  min,
double[]  max 
) [inline]

Creates a bounding box and initializes it in such a way that minimal and maximal co-ordinate components equal to components of the spacified arrays.

Parameters:
minArray of components to which minimal co-ordines of the bounding box are set.
maxArray of components to which maximal co-ordines of the bounding box are set.

Member Function Documentation

abstract IVector IG::Num::BoundingBoxBase::CreateVector ( int  dim) [protected, pure virtual]

Creates and returns a new vector that is consistent with the definition of bounding box.

Parameters:
dimDimension of vector space.

Implemented in IG::Num::BoundingBox, IG::Num::BoundingBox3d, IG::Num::BoundingBox2d, and IG::Num::BoundingBox1d.

void IG::Num::BoundingBoxBase::SetDimensionAndReset ( int  newDimension) [inline]

Changes dimension of the current bounding box to the specified dimension and resets the bounding box. Existent bounds information is lost.

Parameters:
newDimensionNew dimenson of the bounding box.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::ResetMin ( ) [inline, protected]

Sets all components of vector of minimal coordinates to UndefinedMin.

void IG::Num::BoundingBoxBase::ResetMax ( ) [inline, protected]

Sets all components of vector of maximal coordinates to UndefinedMax.

void IG::Num::BoundingBoxBase::Reset ( ) [inline]

Resets all components of vector of minimal coordinates to BoundingBoxBase.UndefinedMin, and all components of vector of maximal coordinates to BoundingBoxBase.UndefinedMax. After this method is called, Update() called on any co-ordinate of the bounding box will set both bounds of that coordinate exactly to the value of coordinate passed as argument.

After reset, bounds on the reset coordinates become undefined.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Reset ( int  componentIndex) [inline]

Resets the specified component of vector of minimal coordinates to UndefinedMin, and the same component of vector of maximal coordinates to UndefinedMax. After this method is called, the first Update() called on this component will set the bounds exactly to value that is passed as argument.

After reset, bounds on the reset coordinates become undefined.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::ResetMin ( int  componentIndex) [inline]

Resets the specified minimal coordinate value to UndefinedMin. After this method is called, the first update called on this coordinate component will set its lower bound exactly to the value that is passed as argument.

After reset, specific bounds on the reset coordinates become undefined.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::ResetMax ( int  componentIndex) [inline]

Resets the specified maximal coordinate value to UndefinedMax. After this method is called, the first update called on this coordinate component will set its upper bound exactly to the value that is passed as argument.

After reset, specific bounds on the reset coordinates become undefined.

Implements IG::Num::IBoundingBox.

bool IG::Num::BoundingBoxBase::LiesOutside ( IVector  coordinates) [inline]

Returns true if the speciifed co-ordinates lie outside of the bounding box, and false otherwise. If the specified coordinates are null then false is returned, if dimensions do not match then exception is thrown.

Parameters:
coordinatesCoordinates that are tested for falling outside the bounding box.
Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

bool IG::Num::BoundingBoxBase::LiesOutside ( params double[]  coordinates) [inline]

Returns true if the speciifed co-ordinates lie outside of the bounding box, and false otherwise. If the specified coordinates are null then false is returned.

Parameters:
coordinatesCoordinates that are tested for falling outside the bounding box.
Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

bool IG::Num::BoundingBoxBase::LiesOutside ( int  componentIndex,
double  coordinate 
) [inline]

Returns true of the specified co-ordinate lies outside of the bounding box, and false otherwise.

Parameters:
componentIndexIndex of co-ordinate component that is tested for lying out of the bounding box.
coordinateCo-ordinate component that is tested for lying outside of the bounding box.

Implements IG::Num::IBoundingBox.

bool IG::Num::BoundingBoxBase::LiesOutside ( IBoundingBox  bounds) [inline]

Returns true if the specified bounding box lise outside of the current bounding box, and false otherwise. If the specified bounding box is null then false is returned.

Parameters:
boundsBounding box that is tested for falling outside the current bounding box.
Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Update ( IVector  coordinates) [inline]

Updates the bounding box in such a way that the specified vector fits in it. If the specified vector is null then this method has no effect.

Parameters:
coordinatesVector that needs to fit into the bounding box after this call.
Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Update ( params IVector[]  points) [inline]

Updates the bounding box in such a way that all specified vectors fit in it. If any of the specified vector is null then this entry has no effect, and if the array is null then the method call has no effect.

Parameters:
pointsVector of coordinates that need to fit into the bounding box after this call.
Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Update ( params double[]  coordinates) [inline]

Updates the bounding box in such a way that a vector with the specified co-ordinates fits in it. If the specified array of co-ordinate values is null then this method has no effect.Number of specified co-ordinates must match dimension of the bounding box.

Parameters:
coordinatesArray of co/ordinate components of the vector to which the bounding box is adapted in such a way that the vector fits in the bounding box after the call.

Number of specified co-ordinates must match the dimension of the bounding box.

Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Update ( int  componentIndex,
double  coordinate 
) [inline]

Updates the bounding box in such a way that the specified value of the specified co-ordinate component (defined by co-ordinate index) fits in it.

Parameters:
componentIndexIndex of the co-ordinate component that is updated.
coordinateCo-ordinate value to which the bounding box is adapted in such a way that this co-ordinate value fits inside it.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Update ( int  componentIndex,
params double[]  coordinates 
) [inline]

Updates the bounding box in such a way that all specified values of the specified co-ordinate component fit in it. If the specified array of the coordinate values is null then this method has no effect.Update is performed for a particular coordinate of the bounding box, and all specified values are taken into account.

Parameters:
componentIndexIndex of co-ordinate component in which the bounding box is updated.
coordinatesValues of co-ordinate component to which the bounding box is adapted in such a way that these values fit inside it (in the specified co-ordinate direction).

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Update ( IBoundingBox  bounds) [inline]

Updates the bounding box in such a way that the specified other bounding box fits in it. If the specified bounding box is null then this method has no effect. WARNING: Components of the bounding box that are not defined can not result in any changes in the current bounding box..

Parameters:
boundsBounding box that needs to fit into bounding box after this call.
Exceptions:
ArgumentExceptionThrows exception when dimensions don't match.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::UpdateAll ( params double[]  coordinates) [inline]

Updates the current bounding box in such a way that in all components, all specified coordinates fit in it. This is for example useful to define a hypercube (equal minimum and maximum in all components), in this case just minimal and maximal bounds are specified as arguments.

Parameters:
coordinatesCo-ordinates to which the bounding box is adapted in all axis directions in such a way that the specified co-ordinates fit inside it.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Shrink ( IBoundingBox  outerBounds) [inline]

Reduces (if necessary) the current bounding box in such a way that the specified bounding box contains it. Minimal and maximal components of the current bounding box that don't fall in the specified bounding box are changed such that they lie just on the border of the bounding box, and others remain intact.

Parameters:
outerBoundsBounding box that specify the area within which the current bounding box must fit. Components that fall out of this bounding box are moved to the border of this bounding box (and the current bounding box shrinks because of this).

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Shrink ( int  which,
double  minBound,
double  maxBound 
) [inline]

Reduces (if necessary) the current bounding box in such a way that the specified component falls within the interval specified by the lower and upper bound.

Parameters:
whichIndex of the component along which the bounding box is reduced if nexessary.
minBoundLower bound on the interval that is admissible in the specified coordinate direction.
maxBoundUpper bound on the interval that is admissible in the specified coordinate direction.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::ExpandOrShrinkInterval ( int  componentIndex,
double  factor 
) [inline]

Symmetrically expands or shrinks the interval between the bounds for the specified component for the specified factor. Factors greater than 1 mean expansion, factors lesser than 1 mean shrinkage, and fators lesser than 0 are invalid.If lower or upper bound of the specified component is not defined then this method has no effect.

Parameters:
componentIndexComponent of the coordinate to be expanded or shrinked.
factorFactor by which the interval between bounds is expanded or shrinked. Factors greater than 1 mean expansion, factors less than 1 mean shrinkage, and factors less than 0 are invalid (ArgumentException thrown).

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::ExpandOrShrinkInterval ( double  factor) [inline]

Symmetrically expands or shrinks the intervals between the bounds for all components for the specified factor. Factors greater than 1 mean expansion, factors lesser than 1 mean shrinkage, and fators lesser than 0 are invalid.

Parameters:
factorFactor by which the interval between bounds is expanded or shrinked. Factors greater than 1 mean expansion, factors less than 1 mean shrinkage, and factors less than 0 are invalid (ArgumentException thrown).

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::ExpandOrShrinkInterval ( double  factor,
double  zeroIntervalLengthReplacemnt 
) [inline]

Symmetrically expands or shrinks the intervals between the bounds for all components for the specified factor, and takes care that minimal interval lengths are not 0. Factors greater than 1 mean expansion, factors lesser than 1 mean shrinkage, and fators lesser than 0 are invalid. Remark: components where minimal bound is set above maximal are not treated specially.

Parameters:
factorFactor by which the interval between bounds is expanded or shrinked. Factors greater than 1 mean expansion, factors less than 1 mean shrinkage, and factors less than 0 are invalid (ArgumentException thrown).
zeroIntervalLengthReplacemntInterval length that is taken for those components for which the current interval length equals 0 (i.e. lower bound equals upper bound).

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::SetMin ( int  componentIndex,
double  min 
) [inline]

Sets minimal value for the specified coponent of the bounding box.

Parameters:
componentIndexComponent index.
minMinimal value of the component.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::SetMax ( int  componentIndex,
double  max 
) [inline]

Sets maximal value for the specified coponent of the bounding box.

Parameters:
componentIndexComponent index.
maxMaximal value of the component.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::SetBounds ( int  componentIndex,
double  min,
double  max 
) [inline]

Sets minimal and maximal value for the specified coponent of the bounding box.

Parameters:
componentIndexComponent index.
minMinimal value of the component.
maxMaximal value of the component.

Implements IG::Num::IBoundingBox.

double IG::Num::BoundingBoxBase::GetMin ( int  componentIndex) [inline]

Returns the lower bound on the specified co-ordinate component of the bounding box. If lower bound is not defined for this component then double.MinValue is returned.

Parameters:
componentIndexComponent index.

Implements IG::Num::IBoundingBox.

double IG::Num::BoundingBoxBase::GetMax ( int  componentIndex) [inline]

Returns the upper bound on the specified co-ordinate component of the bounding box. If upper bound is not defined for this component then double.MaxValue is returned.

Parameters:
componentIndexComponent index.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::GetMin ( ref IVector  min) [inline]

Gets the vector of lower bounds on co-ordinates of the current bounding box and stores it in the specified object. Components for which lower bounds are not defined are set to double.MinValue.

Parameters:
minReference to a vector object where lower bounds (minimal co-ordinates) are stored.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::GetMax ( ref IVector  max) [inline]

Gets the vector of upper bounds on co-ordinates of the current bounding box and stores it in the specified object. Components for which upper bounds are not defined are set to double.MaxValue.

Parameters:
maxReference to a vector object where upper bounds (maximal co-ordinates) are stored.

Implements IG::Num::IBoundingBox.

double IG::Num::BoundingBoxBase::GetIntervalLength ( int  componentIndex) [inline]

Returns interval length for the specified co-ordinate component (i.e. difference between the upper and lower bound), or 0 if either lower or upper bound is not defined for this component.

Parameters:
componentIndexSpecifies the component for which interval length is returned.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::GetIntervalLengths ( ref IVector  intervals) [inline]

Gets the interval lengths for co-ordinates of the current bounding box (i.e. differences) and stores them in the specified vector object. Elements for which either upper or lower bounds are not defined are set to 0.

Parameters:
minReference to a vector object where interval lengths are stored.

Implements IG::Num::IBoundingBox.

bool IG::Num::BoundingBoxBase::IsMinDefined ( int  componentIndex) [inline]

Returns true if maximum value is defined for the specified component, false otherwise.

Parameters:
componentIndexIndex of component that is queried.

Implements IG::Num::IBoundingBox.

bool IG::Num::BoundingBoxBase::IsMaxDefined ( int  componentIndex) [inline]

Returns true if maximum value is defined for the specified component, false otherwise.

Parameters:
componentIndexIndex of component that is queried.

Implements IG::Num::IBoundingBox.

override string IG::Num::BoundingBoxBase::ToString ( ) [inline]
void IG::Num::BoundingBoxBase::GetRandomPoint ( ref IVector  point) [inline]

Creates a random point contained in the current bounding box by using the global random number generator, and stores that point into the specified vector. The random point is generated according to a uniform distribution within the bounding box.

Parameters:
pointVector where generated random point is stored.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::GetRandomPoint ( ref IVector  point,
IRandomGenerator  rand 
) [inline]

Creates a random point contained in the current bounding box by using the specified random number generator, and stores that point into the specified vector. The random point is generated according to a uniform distribution within the bounding box.

Parameters:
pointVector where generated random point is stored.
randRandom number generator used for generation of the random point.

Implements IG::Num::IBoundingBox.

void IG::Num::BoundingBoxBase::Copy ( IBoundingBox  original,
IBoundingBox  copy 
) [inline]

Copies state of the specified bounding box to anotherv(target) bounding box. The target bounding box must be allocated and of the same dimension as the original bounding box.

Parameters:
originalBounding box to be copied.
copyBounding box where copy of the original is stored.
Exceptions:
ArgumentExceptionWhen dimensions don't match or one of the counding boxes is null.
static BoundingBox IG::Num::BoundingBoxBase::Create ( int  dimension,
double  min,
double  max 
) [inline, static]

Creates and returns a bounding box with specified dimension and minimum and maximum bounds equal in all components.

Parameters:
dimensionDimension of the bounding box.
minMinimal bound for all components.
maxMaximal bound for all components.
static BoundingBox IG::Num::BoundingBoxBase::Create ( params IVector[]  points) [inline, static]

Creates and returns a minimal bounding box that contains all the specified points.

Parameters:
pointsPoints (vectors) defining the created bounding box. Some vectors in this array can be null, but all non-null vector must have the same dimension.
static double IG::Num::BoundingBoxBase::Map ( IBoundingBox  original,
IBoundingBox  target,
int  whichComponent,
double  value 
) [inline, static]

Mapping from one bounding box to another. Returns a single component mapped by a mapping that maps the original to the target bounding box. If one of the bounding boxes is not specified then the performed mapping is identity mapping and does not change the value.

Parameters:
originalOriginal bounding box.
targetTarget bounding box, mapping maps the originl bounding box to this one.
whichComponentIndex of component that is mapped.
valueValue that is mapped (individual component of an element of the vector space).
Returns:
The mapped component.
static void IG::Num::BoundingBoxBase::Map ( IBoundingBox  original,
IBoundingBox  target,
IVector  value,
ref IVector  result 
) [inline, static]

Mapping from one bounding box to another. Maps a vector from the original to the target space. Mapped vector is stored to a specified vector. If one of the bounding boxes is not specified then the performed mapping is identity mapping and does not change the value.

Parameters:
originalOriginal bounding box.
targetTarget bounding box, mapping maps the originl bounding box to this one.
valueVector that is mapped.
resultVecto where the mapped vectr is stored.

Member Data Documentation

const double IG::Num::BoundingBoxBase::UndefinedMin = double.MinValue [protected]
const double IG::Num::BoundingBoxBase::UndefinedMax = double.MaxValue [protected]

Property Documentation

IVector IG::Num::BoundingBoxBase::MinAuxiliary [get, set, protected]

Auxiliary property, gets or sets vector of minimal co-ordinates. Setter just sets reference to the vector passed and does not create a copy.

IVector IG::Num::BoundingBoxBase::MaxAuxiliary [get, set, protected]

Auxiliary property, gets or sets vector of maximal co-ordinates. Setter just sets reference to the vector passed and does not create a copy.

int IG::Num::BoundingBoxBase::Dimension [get, set]

Gets dimension of the bounding box space.

Setter is not public. In order to change dimension, use the ChangeDimensionAndReset() method! This method can not be overridden. Setter is protected. If dimension is set to a new value then internal vectors of minimal and maximal values are allocated anew and reset.

Implements IG::Num::IBoundingBox.

virtual IVector IG::Num::BoundingBoxBase::Min [get, set]

Gets or sets the vector of minimal co-ordinates of the bounding box. Getter always creates and returns a new vector whose elements are minimal components of the bounding box.Setter copies components rather than vector reference (if the vector assigned is null then exception is thrown). When setting the vector, its dimension must match current dimension of the bounding box, otherwise exception is thrown.

If dimension needs to be changed then one must set the Dimension property first. This will also reset the bounding box, and a more transparent approach is to create a new bounding box.

Implements IG::Num::IBoundingBox.

virtual IVector IG::Num::BoundingBoxBase::Max [get, set]

Gets or sets the vector of maximal co-ordinates of the bounding box. Getter always creates and returns a new vector whose elements are maximal components of the bounding box.Setter copies components rather than vector reference (if the vector assigned is null then exception is thrown). When setting the vector, its dimension must match current dimension of the bounding box, otherwise exception is thrown.

If dimension needs to be changed then one must set the Dimension property first. This will also reset the bounding box, and a more transparent approach is to create a new bounding box.

Implements IG::Num::IBoundingBox.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events