PointOfInterest.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  PointOfInterest.h
00003  *
00004  *  (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de>
00005  *           Universitaet Koblenz-Landau
00006  *
00007  *  Additional information:
00008  *  $Id: PointOfInterest.h 46293 2011-09-07 11:04:31Z cnluzon $
00009  **************************************************************************/
00010 
00011 #ifndef POINTOFINTEREST_H
00012 #define POINTOFINTEREST_H
00013 
00014 #include <string>
00015 #include <map>
00016 
00017 #include "Workers/Math/Pose.h"
00018 //#include "Architecture/Serializer/ExtendedOutStream.h" TODO kann wahrscheinlich weg
00019 //#include "Architecture/Serializer/ExtendedInStream.h"
00020 
00021 
00022 typedef std::map< std::string, std::string > StringMapT;
00023 typedef std::map< std::string, float > FloatMapT;
00024 typedef std::map< std::string, int > IntMapT;
00025 
00039 class PointOfInterest: public Pose
00040 {
00041 
00042   public:
00043 
00044     enum PoiType {  DEFAULT           =100,
00045                     VICTIM            =200,
00046                     OBJECT            =300,
00047                     GRIPPABLE_OBJECT  =400,
00048                     PERSON            =600,
00049                     ROOMBA            =700,
00050                     HAZARD_MATERIAL   =800,
00051                     START_POSITION    =900,
00052                     START_ORIENTATION =1000
00053                };
00054 
00055     PointOfInterest( );
00056 
00068     PointOfInterest ( int id, std::string name, PoiType type, float posX, float posY, std::string remarks,
00069                       StringMapT stringMap=StringMapT(), FloatMapT floatMap=FloatMapT() ,
00070                       IntMapT intMap=IntMapT() )
00071         : Pose ( posX, posY, 0.0f )
00072     {
00073       init ( id, name, type , remarks, stringMap, floatMap, intMap );
00074     }
00075 
00084     PointOfInterest ( int id, std::string name, PoiType type, float posX, float posY, float theta, std::string remarks,
00085                       StringMapT stringMap=StringMapT(), FloatMapT floatMap=FloatMapT(), IntMapT intMap=IntMapT() )
00086         : Pose ( posX, posY, theta )
00087     {
00088       init ( id, name, type , remarks, stringMap, floatMap, intMap );
00089     }
00090 
00092     PointOfInterest ( std::string name, PoiType type, float posX, float posY , std::string remarks )
00093         : Pose ( posX, posY, 0.0f )
00094     {
00095       init ( -1, name, type , remarks, StringMapT(), FloatMapT(), IntMapT() );
00096     }
00097 
00099     PointOfInterest ( std::string name, PoiType type, float posX, float posY , float theta, std::string remarks )
00100         : Pose ( posX, posY, theta )
00101     {
00102       init ( -1, name, type , remarks, StringMapT(), FloatMapT(), IntMapT() );
00103     }
00104 
00106     PointOfInterest ( int id, const PointOfInterest* poi );
00107 
00109     virtual ~PointOfInterest() {}
00110 
00115     bool hasName ( std::string name ) const;
00116 
00121     bool hasInName ( std::string part ) const;
00122 
00123     // SETTER FUNCTIONS /////////////////////////////
00124 
00126     void setRemarks ( std::string remarks ) { m_Remarks = remarks; }
00127 
00128     void setName ( std::string name ) { m_Name = name; }
00129 
00131     void addString ( std::string key, std::string data ) { m_StringMap.insert ( std::pair< std::string, std::string > ( key, data ) ); }
00132 
00134     void addFloat ( std::string key, float data ) { m_FloatMap.insert ( std::pair< std::string, float > ( key, data ) ); }
00135 
00137     void addInt ( std::string key, int data ) { m_IntMap.insert ( std::pair< std::string, int > ( key, data ) ); }
00138 
00139     // GETTER FUNCTIONS //////////////////////
00140 
00142     int getId() const { return m_Id; }
00143 
00145     std::string getName() const { return m_Name; }
00146 
00148     PoiType getType() const { return m_Type; }
00149 
00151     std::string getRemarks() const { return m_Remarks; }
00152 
00154     std::string getString ( std::string key ) const { return m_StringMap.find ( key )->second; }
00155 
00157     float getFloat ( std::string key ) const { return m_FloatMap.find ( key )->second; }
00158 
00160     int getInt ( std::string key ) const { return m_IntMap.find ( key )->second; }
00161 
00163     std::map<std::string, std::string> getStringMap() const { return m_StringMap; }
00164 
00166     std::map<std::string, float> getFloatMap() const { return m_FloatMap; }
00167 
00169     std::map<std::string, int> getIntMap() const { return m_IntMap; }
00170 
00171 //    // (DE)SERIALIZATION ///////////////////////////////////
00172 //    void storer ( ExtendedOutStream& ) const ;
00173 //    PointOfInterest ( ExtendedInStream& );
00174 
00176     void printOn ( std::ostream& strm ) const;
00177 
00178   private:
00179 
00180     void init ( int id, std::string name, PoiType type, std::string remarks, StringMapT stringMap, FloatMapT floatMap, IntMapT intMap );
00181 
00182     int m_Id;
00183     std::string m_Name;
00184     PoiType m_Type;
00185     std::string m_Remarks;
00186 
00187     StringMapT m_StringMap;
00188     IntMapT m_IntMap;
00189     FloatMapT m_FloatMap;
00190 
00191 };
00192 
00193 #endif


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43