FDH6Tree.cc

Go to the documentation of this file.
00001 #include <esg/spacesorting/FDH6Tree.h>
00002 #include <esg/explorer/NExtentsExplorer.h>
00003 #include <esg/explorer/ExtentExplorer.h>
00004 
00005 using namespace esg;
00006 
00007 
00008 Geometry* FDH6Tree::_create_bv(List<SceneGraphObject>& list)
00009 {
00010     return (Geometry*) new FDH6(list);
00011 }
00012 
00013 Geometry* FDH6Tree::_create_bv(Geometry& bv1, Geometry& bv2)
00014 {
00015     return (Geometry*) new FDH6(bv1, bv2);
00016 }
00017 
00018 Geometry* FDH6Tree::_create_bv(SceneGraphObject& obj)
00019 {
00020     float *fdhVal = new float [2*_dirs];
00021     
00022     NExtentsExplorer explorer(_fdhMat, _dirs);
00023     explorer.explore(obj);
00024     for (unsigned i = 0; i < _dirs; i++) {
00025         explorer.explore(obj);
00026         fdhVal[i]       =   explorer.result(i).max;
00027         fdhVal[i+_dirs] = - explorer.result(i).min;
00028     }
00029 
00030     FDH6 * pFDH = new FDH6(fdhVal);
00031 
00032     delete [] fdhVal;
00033 
00034     return pFDH;
00035 }
00036 
00037 Geometry* FDH6Tree::_create_bv(const float* fdhVal, unsigned)
00038 {
00039     return (Geometry*) new FDH6(fdhVal);
00040 }
00041 
00042 void FDH6Tree::_duplicate_attributes(const SDS& src)
00043 {
00044     FDHTree::_duplicate_attributes(src);
00045 }
00046 
00047 
00048 
00049 //-------- public ----------
00050 
00051 SDS* FDH6Tree::clone() const
00052 {
00053     FDH6Tree* ret = new FDH6Tree();
00054     ret->_duplicate_attributes(*this);
00055     return ret;
00056 }
00057 
00058 

Generated on Wed Jun 28 12:24:30 2006 for esg by  doxygen 1.4.6