PointOfInterest.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  PointOfInterest.cpp
00003  *
00004  *  (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de>
00005  *           Universitaet Koblenz-Landau
00006  *
00007  *  Additional information:
00008  *  $Id: PointOfInterest.cpp 44313 2011-04-06 22:46:28Z agas $
00009  **************************************************************************/
00010 
00011 #include <algorithm>
00012 #include "PointOfInterest.h"
00013 
00014 #define THIS PointOfInterest
00015 
00016 void THIS::init ( int id, std::string name, PoiType type, std::string remarks, std::map< std::string, std::string > stringMap,
00017                   std::map< std::string, float > floatMap, std::map< std::string, int > intMap ) {
00018   m_Id = id;
00019   m_Name = name;
00020   m_Type = type;
00021   m_Remarks = remarks;
00022   m_StringMap = stringMap;
00023   m_FloatMap = floatMap;
00024   m_IntMap = intMap;
00025 }
00026 
00027 THIS::THIS( ): Pose(0, 0, 0)
00028 {
00029     init( -1 , "empty", DEFAULT, "", std::map< std::string, std::string >(), std::map< std::string, float >(), std::map< std::string, int >() );
00030 }
00031 
00032 THIS::THIS( int id, const PointOfInterest* poi ): Pose(poi->x(), poi->y(), poi->theta())
00033 {
00034   if (poi) {
00035     init(id, poi->m_Name, poi->m_Type, poi->m_Remarks, poi->m_StringMap, poi->m_FloatMap, poi->m_IntMap);
00036   } else {
00037     // TRACE_ERROR("Copy constructor called with 0-pointer as argument"); // TODO use ROS
00038     init(-1, "",DEFAULT,"",StringMapT(),FloatMapT(),IntMapT());
00039   }
00040 }
00041 
00042 bool THIS::hasName( std::string name ) const
00043 {
00044   // transform both name strings to upper case
00045   std::string poiName = m_Name;
00046   transform( poiName.begin(), poiName.end(), poiName.begin(), ( int ( * ) ( int ) )toupper );
00047   transform( name.begin(), name.end(), name.begin(), ( int ( * ) ( int ) )toupper );
00048 
00049   return ( poiName.compare( name ) == 0 );
00050 }
00051 
00052 bool THIS::hasInName( std::string part ) const
00053 {
00054   // transform both strings to upper case
00055   std::string poiName = m_Name;
00056   transform( poiName.begin(), poiName.end(), poiName.begin(), ( int ( * ) ( int ) )toupper );
00057   transform( part.begin(), part.end(), part.begin(), ( int ( * ) ( int ) )toupper );
00058 
00059   return ( ( int )poiName.find( part ) != -1 );
00060 }
00061 
00062 //void THIS::storer( ExtendedOutStream& extStrm ) const
00063 //{
00064 //  extStrm << m_Id;
00065 //  extStrm << m_Name;
00066 //  extStrm << m_Type;
00067 //  extStrm << m_Remarks;
00068 //  extStrm << m_StringMap;
00069 //  extStrm << m_FloatMap;
00070 //  extStrm << m_IntMap;
00071 //  extStrm << m_X;
00072 //  extStrm << m_Y;
00073 //  extStrm << m_Theta;
00074 //}
00075 
00076 
00077 //THIS::THIS( ExtendedInStream& extStrm )
00078 //{
00079 //  extStrm >> m_Id;
00080 //  extStrm >> m_Name;
00081 //  extStrm >> m_Type;
00082 //  extStrm >> m_Remarks;
00083 //  extStrm >> m_StringMap;
00084 //  extStrm >> m_FloatMap;
00085 //  extStrm >> m_IntMap;
00086 //  extStrm >> m_X;
00087 //  extStrm >> m_Y;
00088 //  extStrm >> m_Theta;
00089 //}
00090 
00091 void THIS::printOn( std::ostream& strm ) const
00092 {
00093   strm << m_Id << ", ";
00094   strm << m_Name << ", ";
00095   strm << m_Type << ", ";
00096   strm << m_Remarks << ",";
00097   strm << "(" << m_X << "," << m_Y<< "," << m_Theta << ")";
00098 }
00099 
00100 #undef THIS


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