00001 /* Copyright (C) 2002 Jonathan Bisson (jb8@hermes.usherb.ca) 00002 00003 This library is free software; you can redistribute it and/or 00004 modify it under the terms of the GNU Lesser General Public 00005 License as published by the Free Software Foundation; either 00006 version 2.1 of the License, or (at your option) any later version. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Lesser General Public License for more details. 00012 00013 You should have received a copy of the GNU Lesser General Public 00014 License along with this library; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 */ 00017 #ifndef _DIRECTLIST_H_ 00018 #define _DIRECTLIST_H_ 00019 00020 #include "Object.h" 00021 #include <string> 00022 #include <list> 00023 00024 00025 namespace RobotFlow { 00026 00027 #define NONE 0 00028 #define XYH 1 00029 #define DIST 2 00030 #define ROT 3 00031 00032 class DirectCommand : public FD::Object { 00033 00034 public: 00035 00036 DirectCommand(); 00037 DirectCommand(const DirectCommand& cpy); 00038 DirectCommand &operator =(const DirectCommand &eq); 00039 DirectCommand(int type, float setX, float setY, float setH); // XYH command 00040 DirectCommand(int type, float command); //dist and rot command 00041 00042 virtual ~DirectCommand(); 00043 00044 virtual void printOn(std::ostream &out=std::cout) const; 00045 00046 float x; 00047 float y; 00048 float h; 00049 float dist; 00050 float rot; 00051 00052 int commandType; 00053 00054 protected: 00055 00056 private: 00057 00058 }; 00059 00060 00061 class DirectList : public FD::Object { 00062 00063 public: 00064 00065 DirectList(); 00066 DirectList(const DirectList& cpy); 00067 DirectList &operator =(const DirectList &eq); 00068 00069 virtual ~DirectList(); 00070 virtual void printOn(std::ostream &out=std::cout) const; 00071 00072 bool listIsEmpty(); 00073 void next(); 00074 void emptyList(); 00075 00076 void putCommand(int type, float setX, float setY, float setH); //XHY command 00077 void putCommand(int type, float command); //dist and rot command 00078 00079 int getCommandType(); 00080 float getCommandX(); 00081 float getCommandY(); 00082 float getCommandH(); 00083 float getCommandDist(); 00084 float getCommandRot(); 00085 00086 protected: 00087 00088 private: 00089 std::list<DirectCommand> commandList; 00090 00091 }; 00092 00093 }//namespace RobotFlow 00094 00095 #endif