PointSearch.hpp

00001 #ifndef __FIBER_POINT_SEARCH_HPP
00002 #define __FIBER_POINT_SEARCH_HPP
00003 
00004 #include <grid/Grid.hpp>
00005 #include <grid/CartesianChart.hpp>
00006 #include <bundle/Slice.hpp>
00007 
00008 
00009 #include <eagle/PhysicalSpace.hpp>
00010 #include <aerie/BoundingBox.hpp>
00011 
00012 #include "gridopDllApi.h"
00013 #include "FragmentSkeleton.hpp"
00014 
00015 namespace Fiber
00016 {
00017 
00023 struct gridop_API PointSearch
00024 {
00025         struct  gridop_API exception : ::std::exception
00026         {
00027                 const char*what() const throw()
00028                 {       return "PointSearch Exception";         }
00029         };
00030         struct  gridop_API NoVertices : exception
00031         {
00032                 const char*what() const throw()
00033                 {       return "PointSearch: No Vertices in Grid object";               }
00034         };
00035 
00041 static  string HelperGridname(const string&Gridname)
00042         {
00043                 return Gridname + ".UniMappers";
00044         }
00045 
00052 static  SkeletonID CellID(const Grid&G)
00053         {
00054         RefPtr<Skeleton> Vertices = G.findVertices(); 
00055                 if (!Vertices)
00056                         throw NoVertices();
00057 
00058         int     VertexDims = Vertices->Dims();
00059                 return SkeletonID(VertexDims, 1);
00060         }
00061 
00062         RefPtr<Field> UniMapperField; 
00063 
00069         RefPtr<Field> FragmentBoxes;
00070 
00076         PointSearch(Slice&slice, Grid&TheGrid, const string&Gridname);
00077 
00078         ~PointSearch(); 
00079 
00085 static  RefPtr<Field>   getHelperField(const RefPtr<Slice>&slice, const RefPtr<Grid>&TheGrid, const string&Gridname); 
00086 
00091 static  bool            hasLookupFragment(const RefPtr<Field>&HelperFeld, const RefPtr<FragmentID>&f);
00092 
00093 };
00094 
00095 } // namespace Fiber
00096 
00097 
00098 #endif //  __POINT_SEARCH_HPP
00099