Base_LogicB.h

Go to the documentation of this file.
00001 //     Authors:
00002 // Anselmo Cervera, Juan J. Gomez-Cadenas and Jose Angel Hernando
00003 
00004 #ifndef LogicB_h
00005 #define LogicB_h 1
00006 
00007 #include "Kalman/Interface_ILogic.h"
00008 
00009 
00010 //! Class to perform a Logic
00011 class LogicB: public ILogic
00012 {
00013  public:
00014 
00015   //! default constructor
00016   LogicB(){}
00017   
00018   //! default destructor
00019   virtual ~LogicB();
00020 
00021   //---------- SET AND GET METHODS ---------------------------
00022 
00023 
00024   //!  The name 
00025   virtual void setName(std::string name) {m_name = name;}
00026   //!   Return the name
00027   virtual std::string name() const {return m_name;}
00028 
00029   //! get the next logicalObject
00030   virtual std::string nextLogicalObjectName(std::string thisVolume, bool prevIntersected, int sens) ;
00031 
00032 
00033   //----------- LOGICAL OBJECTS -------------------------------
00034 
00035    //! returns the logicalObject Map
00036   virtual const std::map<std::string, LogicalObjectB*>& logicalObjectMap() const {return m_logicalObjectMap;}
00037 
00038   //! Check if the logicalObject has been defined 
00039   virtual bool logicalObjectExists(std::string name) const{
00040     if (m_logicalObjectMap.count(name) != 0) return true;
00041     else return false;
00042   } 
00043 
00044   //! Check if the logicalObject has been defined 
00045   virtual bool logicalObjectExists(int i, int j) const;
00046 
00047   //! gives the logicalObject associated to the (i,j) logicalObject
00048   virtual const LogicalObjectB& logicalObject(int i, int j) const;
00049 
00050   //! gives the LogicalObject provided the name
00051   virtual const LogicalObjectB& logicalObject(std::string objectName)  
00052     {return *m_logicalObjectMap[objectName];}
00053 
00054   //! add a LogicalObject to the logical sequence 
00055   virtual void addLogicalObject(std::string objectName, std::string type, int i, int j, 
00056              std::string inter, std::string noInter)
00057     {m_logicalObjectMap[objectName] = new  LogicalObjectB(objectName, type, i,j,inter,noInter);}
00058 
00059   
00060   //! returns the last object in the logic
00061   virtual const LogicalObjectB& lastObjectInLogic();
00062 
00063   //! returns the name of the first object of type volume 
00064   virtual std::string firstVolume() const; 
00065     
00066   //------------ GENERAL ---------------------------------------
00067 
00068   //! dumps information
00069   virtual void info(int verb) const;
00070 
00071  protected:
00072 
00073   std::string m_name;
00074  
00075   std::map<std::string, LogicalObjectB*> m_logicalObjectMap;
00076 
00077 };
00078 #endif
00079 
00080 

Generated on Mon Nov 23 08:01:43 2009 for MIPP(E907) by  doxygen 1.4.7