Robotsystem from Robot Group Leipzig: compatsim.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# compatsim.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  *                                                                         *
    00007  *   This program is free software; you can redistribute it and/or modify  *
    00008  *   it under the terms of the GNU General Public License as published by  *
    00009  *   the Free Software Foundation; either version 2 of the License, or     *
    00010  *   (at your option) any later version.                                   *
    00011  *                                                                         *
    00012  *   This program is distributed in the hope that it will be useful,       *
    00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
    00015  *   GNU General Public License for more details.                          *
    00016  *                                                                         *
    00017  *   You should have received a copy of the GNU General Public License     *
    00018  *   along with this program; if not, write to the                         *
    00019  *   Free Software Foundation, Inc.,                                       *
    00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
    00021  ***************************************************************************
    00022  *                                                                         *
    00023  *  compatsim is provided for compatibility to the old simulation          *
    00024  *                                                                         *
    00025  *   $Log: compatsim.h,v $
    00026  *   Revision 1.1.2.3  2006/03/30 12:34:47  martius
    00027  *   documentation updated
    00028  *
    00029  *   Revision 1.1.2.2  2005/12/15 17:02:04  martius
    00030  *   light is in sky and standart cams removed
    00031  *   config has a default implentation now
    00032  *
    00033  *   Revision 1.1.2.1  2005/12/06 10:13:23  martius
    00034  *   openscenegraph integration started
    00035  *
    00036  *                                                                 *
    00037  ***************************************************************************/
    00038 #ifndef __COMPATSIM_H
    00039 #define __COMPATSIM_H
    00040
    00041 #include "simulation.h"
    00042
    00043 namespace lpzrobots {
    00044
    00045 class CompatSim : public Simulation {
    00046 public:
    00047
    00048   CompatSim(void (*startFun)(const OdeHandle&, const OsgHandle&, GlobalData& globalData),
    00049             void (*endFun)(GlobalData& globalData),
    00050             void (*configFun)(GlobalData& globalData) = 0,
    00051             void (*commandFun)(const OdeHandle&, const OsgHandle&, GlobalData& globalData, int key) = 0,
    00052             void (*collCallbackFun)(const OdeHandle&, void* data, dGeomID o1, dGeomID o2) = 0,
    00053             void (*addCallbackFun)(GlobalData& globalData, bool draw, bool pause) = 0);
    00054   virtual ~CompatSim();
    00055
    00056   // the following function have to be overloaded.
    00057   virtual void start(const OdeHandle&, const OsgHandle&, GlobalData& globalData);
    00058   virtual void end(GlobalData& globalData);
    00059   virtual void config(GlobalData& globalData);
    00060   // the following functions have dummy default implementations
    00061   virtual void command(const OdeHandle&, const OsgHandle&, GlobalData& globalData, int key);
    00062   /** @return true if collision is treated, false otherwise */
    00063   virtual bool collCallback(const OdeHandle&, void* data, dGeomID o1, dGeomID o2);
    00064   virtual void addCallback(GlobalData& globalData, bool draw, bool pause);
    00065
    00066 protected:
    00067   void (*startFun)(const OdeHandle& odeHandle, const OsgHandle&, GlobalData& globalData);
    00068   void (*endFun)(GlobalData& globalData);
    00069   void (*configFun)(GlobalData& globalData);
    00070   void (*commandFun)(const OdeHandle&, const OsgHandle&, GlobalData& globalData, int key);
    00071   void (*collCallbackFun)(const OdeHandle&, void* data, dGeomID o1, dGeomID o2);
    00072   void (*addCallbackFun)(GlobalData& globalData, bool draw, bool pause);
    00073
    00074 };
    00075 }
    00076
    00077 #endif