Eris::InnerTerrainModCrater Class Reference

Handles a crater terrain mod. This will parse and create an instance of Mercator::CraterTerrainMod, which is a mod which produces a crater in the landscape. Note that this will not make use of InnerTerrainMod_impl since there's no templated shapes in use here. TODO: Should perhaps this also use the same pattern of InnerTerrainMod_impl as the other mods, just to not break the pattern? /ehj. More...

#include <TerrainMod.h>

Inheritance diagram for Eris::InnerTerrainModCrater:
Eris::InnerTerrainMod

List of all members.

Public Member Functions

 InnerTerrainModCrater (TerrainMod &terrainMod)
 Ctor.
virtual ~InnerTerrainModCrater ()
 Dtor.
virtual bool parseAtlasData (const Atlas::Message::MapType &modElement)
virtual Mercator::TerrainMod * getModifier ()

Protected Attributes

Mercator::CraterTerrainMod * mModifier
 A reference to the crater terrain modifier held by this instance.

Detailed Description

Handles a crater terrain mod. This will parse and create an instance of Mercator::CraterTerrainMod, which is a mod which produces a crater in the landscape. Note that this will not make use of InnerTerrainMod_impl since there's no templated shapes in use here. TODO: Should perhaps this also use the same pattern of InnerTerrainMod_impl as the other mods, just to not break the pattern? /ehj.

Author:
Erik Hjortsberg <erik.hjortsberg@iteam.se>
Tamas Bates

Constructor & Destructor Documentation

Eris::InnerTerrainModCrater::InnerTerrainModCrater ( TerrainMod terrainMod  ) 

Ctor.

Parameters:
terrainMod The TerrainMod instance to which this instance belongs to.

Member Function Documentation

Mercator::TerrainMod * Eris::InnerTerrainModCrater::getModifier (  )  [virtual]

Accessor for the Mercator::TerrainMod created and held by this instance. If no terrain mod could be created, such as with faulty Atlas data, or if parseAtlasData() hasn't been called yet, this will return a null pointer.

Returns:
A pointer to the TerrainMod held by this instance, or null if none created.

Implements Eris::InnerTerrainMod.

References mModifier.

bool Eris::InnerTerrainModCrater::parseAtlasData ( const Atlas::Message::MapType &  modElement  )  [virtual]

Tries to parse the Atlas data. It's up to the specific subclasses to provide proper parsing of the data depending on their needs. If the data is successfully parsed, a new Mercator::TerrainMod instance will be created.

Parameters:
modElement The Atlas element describing the terrainmod. This should in most instances correspond directly to the "terrainmod" element found in the root atlas attribute map.
Returns:
If the parsing was successful, true will be returned, and a new Mercator::TerrainMod will have been created, else false.

Just fall through

Implements Eris::InnerTerrainMod.

References mModifier, Eris::InnerTerrainMod::parsePosition(), and Eris::InnerTerrainMod::parseShape().


Member Data Documentation

Mercator::CraterTerrainMod* Eris::InnerTerrainModCrater::mModifier [protected]

A reference to the crater terrain modifier held by this instance.

The ownership is ours, so it will be destroyed when this instance is destroyed.

Referenced by getModifier(), parseAtlasData(), and ~InnerTerrainModCrater().


The documentation for this class was generated from the following files:

Generated on Tue Nov 24 17:45:18 2009 for Eris by  doxygen 1.6.1