#ifndef OAGEOMINFO_IGEOMLOOPFUNCTION_HXX #define OAGEOMINFO_IGEOMLOOPFUNCTION_HXX #include "IGeomVisitor.hxx" #include #include #include #include #include #include namespace COMET{ class IGeometryLoopFunction; } class COMET::IGeometryLoopFunction: public COMET::ICOMETEventLoopFunction { public: IGeometryLoopFunction(COMET::IGeomVisitor& operation):fVisitor(operation),fDepth(-1) { } virtual ~IGeometryLoopFunction() {} bool operator () (COMET::ICOMETEvent& event) { fGeoManager = COMET::IOADatabase::Get().Geometry(); fVisitor.VisitGeometry(fDepth); return false; } void Usage(void) { std::cout << " -O depth Set the depth to recurse to in the geometry." << std::endl; } bool SetOption(std::string option, std::string value) { if (option == "depth") { std::stringstream val(value); val>>fDepth; } else return false; } private: TGeoManager* fGeoManager; COMET::IGeomVisitor& fVisitor; int fDepth; }; #endif // OAGEOMINFO_IGEOMLOOPFUNCTION_HXX