abstractground.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * frankguettler@gmx.de * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the * 00020 * Free Software Foundation, Inc., * 00021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00022 * * 00023 * $Log: abstractground.h,v $ 00024 * Revision 1.3 2006/08/11 15:41:04 martius 00025 * playgrounds handle non-quadratic ground planes 00026 * 00027 * Revision 1.2 2006/07/14 12:23:32 martius 00028 * selforg becomes HEAD 00029 * 00030 * Revision 1.1.2.9 2006/07/14 11:36:32 martius 00031 * revert to older revision of robot3 00032 * 00033 * Revision 1.1.2.8 2006/07/13 12:11:26 robot5 00034 * Using overhauled primitives Plane and Box. 00035 * Repeat texturing is supported by them now. 00036 * 00037 * Revision 1.1.2.7 2006/06/29 16:39:55 robot3 00038 * -you can now see bounding shapes if you type ./start -drawboundings 00039 * -includes cleared up 00040 * -abstractobstacle and abstractground have now .cpp-files 00041 * 00042 * Revision 1.1.2.6 2006/06/26 08:25:03 robot3 00043 * fixed ground texture bug 00044 * 00045 * Revision 1.1.2.5 2006/06/22 12:25:45 der 00046 * added setGroundTexture and setGroundColor 00047 * 00048 * Revision 1.1.2.4 2006/06/16 22:27:26 martius 00049 * getMainPrimtive 00050 * 00051 * Revision 1.1.2.3 2006/05/23 14:13:41 der 00052 * fixed initialization bug 00053 * 00054 * Revision 1.1.2.2 2006/05/23 13:37:45 robot3 00055 * -fixed some creating bugs 00056 * -setColor,setTexture and createGround must be 00057 * called before setPosition now 00058 * 00059 * Revision 1.1.2.1 2006/05/19 08:41:27 robot3 00060 * Class AbstractGround contains now basic routines like 00061 * creating the groundPlane, setPose and so on 00062 * 00063 * * 00064 * * 00065 ***************************************************************************/ 00066 #ifndef __ABSTRACTGROUND_H 00067 #define __ABSTRACTGROUND_H 00068 00069 #include <vector> 00070 #include "abstractobstacle.h" 00071 00072 namespace lpzrobots { 00073 00074 class Primitive; 00075 00076 // abstract class for any playground 00077 class AbstractGround : public AbstractObstacle { 00078 00079 public: 00080 00081 AbstractGround(const OdeHandle& odeHandle, const OsgHandle& osgHandle, 00082 bool createGround, double groundLength, double groundWidth); 00083 00084 virtual ~AbstractGround(); 00085 00086 virtual void update(); 00087 00088 00089 virtual void setPose(const osg::Matrix& pose); 00090 00091 virtual void createGround(bool create); 00092 00093 /** 00094 * sets the obstacle color 00095 * @param color values in RGBA 00096 */ 00097 virtual void setColor(const Color& color); 00098 00099 00100 virtual void setTexture(const std::string& filename); 00101 00102 virtual Primitive* getMainPrimitive() const; 00103 00104 virtual void setGroundTexture(const std::string& filename); 00105 00106 /** 00107 * sets the ground color 00108 * should be called before setPosition() 00109 * @param color values in RGBA 00110 */ 00111 virtual void setGroundColor(const Color& color); 00112 00113 protected: 00114 00115 std::vector<Primitive*> obst; //obstacles 00116 Primitive* groundPlane; // the groundplane 00117 bool creategroundPlane; 00118 double groundLength; 00119 double groundWidth; 00120 std::string wallTextureFileName; 00121 Color groundColor; 00122 std::string groundTextureFileName; 00123 00124 virtual void recreate(); 00125 00126 virtual void create()=0; 00127 00128 virtual void createGround(); 00129 00130 virtual void destroy(); 00131 00132 }; 00133 00134 } 00135 00136 #endif

Generated on Tue Jan 16 02:14:34 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8