00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
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
00196
00197 };
00198
00199 }
00200
00201 #endif