ExpandBBox.hpp

00001 #ifndef __FIBER_BASEOP_EXPANDBBOX_HPP
00002 #define __FIBER_BASEOP_EXPANDBBOX_HPP
00003 
00004 #include "gridopDllApi.h"
00005 #include <ocean/aerie/BoundingBox.hpp>
00006 #include <field/CreativeArray.hpp>
00007 #include <field/Field.hpp>
00008 #include <grid/Grid.hpp>
00009 
00010 namespace Fiber
00011 {
00012 
00013 using Eagle::BoundingBox;
00014 using Eagle::BoundingBall;
00015 
00016 
00025 extern gridop_API bool ExpandBBox(RefPtr<BoundingBox>&BBox, CreativeArrayBase&CAB);
00026 
00027 
00040 extern gridop_API RefPtr<BoundingBox> getFragmentBBox(const RefPtr<FragmentID>&fid, 
00041                                                       const RefPtr<CreativeArrayBase>&FragmentDataCreator, 
00042                                                       const Field&Coords);
00043 
00044 gridop_API RefPtr<BoundingBox> getBoundingBox(const RefPtr<Field>&Coords); 
00045 gridop_API RefPtr<BoundingBox> getBoundingBox(const Grid&G); 
00046 gridop_API bool expandBoundingBox(const RefPtr<Field>&Coords, RefPtr<BoundingBox>&theBox); 
00047 gridop_API bool expandBoundingBox(RefPtr<BoundingBox>&theBox, const RefPtr<Field>&Coords);
00048 
00052 class   gridop_API BBoxExpander : Field::Iterator
00053 {
00054         RefPtr<BoundingBox>     BBox;
00055 
00056 public:
00057 
00060         BBoxExpander(const RefPtr<BoundingBox>&BBox = NullPtr() );
00061 
00062         BBoxExpander(const RefPtr<BoundingBall>&BBall);
00063 
00071         BBoxExpander(const RefPtr<Field>&Coords);
00072 
00098         bool expand(const RefPtr<Field>&Coords, RefPtr<BoundingBox>&theBox);
00099 
00108         override bool apply(const RefPtr<FragmentID>&f, const RefPtr<CreativeArrayBase>&CAB); 
00109 
00111         friend gridop_API RefPtr<BoundingBox> getBoundingBox(const RefPtr<Field>&Coords); 
00112 
00114         friend gridop_API RefPtr<BoundingBox> getBoundingBox(const Grid&G); 
00115 
00120         friend gridop_API bool expandBoundingBox(const RefPtr<Field>&Coords, RefPtr<BoundingBox>&theBox); 
00121 
00130         friend gridop_API bool expandBoundingBox(RefPtr<BoundingBox>&theBox, const RefPtr<Field>&Coords);
00131 
00132 };
00133 
00134 } // end namespace Fiber
00135 
00136 #endif // __FIBER_BASEOP_EXPANDBBOX_HPP
00137 
00138