Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
abstractground.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef __ABSTRACTGROUND_H
25 #define __ABSTRACTGROUND_H
26 
27 #include <list>
28 #include "abstractobstacle.h"
29 #include <selforg/position.h>
30 
31 namespace lpzrobots {
32 
33  class Primitive;
34 
35  // abstract class for any playground
37 
38 public:
39 
41  bool createGround, double groundLength, double groundWidth, double wallThickness);
42 
43  virtual ~AbstractGround();
44 
45 
46  virtual void setPose(const osg::Matrix& pose);
47 
48  virtual void createGround(bool create);
49 
50  virtual Primitive* getMainPrimitive() const;
51 
52  virtual void changeGeometry(double length, double width, double height, double factorxy);
53 
54  /// prints the contour of the boxes into the file
55  virtual void printContours(FILE* f);
56 
57  /**
58  * assigns the texture to the object
59  */
60  virtual void setGroundTexture(const std::string& filename);
61 
62  /**
63  * sets the ground color
64  * should be called before setPosition()
65  * @param color values in RGBA
66  */
67  virtual void setGroundColor(const Color& color);
68 
69  /**
70  * sets the substance of the ground.
71  * @param substance description of the substance
72  */
73  virtual void setGroundSubstance(const Substance& substance);
74 
75 
76  /**
77  * returns the corner points of the groundplane
78  * @return list of the cornerpoints
79  */
80  virtual std::list<Position> getCornerPointsXY();
81 
82  /// size in x dimension
83  virtual double getGroundLength(){ return groundLength; }
84  /// size in y dimension
85  virtual double getGroundWidth(){ return groundWidth; }
86 
87  virtual double getGroundThickness(){ return groundThickness; }
88 
89  virtual void setGroundThickness(double thickness);
90 
91  protected:
92 
93  Primitive* groundPlane; // the groundplane
95  double groundLength;
96  double groundWidth;
97  double wallThickness;
102 
103  virtual void createGround();
104 
105  };
106 
107 }
108 
109 #endif
virtual void setGroundTexture(const std::string &filename)
assigns the texture to the object
Definition: abstractground.cpp:84
Data structure for accessing the ODE.
Definition: odehandle.h:44
OsgHandle osgHandle
Definition: abstractobstacle.h:174
Physical substance definition, used for collision detection/treatment What we need is mu...
Definition: substance.h:103
virtual ~AbstractGround()
Definition: abstractground.cpp:51
std::string groundTextureFileName
Definition: abstractground.h:101
Abstract class (interface) for obstacles.
Definition: abstractobstacle.h:46
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual void setGroundThickness(double thickness)
Definition: abstractground.cpp:118
Substance groundSubstance
Definition: abstractground.h:99
OdeHandle odeHandle
Definition: abstractobstacle.h:173
virtual double getGroundWidth()
size in y dimension
Definition: abstractground.h:85
virtual void create()=0
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
virtual void createGround()
Definition: abstractground.cpp:123
virtual void changeGeometry(double length, double width, double height, double factorxy)
Definition: abstractground.cpp:73
virtual void setPose(const osg::Matrix &pose)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: abstractground.cpp:55
double groundLength
Definition: abstractground.h:95
double groundWidth
Definition: abstractground.h:96
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
Definition: color.h:32
virtual void setGroundSubstance(const Substance &substance)
sets the substance of the ground.
Definition: abstractground.cpp:111
virtual void setGroundColor(const Color &color)
sets the ground color should be called before setPosition()
Definition: abstractground.cpp:100
osg::Matrix pose
Definition: abstractobstacle.h:170
virtual double getGroundLength()
size in x dimension
Definition: abstractground.h:83
virtual Primitive * getMainPrimitive() const
return the "main" primitive of the obtactle. The meaning of "main" is arbitrary
Definition: abstractground.cpp:78
bool creategroundPlane
Definition: abstractground.h:94
AbstractGround(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool createGround, double groundLength, double groundWidth, double wallThickness)
Definition: abstractground.cpp:36
virtual void printContours(FILE *f)
prints the contour of the boxes into the file
Definition: abstractground.cpp:160
virtual std::list< Position > getCornerPointsXY()
returns the corner points of the groundplane
Definition: abstractground.cpp:171
Color groundColor
Definition: abstractground.h:100
Definition: abstractground.h:36
double groundThickness
Definition: abstractground.h:98
double wallThickness
Definition: abstractground.h:97
virtual double getGroundThickness()
Definition: abstractground.h:87
Primitive * groundPlane
Definition: abstractground.h:93