Library of Assembled Shared Sources
lass::prim::StrictMinMax Struct Reference

MinMaxPolicy enforcing strict rules for the minima and maxima. More...

#include <min_max_policy.h>

Static Public Member Functions

template<typename PointType>
static void setMin (PointType &oMin, const PointType &iMax, const PointType &iMin)
 set value oMin to iMin
 
template<typename PointType>
static void setMax (const PointType &iMin, PointType &oMax, const PointType &iMax)
 set value oMax to iMax
 
template<typename PointType>
static void checkMinMax (const PointType &iMin, const PointType &iMax)
 check if iMin and iMax are valid minima and maxima.
 

Detailed Description

MinMaxPolicy enforcing strict rules for the minima and maxima.

Author
Bram de Greve
Date
2003

The strict policy will throw exceptions if the client misbehaves to the AABB. This policy demands that you set correct minima and maxima, it demands that the minimum is indeed a minimum. An very good example of misbehaviour would be to swap minimum and maximum. But not all component values of the minimum have to be greater than the maximum. To throw an exception, it's sufficient to have only one component value of the minimum to be greater than the corresponding component value of the maximum. This can lead to subtle errors. an example:

aabb.min() = Point3D<int>(5, 5, 5);
your momma's axis aligned bounding box.
Definition aabb_3d.h:89

The above example will throw an exception. The first line is correct, it constructs an AABB of which the maximum is indeed larger than the minimum. It's in the second line. Here, we try to adjust the minimum of the AABB by setting it to 3D point (5, 5, 5). The z coordinate is no problem: 5 is indeed less that 6. The y coordinate isn't a problem either: 5 is not greater than 5. It's the x coordinate that causes the trouble: 5 is greater than 4. Bang! an exception is thrown.

The rest of the class are implementation details for the AABB and should not be called by the client (you :). In short we can say of this policy: make sure that minima are minima and maxima maxima.

Definition at line 119 of file min_max_policy.h.

Member Function Documentation

◆ setMin()

template<typename PointType>
static void lass::prim::StrictMinMax::setMin ( PointType & oMin,
const PointType & iMax,
const PointType & iMin )
inlinestatic

set value oMin to iMin

Exceptions
throwerror if iMin it is in conflict with iMax.

Definition at line 125 of file min_max_policy.h.

◆ setMax()

template<typename PointType>
static void lass::prim::StrictMinMax::setMax ( const PointType & iMin,
PointType & oMax,
const PointType & iMax )
inlinestatic

set value oMax to iMax

Exceptions
throwerror if iMax it is in conflict with iMin.

Definition at line 139 of file min_max_policy.h.

◆ checkMinMax()

template<typename PointType>
static void lass::prim::StrictMinMax::checkMinMax ( const PointType & iMin,
const PointType & iMax )
inlinestatic

check if iMin and iMax are valid minima and maxima.

Exceptions
throwerror if iMin and iMax are inconsistent.

Definition at line 153 of file min_max_policy.h.


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