#include #include #include #include #include #include #include #include #include #include #include "IOADatabase.hxx" #include "IGeomIdManager.hxx" #include "IGeomVisitor.hxx" #include "IGeomBase.hxx" //**************************************************************** const COMET::IGeomModuleBase& COMET::IGeomBase::GetModule(const char* name) const { //**************************************************************** TString stringname(name); const COMET::IGeomModuleBase* module = NULL; for (std::vector::const_iterator m = fModules.begin(); m != fModules.end(); ++m){ TString modpath((*m)->GetPath().c_str()); if ( modpath.Sizeof() >= stringname.Sizeof() && modpath.Contains(stringname)) module = *m; else if (modpath.Sizeof() < stringname.Sizeof() && stringname.Contains(modpath)) module = *m; } if (!module) throw COMET::ENoSuchModule(); return *module; } //**************************************************************** const COMET::IGeomModuleBase& COMET::IGeomBase::GetModule(COMET::IHandle hit) const { //**************************************************************** TVector3 hpos = hit->GetPosition(); TString stringname = COMET::IOADatabase::Get().GeomId().FullNodePath(hpos); const COMET::IGeomModuleBase* module = NULL; for (std::vector::const_iterator m = fModules.begin(); m != fModules.end(); ++m){ TString modpath((*m)->GetPath().c_str()); if ( modpath.Sizeof() >= stringname.Sizeof() && modpath.Contains(stringname)) module = *m; else if (modpath.Sizeof() < stringname.Sizeof() && stringname.Contains(modpath)) module = *m; } if (!module) throw COMET::ENoSuchModule(); return *module; } //**************************************************************** const COMET::IGeomModuleBase& COMET::IGeomBase::GetModule(TVector3 hpos) const { //**************************************************************** TString stringname = COMET::IOADatabase::Get().GeomId().FullNodePath(hpos); const COMET::IGeomModuleBase* module =NULL; for (std::vector::const_iterator m = fModules.begin(); m != fModules.end(); ++m){ TString modpath((*m)->GetPath().c_str()); if ( modpath.Sizeof() >= stringname.Sizeof() && modpath.Contains(stringname)) module = *m; else if (modpath.Sizeof() < stringname.Sizeof() && stringname.Contains(modpath)) module = *m; } if (!module) throw COMET::ENoSuchModule(); return *module; } //**************************************************************** void COMET::IGeomBase::Fill() { //**************************************************************** COMETError("Fill() method has not been implemented!!!"); return; } //**************************************************************** void COMET::IGeomBase::Clear() { //**************************************************************** COMETError("Clear() method has not been implemented!!!"); return; }