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 bool checkGenerationPlausibility (const GCS::GVector3 &position) const
virtual GCS::GFormcreateForm (const GCS::GEnergy &energy, const GCS::GVector3 &position, Util::PseudoRNG &rng) const =0
virtual void postProcess (GCS::GElement *element, Util::PseudoRNG &rng, const GCS::GObject *own_object) 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

bool GBE::GDynamicGeneratorCategory::checkGenerationPlausibility ( const GCS::GVector3 position  )  const [virtual]

An element of this category will only be generated if this method returns true, if it returns false, no element will be generated. By default this method returns always true.

Returns:
true when the generation of an element of this cateogry is plausible at given position.

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.

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.

virtual void GBE::GDynamicGeneratorCategory::postProcess ( GCS::GElement element,
Util::PseudoRNG &  rng,
const GCS::GObject own_object 
) const [pure virtual]

Here the element can be posprocessed. This is especially important for creating agents and adding them to the element.

Note:
DO NOT execute the agents. Elements are generally executed and parked by the GWE.

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


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 Nov 16 07:49:20 2006 for G System by  doxygen 1.4.7