Library of Assembled Shared Sources
|
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. | |
MinMaxPolicy enforcing strict rules for the minima and maxima.
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:
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.
|
inlinestatic |
set value oMin to iMin
throw | error if iMin it is in conflict with iMax. |
Definition at line 125 of file min_max_policy.h.
|
inlinestatic |
set value oMax to iMax
throw | error if iMax it is in conflict with iMin. |
Definition at line 139 of file min_max_policy.h.
|
inlinestatic |
check if iMin and iMax are valid minima and maxima.
throw | error if iMin and iMax are inconsistent. |
Definition at line 153 of file min_max_policy.h.