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.2 2006/07/14 12:23:32 martius 00025 * selforg becomes HEAD 00026 * 00027 * Revision 1.1.2.9 2006/07/14 11:36:32 martius 00028 * revert to older revision of robot3 00029 * 00030 * Revision 1.1.2.8 2006/07/13 12:11:26 robot5 00031 * Using overhauled primitives Plane and Box. 00032 * Repeat texturing is supported by them now. 00033 * 00034 * Revision 1.1.2.7 2006/06/29 16:39:55 robot3 00035 * -you can now see bounding shapes if you type ./start -drawboundings 00036 * -includes cleared up 00037 * -abstractobstacle and abstractground have now .cpp-files 00038 * 00039 * Revision 1.1.2.6 2006/06/26 08:25:03 robot3 00040 * fixed ground texture bug 00041 * 00042 * Revision 1.1.2.5 2006/06/22 12:25:45 der 00043 * added setGroundTexture and setGroundColor 00044 * 00045 * Revision 1.1.2.4 2006/06/16 22:27:26 martius 00046 * getMainPrimtive 00047 * 00048 * Revision 1.1.2.3 2006/05/23 14:13:41 der 00049 * fixed initialization bug 00050 * 00051 * Revision 1.1.2.2 2006/05/23 13:37:45 robot3 00052 * -fixed some creating bugs 00053 * -setColor,setTexture and createGround must be 00054 * called before setPosition now 00055 * 00056 * Revision 1.1.2.1 2006/05/19 08:41:27 robot3 00057 * Class AbstractGround contains now basic routines like 00058 * creating the groundPlane, setPose and so on 00059 * 00060 * * 00061 * * 00062 ***************************************************************************/ 00063 #ifndef __ABSTRACTGROUND_H 00064 #define __ABSTRACTGROUND_H 00065 00066 #include <vector> 00067 #include "abstractobstacle.h" 00068 00069 namespace lpzrobots { 00070 00071 class Primitive; 00072 00073 // abstract class for any playground 00074 class AbstractGround : public AbstractObstacle { 00075 00076 public: 00077 00078 AbstractGround(const OdeHandle& odeHandle, const OsgHandle& osgHandle, bool createGround=true); 00079 00080 virtual ~AbstractGround(); 00081 00082 virtual void update(); 00083 00084 00085 virtual void setPose(const osg::Matrix& pose); 00086 00087 virtual void createGround(bool create); 00088 00089 /** 00090 * sets the obstacle color 00091 * @param color values in RGBA 00092 */ 00093 virtual void setColor(const Color& color); 00094 00095 00096 virtual void setTexture(const std::string& filename); 00097 00098 virtual Primitive* getMainPrimitive() const; 00099 00100 virtual void setGroundTexture(const std::string& filename); 00101 00102 /** 00103 * sets the ground color 00104 * should be called before setPosition() 00105 * @param color values in RGBA 00106 */ 00107 virtual void setGroundColor(const Color& color); 00108 00109 protected: 00110 00111 std::vector<Primitive*> obst; //obstacles 00112 Primitive* groundPlane; // the groundplane 00113 bool creategroundPlane; 00114 double ground_length; 00115 std::string wallTextureFileName; 00116 Color groundColor; 00117 std::string groundTextureFileName; 00118 00119 virtual void recreate(); 00120 00121 virtual void create()=0; 00122 00123 virtual void createGround(); 00124 00125 virtual void destroy(); 00126 00127 }; 00128 00129 } 00130 00131 #endif
1.4.7