Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

GDynamicGeneratorAgent.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003 - 2004 Martin Reinsprecht                          *
00003  *   rema10@hyperbox.org                                                   *
00004  *   Copyright (C) 2004 by Raphael Langerhorst                             *
00005  *   raphael-langerhorst@gmx.at                                            *
00006  *                                                                         *
00007  *   Permission is hereby granted, free of charge, to any person obtaining *
00008  *   a copy of this software and associated documentation files (the       *
00009  *   "Software"), to deal in the Software without restriction, including   *
00010  *   without limitation the rights to use, copy, modify, merge, publish,   *
00011  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00012  *   permit persons to whom the Software is furnished to do so, subject to *
00013  *   the following conditions:                                             *
00014  *                                                                         *
00015  *   The above copyright notice and this permission notice shall be        *
00016  *   included in all copies or substantial portions of the Software.       *
00017  *                                                                         *
00018  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00019  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00020  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00021  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00022  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00023  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00024  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
00025  ***************************************************************************/
00026 
00027 #ifndef GBEGDYNAMICGENERATORAGENTH
00028 #define GBEGDYNAMICGENERATORAGENTH
00029 
00030 #include "PseudoRNG.h"
00031 
00032 #include "GDynamicGeneratorCategory.h"
00033 
00034 #include <GElementInfluence.h>
00035 #include <GAgent.h>
00036 #include <GElement.h>
00037 #include <GEnergy.h>
00038 #include <GVector3.h>
00039 
00040 #include <qdatetime.h>
00041 #include <qptrlist.h>
00042 
00043 namespace GBE {
00044 
00045 
00046 //this is defined in the implementation file as it is specifically created for this agent
00047 class GDynamicGeneratorOctreeNode;
00048 
00049 
00082 class GDynamicGeneratorAgent : public GCS::GAgent
00083 {
00084   Q_OBJECT
00085     
00086   protected:
00087   
00091     unsigned long RandomSeed;
00092     
00102     QPtrList<GDynamicGeneratorCategory> Categories;
00103   
00108     QDateTime CreationTime;
00109     
00118     unsigned short Density;
00119     
00128     bool CreateAllAtOnce;
00129     
00133     Util::PseudoRNG RNG;
00134     
00138     GDynamicGeneratorOctreeNode* TopNode;
00139     
00140   protected:
00141   
00148     void generateInArea(const GCS::GVector3& position, double radius);
00149     
00160     void recursiveGeneration(GDynamicGeneratorOctreeNode* node, const GCS::GVector3& position, double radius, short unsigned depth);
00161     
00166     virtual GCS::GElement* createElement(const GDynamicGeneratorCategory& category, const GCS::GVector3& position);
00167   
00168   public:
00178     GDynamicGeneratorAgent(unsigned long rand_seed, QPtrList<GDynamicGeneratorCategory> categories, const QDateTime& initial_creation_time, unsigned short density, bool create_all_at_once = false,
00179                            QObject* parent = 0, const char* name = 0);
00180 
00184     virtual ~GDynamicGeneratorAgent();
00185 
00193     virtual void receiveInfluence(GCS::GElementInfluence& influence);
00194     
00195     //@todo create getMethods
00196 
00197 };
00198 
00199 }
00200 
00201 #endif

Generated on Thu Oct 21 21:18:03 2004 for G System by doxygen 1.3.6