#ifndef TGeomIdFinder_hxx_seen #define TGeomIdFinder_hxx_seen #include #include #include "EoaCore.hxx" #include "IGeomIdManager.hxx" namespace COMET { /// An exception thrown by a IGeomIdFinder when it doesn't want to follow /// a particular branch of the geometry. OA_EXCEPTION(EGeomIdStop,EoaCore); class IGeomIdFinder; } /// Find the TGeoNode associated with a geometry id. class COMET::IGeomIdFinder { public: IGeomIdFinder() {} virtual ~IGeomIdFinder() {} /// Check to see if the current root node corresponds to a known /// IGeometryId. If it does, then add the node to the fGeoNodeMap. This /// can throw an EGeomIdStop exception to prevent searching any deeper in /// the geometry. virtual bool Search(const std::vector& names, IGeometryId& id) { return false; } protected: /// Get module number (N) from node string like XXXXX_N_0. /// @return the number, but -1 when the given name is not proper. int ModuleNo(const std::string& name); /// Get module number (N) from node string like XXXXX_N_0. /// The node string is specified by 'position' of the given string vector 'names' /// @return the number, but -1 when the given name is not proper /// or position is out of range. int ModuleNo(const std::vector& names, unsigned int position); /// Combine strings in node name vector (for debugging). std::string GetFullNodePath(const std::vector& names); }; // End of class IGeomIdFinder #endif