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

GBE::GDynamicGeneratorCategory Class Reference

Handles child element creation for an element category. More...

#include <GDynamicGeneratorCategory.h>

Inheritance diagram for GBE::GDynamicGeneratorCategory:

Inheritance graph
[legend]
Collaboration diagram for GBE::GDynamicGeneratorCategory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GDynamicGeneratorCategory (double range, double radius_min, double radius_max, bool form_overlapping_allowed)
virtual ~GDynamicGeneratorCategory ()
double getRange () const
double getRadiusMax () const
double getRadiusMin () const
bool formOverlapAllowed () const
virtual GCS::GFormcreateForm (const GCS::GEnergy &energy, const GCS::GVector3 &position, Util::PseudoRNG &rng) const=0
virtual QPtrList< GCS::GAgentcreateAgents (const GCS::GEnergy &energy, Util::PseudoRNG &rng) const=0

Protected Attributes

double Range
double RadiusMin
double RadiusMax
bool FormOverlapAllowed

Detailed Description

Handles child element creation for an element category.

Author:
Raphael Langerhorst
A specialised class needs to be defined for every kind of child element that can be created.

The element itself is not created in the category class but in the GDynamicGeneratorAgent class. Vital parts are provided by the category: the form and agents. The energy is provided by the parent element.

Note:
If the created child element should again provide the same kind of content or child element creation then a GDynamicGeneratorAgent with a fitting category list must be added to the created child.
See also:
GDynamicGeneratorAgent


Constructor & Destructor Documentation

GBE::GDynamicGeneratorCategory::GDynamicGeneratorCategory double  range,
double  radius_min,
double  radius_max,
bool  form_overlapping_allowed
 

Constructor. Sets values for this element category.

GBE::GDynamicGeneratorCategory::~GDynamicGeneratorCategory  )  [virtual]
 

Virtual destructor.


Member Function Documentation

virtual QPtrList<GCS::GAgent> GBE::GDynamicGeneratorCategory::createAgents const GCS::GEnergy energy,
Util::PseudoRNG &  rng
const [pure virtual]
 

This actually creates a form attribute for a new element of this category. Must be implemented by specialisations.

Implemented in GBE::GPlanetCategory, and GBE::GSolarsystemCategory.

virtual GCS::GForm* GBE::GDynamicGeneratorCategory::createForm const GCS::GEnergy energy,
const GCS::GVector3 position,
Util::PseudoRNG &  rng
const [pure virtual]
 

This actually creates a form attribute for a new element of this category. Must be implemented by specialisations.

Implemented in GBE::GPlanetCategory, and GBE::GSolarsystemCategory.

bool GBE::GDynamicGeneratorCategory::formOverlapAllowed  )  const
 

Returns:
true when elements of this category may overlap.

double GBE::GDynamicGeneratorCategory::getRadiusMax  )  const
 

Returns:
the maximum size of a generated element.

double GBE::GDynamicGeneratorCategory::getRadiusMin  )  const
 

Returns:
the minimum size of a generated element.

double GBE::GDynamicGeneratorCategory::getRange  )  const
 

Returns:
the range for choosing the correct category.


Member Data Documentation

bool GBE::GDynamicGeneratorCategory::FormOverlapAllowed [protected]
 

Determines, whether the element form may overlap with other elements. If forms may overlap, the generator agent will create such an element although it will overlap with another element.

double GBE::GDynamicGeneratorCategory::RadiusMax [protected]
 

Holds the maximum radius an element of this category can occupy.

double GBE::GDynamicGeneratorCategory::RadiusMin [protected]
 

Holds the minimum radius an element of this category will occupy.

double GBE::GDynamicGeneratorCategory::Range [protected]
 

When the correct category is chosen for element creation, this range attribute is used to determine the correct category. Range must be between 0 and 1, all Ranges of used categories summed up should result in a number less than 1 because all categories above 1 will never be chosen (as the generated random number is always between 0 and 1).

See also:
GDynamicGeneratorAgent::recursiveGeneration()


The documentation for this class was generated from the following files:
Generated on Thu Oct 21 21:18:08 2004 for G System by doxygen 1.3.6