Group.h

Go to the documentation of this file.
00001 /* $Id: Group.h,v 1.3 2002/11/20 15:22:15 cvs Exp $ */
00002 
00003 #ifndef __GROUP_H
00004 #define __GROUP_H
00005 
00006 #include <esg/Definitions.h>
00007 #include <esg/SceneGraphObject.h>
00008 #include <esg/spacesorting/SDS.h>
00009 //#include <esg/metric/Metric.h>
00010 
00011 namespace esg {
00012 
00013     class OGSCENE_EXPORT IteratorSDS;
00014 
00028 class OGSCENE_EXPORT Group : public SceneGraphObject {
00029 protected:
00030         SDS* _repository; 
00031 
00032 public:
00040         Group (const SDS & ss, OID oid  = 0, const char * name = "");
00041 
00045         virtual ~Group();
00046 
00052         virtual bool hasSubnodes (void) const;
00053 
00059         virtual IteratorSDS* traverseSubnodes (void) const;
00060 
00064         SDS* getRepository (void) const { return _repository; }
00065 
00072         int append (SceneGraphObject* o) {
00073             if (o && _repository) {
00074                 _repository->append(o);
00075                 if (o->tangible()) _tangible = true;
00076                 return true;
00077             } else
00078                 return false;
00079         }
00080 
00086         bool build (void) {
00087             if (_repository) return _repository->build(); else return false;
00088         }
00089 
00090         //    virtual void acceptMetric (Metric& metric) {
00091         //      metric.visitGroup(this);
00092         //      if (_repository) _repository->acceptMetric(metric);
00093         //    }
00094 
00098         virtual void __debug() {
00099             if (_repository) _repository->__debug();
00100             else fprintf(stderr,"Group: No repository defined\n");
00101         }
00102 };
00103 
00104 }; // namepace
00105 
00106 
00107 #endif // __GROUP_H

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