00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __UT_SuperInterval__
00021 #define __UT_SuperInterval__
00022
00023 #include "UT_API.h"
00024 #include "UT_Math.h"
00025 #include "UT_Interval.h"
00026
00027 class UT_API UT_SuperInterval : public UT_Interval
00028 {
00029 public:
00030 UT_SuperInterval( UT_Interval const& interval )
00031 {
00032 *this = interval;
00033 }
00034
00035 UT_SuperInterval(fpreal a, fpreal b, bool ia = true, bool ib = true):
00036 UT_Interval( a, b )
00037 {
00038 myMinInclusive = ia;
00039 myMaxInclusive = ib;
00040 }
00041
00042 UT_SuperInterval()
00043 {
00044 myMinInclusive = true;
00045 myMaxInclusive = true;
00046 }
00047
00048 ~UT_SuperInterval() {}
00049
00050 UT_SuperInterval &operator=( UT_Interval const& interval )
00051 {
00052 if( this != &interval )
00053 {
00054 *(UT_Interval*)this = interval;
00055 myMinInclusive = true;
00056 myMaxInclusive = true;
00057 }
00058 return *this;
00059 }
00060
00061
00062
00063
00064 bool contains(fpreal arg, fpreal tol=UT_FTOLERANCED ) const
00065 {
00066 return
00067 (myMinInclusive ?
00068 UTisLessOrEqual(min, arg, tol) :
00069 UTisLess(min, arg, tol) )
00070 &&
00071 (myMaxInclusive ?
00072 UTisLessOrEqual(arg, max, tol) :
00073 UTisLess(arg, max, tol) );
00074 }
00075
00076
00077
00078
00079
00080 void clamp(fpreal c_min, fpreal c_max);
00081
00082 void display() const;
00083
00084 public:
00085 bool myMinInclusive, myMaxInclusive;
00086 };
00087
00088 #endif