vtf-logo

SemiOpenInterval.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #if !defined(__geom_SemiOpenInterval_h__)
00004 #define __geom_SemiOpenInterval_h__
00005 
00006 // If we are debugging the whole geom package.
00007 #if defined(DEBUG_geom) && !defined(DEBUG_SemiOpenInterval)
00008 #define DEBUG_SemiOpenInterval
00009 #endif
00010 
00011 #ifdef DEBUG_SemiOpenInterval
00012 // Debug the Interval class as well.
00013 #ifndef DEBUG_Interval
00014 #define DEBUG_Interval
00015 #endif
00016 #endif
00017 
00018 #include "Interval.h"
00019   
00020 BEGIN_NAMESPACE_GEOM
00021 
00028 
00029 
00033 template<int N, typename T = double>
00034 class SemiOpenInterval
00035   : public Interval<N,T> {
00036 private:
00037 
00038   //
00039   // Private types.
00040   //
00041 
00042   typedef Interval<N,T> Base;
00043 
00044 public:
00045 
00046   //
00047   // Public types.
00048   //
00049 
00051   typedef T Number;
00053   typedef typename Base::Point Point;
00054 
00055 public:
00056   
00057   //--------------------------------------------------------------------------
00059   // @{
00060   
00062   SemiOpenInterval() : 
00063     Base() 
00064   {}
00065 
00067   SemiOpenInterval(const Point& min, const Point& max) :
00068     Base(min, max)
00069   {}
00070     
00072   SemiOpenInterval(const Number xmin, const Number xmax) :
00073     Base(xmin, xmax)
00074   {}
00075     
00077   SemiOpenInterval(const Number xmin, const Number ymin, 
00078                    const Number xmax, const Number ymax) :
00079     Base(xmin, ymin, xmax, ymax)
00080   {}
00081     
00083   SemiOpenInterval(const Number xmin, const Number ymin, const Number zmin,
00084                    const Number xmax, const Number ymax, const Number zmax) :
00085     Base(xmin, ymin, zmin, xmax, ymax, zmax)
00086   {}
00087     
00089 
00092   SemiOpenInterval(const Number* coordinates) :
00093     Base(coordinates)
00094   {}
00095     
00097   SemiOpenInterval(const SemiOpenInterval& other):
00098     Base(other)
00099   {}
00100 
00102   SemiOpenInterval(const Interval<N,T>& x) :
00103     Base(x)
00104   {}
00105 
00107   SemiOpenInterval& 
00108   operator=(const SemiOpenInterval& other) {
00109     Base::operator=(other);
00110     return *this;
00111   }
00112 
00114   using Base::add;
00115 
00117   ~SemiOpenInterval() 
00118   {}
00119 
00120   // @}
00121   //--------------------------------------------------------------------------
00125   // @{
00126 
00128   using Base::bound;
00129 
00130   // @}
00131   //--------------------------------------------------------------------------
00135   // @{
00136     
00138   using Base::getLowerCorner;
00139 
00141   using Base::getUpperCorner;
00142 
00144   using Base::computeContent;
00145 
00146   // @}
00147   //--------------------------------------------------------------------------
00151   // @{
00152 
00154   using Base::setLowerCorner;
00155 
00157   using Base::setUpperCorner;
00158 
00160   using Base::setCorners;
00161 
00163   using Base::setLowerCoordinate;
00164 
00166   using Base::setUpperCoordinate;
00167 
00168   // @}
00169   //--------------------------------------------------------------------------
00171   // @{
00172 
00174   using Base::getDimension;
00175 
00176   // @}
00177   //--------------------------------------------------------------------------
00179   // @{
00180   
00182   bool 
00183   isEmpty() const;
00184 
00185   // CONTINUE: Should other members be templated?
00187   template<typename PointType>
00188   bool 
00189   isIn(const PointType& p) const;
00190 
00191   // @}
00192 };
00193   
00194 
00195 //
00196 // File I/O.
00197 //
00198 
00199   
00201 
00202 template<int N, typename T>
00203 void
00204 printFormatted(std::ostream& out, const SemiOpenInterval<N,T>& x);
00205 
00206 
00207 //
00208 // Mathematical Functions.
00209 //
00210 
00211  
00213 
00214 template<int N, typename T>
00215 bool 
00216 doOverlap(const SemiOpenInterval<N,T>& a, const SemiOpenInterval<N,T>& b);
00217 
00218 
00219 END_NAMESPACE_GEOM
00220 
00221 #define __geom_SemiOpenInterval_ipp__
00222 #include "SemiOpenInterval.ipp"
00223 #undef __geom_SemiOpenInterval_ipp__
00224 
00225 #endif

Generated on Fri Aug 24 12:55:56 2007 for Computational Geometry Package by  doxygen 1.4.7