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.11  2009/04/02 10:12:25  martius
00025  *   Texture handling changed
00026  *
00027  *   Revision 1.10  2008/04/17 15:59:00  martius
00028  *   OSG2 port finished
00029  *
00030  *   Revision 1.9.2.1  2008/04/15 16:21:52  martius
00031  *   Profiling
00032  *   Multithreading also for OSG and ODE but disables because of instabilities
00033  *
00034  *   Revision 1.9  2007/12/06 10:02:49  der
00035  *   abstractground: returns now cornerpoints
00036  *   abstractobstacle: is now trackable
00037  *   hudstatistics: supports now AbstractmMeasure
00038  *
00039  *   Revision 1.8  2007/09/06 18:46:41  martius
00040  *   printContours
00041  *
00042  *   Revision 1.7  2007/08/24 11:53:10  martius
00043  *   Change geometry
00044  *
00045  *   Revision 1.6  2007/07/03 13:06:41  martius
00046  *   groundplane thick
00047  *
00048  *   Revision 1.5  2007/04/05 15:10:14  martius
00049  *   extra ground substance
00050  *
00051  *   Revision 1.4  2007/03/16 11:01:37  martius
00052  *   abstractobstacle gets mor functionallity
00053  *   setSubstance
00054  *
00055  *   Revision 1.3  2006/08/11 15:41:04  martius
00056  *   playgrounds handle non-quadratic ground planes
00057  *
00058  *   Revision 1.2  2006/07/14 12:23:32  martius
00059  *   selforg becomes HEAD
00060  *
00061  *   Revision 1.1.2.9  2006/07/14 11:36:32  martius
00062  *   revert to older revision of robot3
00063  *
00064  *   Revision 1.1.2.8  2006/07/13 12:11:26  robot5
00065  *   Using overhauled primitives Plane and Box.
00066  *   Repeat texturing is supported by them now.
00067  *
00068  *   Revision 1.1.2.7  2006/06/29 16:39:55  robot3
00069  *   -you can now see bounding shapes if you type ./start -drawboundings
00070  *   -includes cleared up
00071  *   -abstractobstacle and abstractground have now .cpp-files
00072  *
00073  *   Revision 1.1.2.6  2006/06/26 08:25:03  robot3
00074  *   fixed ground texture bug
00075  *
00076  *   Revision 1.1.2.5  2006/06/22 12:25:45  der
00077  *   added setGroundTexture and setGroundColor
00078  *
00079  *   Revision 1.1.2.4  2006/06/16 22:27:26  martius
00080  *   getMainPrimtive
00081  *
00082  *   Revision 1.1.2.3  2006/05/23 14:13:41  der
00083  *   fixed initialization bug
00084  *
00085  *   Revision 1.1.2.2  2006/05/23 13:37:45  robot3
00086  *   -fixed some creating bugs
00087  *   -setColor,setTexture and createGround must be
00088  *    called before setPosition now
00089  *
00090  *   Revision 1.1.2.1  2006/05/19 08:41:27  robot3
00091  *   Class AbstractGround contains now basic routines like
00092  *   creating the groundPlane, setPose and so on
00093  *
00094  *                                                                         *
00095  *                                                                         *
00096  ***************************************************************************/
00097 #ifndef __ABSTRACTGROUND_H
00098 #define __ABSTRACTGROUND_H
00099 
00100 #include <list>
00101 #include "abstractobstacle.h"
00102 #include <selforg/position.h>
00103 
00104 namespace lpzrobots {
00105 
00106   class Primitive; 
00107 
00108   // abstract class for any playground
00109   class AbstractGround : public AbstractObstacle {
00110 
00111 public:
00112 
00113     AbstractGround(const OdeHandle& odeHandle, const OsgHandle& osgHandle, 
00114                    bool createGround, double groundLength, double groundWidth, double wallThickness);
00115 
00116     virtual ~AbstractGround();
00117 
00118 
00119     virtual void setPose(const osg::Matrix& pose);
00120 
00121     virtual void createGround(bool create);
00122 
00123     /// sets texture of walls. Attention, repeats are so far ignored
00124     virtual void setTexture(const std::string& filename, double repeatOnX=1, double repeatOnY=1);
00125 
00126     virtual Primitive* getMainPrimitive() const;
00127 
00128     virtual void changeGeometry(double length, double width, double height, double factorxy);
00129     
00130     /// prints the contour of the boxes into the file
00131     virtual void printContours(FILE* f);
00132 
00133     /**
00134      * assigns the texture to the object
00135      */
00136     virtual void setGroundTexture(const std::string& filename);
00137 
00138     /**
00139      * sets the ground color
00140      * should be called before setPosition()
00141      * @param color values in RGBA
00142      */
00143     virtual void setGroundColor(const Color& color);
00144 
00145     /**
00146      * sets the substance of the ground. 
00147      * @param substance description of the substance
00148      */
00149     virtual void setGroundSubstance(const Substance& substance);
00150     
00151     
00152     /**
00153      * returns the corner points of the groundplane
00154      * @return list of the cornerpoints
00155      */
00156     virtual std::list<Position> getCornerPointsXY();
00157 
00158 
00159 
00160   protected:
00161 
00162     Primitive* groundPlane; // the groundplane
00163     bool creategroundPlane;
00164     double groundLength;
00165     double groundWidth;
00166     double wallThickness;
00167     std::string wallTextureFileName;
00168     Color groundColor;
00169     std::string groundTextureFileName;
00170 
00171     virtual void createGround();
00172 
00173   };
00174 
00175 }
00176 
00177 #endif

Generated on Fri Oct 30 16:29:01 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7