Heap.h

Go to the documentation of this file.
00001 /* $Id: Heap.h,v 1.3 2002/11/05 14:31:15 anonymous Exp $ */
00002 
00003 #ifndef __HEAP_H
00004 #define __HEAP_H
00005 
00006 #include <esg/SceneGraphObject.h>
00007 #include <esg/geometry/FDH14.h>
00008 #include <esg/spacesorting/SDS.h>
00009 #include <esg/List.h>
00010 #include <esg/iterator/Iterator.h>
00011 //#include <esg/metric/Metric.h>
00012 
00013 namespace esg {
00014 
00015 class OGSCENE_EXPORT Heap : public SDS {
00016     friend class IteratorHeap;
00017     
00018 protected:
00019     List<SceneGraphObject> _list;
00020     
00021     virtual void _duplicate_attributes (const SDS&);
00022 
00023     Heap () {}
00024   
00025 public:
00026     Heap(bool delayBuild) : SDS(delayBuild) {}
00027     virtual ~Heap();
00028     
00029     virtual SDS*          clone           () const;
00030     virtual Iterator*     createIterator  ();
00031     virtual InspectorSDS* createInspector (unsigned) { return NULL; }
00032     
00033     // Operations changing inner structure must be fixed in SDS
00034     // interface. Operations which traverse inner structure can be
00035     // moved to Iterator.
00036     //
00037     // All operation are applyed locally (not recursivelly to sub-nodes)
00038     virtual int               append  (SceneGraphObject* o);
00039     virtual SceneGraphObject* detach  (SceneGraphObject::OID);
00040 
00041     // Update inner structure. Typically when some stored object
00042     // has been moved.
00043     virtual bool update (void) { return true; }
00044 
00045     // Build inner structure. Some space sub-division structures
00046     // may prefer its real creation until they know most of storing objects.
00047     // This method must be called after all objects are appended when
00048     // delayBuild is set to true in constructor
00049     virtual bool build (void) { _delayBuild = false; return true; }
00050 
00051     // Dump the tree structure into (opened) file
00052     virtual void dump (const char* /* intent */, const char* /* tab */);
00053     
00054     // Metrices
00055 //    virtual void acceptMetric (Metric&) {}
00056 
00057     // debugging:
00058     virtual void __debug() {
00059         fprintf(stderr,"Heap Debugging: \n");
00060         _list.__debug();
00061     }
00062 };
00063 
00064 }; // namespace
00065 
00066 #endif // __HEAP_H

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