library of assembled shared sources

http://lass.cocamware.com

lass::prim::AutoMinMax Struct Reference
[MinMaxPolicy]

MinMaxPolicy automatically correcting wrong minima and maxima. More...

#include <min_max_policy.h>


Static Public Member Functions

template<typename PointType >
static void setMin (PointType &oMin, PointType &ioMax, const PointType &iMin)
 set value oMin to iMin and move ioMax (if necessary) so it stays correct.
template<typename PointType >
static void setMax (PointType &ioMin, PointType &oMax, const PointType &iMax)
 set value oMax to iMax and move ioMin (if necessary) so it stays correct.
template<typename PointType >
static void checkMinMax (PointType &ioMin, PointType &ioMax)
 correct ioMin and ioMax so that they are indeed then minimum and maximum.


Detailed Description

MinMaxPolicy automatically correcting wrong minima and maxima.

Author:
Bram de Greve
Date:
2003
The auto policy will silently correct wrong min/max situations by squeezing or swapping the values until a valid situation is achieved. How this is done, depends on the situation. We must consider two different possibities:

  Aabb3D<int, AutoMinMax> aabb(Point3D<int>(4, 5, 3), Point3D<int>(1, 2, 6));
  LASS_EVAL(aabb);

  // output: aabb == '(1, 2, 3)-(4, 5, 6)'

  Aabb3D<int, AutoMinMax> aabb(Point3D<int>(1, 2, 3), Point3D<int>(4, 5, 6));
  aabb.min() = Point3D<int>(5, 5, 5);
  LASS_EVAL(aabb);

  // output: aabb == '(5, 5, 5)-(5, 5, 6)'.

Note:
this policy will not correct the empty state of an AABB. After all, in in contrary to other primitives, the empty state is a valid state for the AABB, so it does not have to be corrected.
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: if you try to do something stupid, we try to correct it for you.

Definition at line 221 of file min_max_policy.h.


Member Function Documentation

template<typename PointType >
static void lass::prim::AutoMinMax::setMin ( PointType &  oMin,
PointType &  ioMax,
const PointType &  iMin 
) [inline, static]

set value oMin to iMin and move ioMax (if necessary) so it stays correct.

Definition at line 226 of file min_max_policy.h.

References lass::prim::pointwiseMax().

template<typename PointType >
static void lass::prim::AutoMinMax::setMax ( PointType &  ioMin,
PointType &  oMax,
const PointType &  iMax 
) [inline, static]

set value oMax to iMax and move ioMin (if necessary) so it stays correct.

Definition at line 235 of file min_max_policy.h.

References lass::prim::pointwiseMin().

template<typename PointType >
static void lass::prim::AutoMinMax::checkMinMax ( PointType &  ioMin,
PointType &  ioMax 
) [inline, static]

correct ioMin and ioMax so that they are indeed then minimum and maximum.

Definition at line 244 of file min_max_policy.h.

References lass::prim::pointwiseMax(), and lass::prim::pointwiseMin().


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

Generated on Mon Nov 10 14:22:13 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo