vtf-logo

ISS_SimplexQuery.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__geom_ISS_SimplexQuery_h__)
00009 #define __geom_ISS_SimplexQuery_h__
00010 
00011 #if defined(DEBUG_geom) && !defined(DEBUG_ISS_SimplexQuery)
00012 #define DEBUG_ISS_SimplexQuery
00013 #endif
00014 
00015 #include "../simplex/simplex_distance.h"
00016 
00017 #include "../../tree/BBoxTree.h"
00018 
00019 #include "../../../ads/array/Array.h"
00020 
00021 BEGIN_NAMESPACE_GEOM
00022 
00024 
00029 template<class ISS>
00030 class ISS_SimplexQuery {
00031   //
00032   // Private types.
00033   //
00034 
00035 private:
00036 
00038   typedef ISS IssType;
00039 
00041   typedef typename IssType::Simplex Simplex;
00042 
00043   //
00044   // Public types.
00045   //
00046 
00047 public:
00048 
00050   typedef typename IssType::Number Number;
00052   typedef typename IssType::Vertex Vertex;
00054   typedef geom::BBox<ISS::N,Number> BBox;
00055 
00056   //
00057   // Member data.
00058   //
00059 
00060 private:
00061 
00063   const IssType& _iss;
00065   BBoxTree<ISS::N,Number> _bboxTree;
00066   
00067 
00068   //
00069   // Not implemented.
00070   //
00071 
00072 private:
00073 
00075   ISS_SimplexQuery();
00076 
00078   ISS_SimplexQuery(const ISS_SimplexQuery&);
00079 
00081   ISS_SimplexQuery& 
00082   operator=(const ISS_SimplexQuery&);
00083 
00084 public:
00085 
00086   //--------------------------------------------------------------------------
00089 
00091 
00094   ISS_SimplexQuery(const IssType& iss) :
00095     _iss(iss),
00096     _bboxTree() {
00097     build();
00098   }
00099 
00101   void
00102   build();
00103 
00105   ~ISS_SimplexQuery()
00106   {}
00107 
00109   //--------------------------------------------------------------------------
00112 
00114   template<typename IntOutIter>
00115   void
00116   computePointQuery(IntOutIter iter, const Vertex& x) const;
00117   
00119   template<typename IntOutIter>
00120   void
00121   computeWindowQuery(IntOutIter iter, const BBox& window) const;
00122 
00124 
00128   int
00129   computeMinimumDistanceAndIndex(const Vertex& x, Number* minDistance) const;
00130 
00132 
00136   int
00137   computeMinimumDistanceIndex(const Vertex& x) const {
00138     Number minDistance;
00139     return computeMinimumDistanceAndIndex(x, &minDistance);
00140   }
00141 
00143 
00147   Number
00148   computeMinimumDistance(const Vertex& x) const;
00149 
00151 };
00152 
00153 END_NAMESPACE_GEOM
00154 
00155 #define __geom_ISS_SimplexQuery_ipp__
00156 #include "ISS_SimplexQuery.ipp"
00157 #undef __geom_ISS_SimplexQuery_ipp__
00158 
00159 #endif

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