// This file may be redistributed and modified only under the terms of // the GNU General Public License (See COPYING for details). // Copyright (C) 2003 Damien McGinnes, Alistair Riddoch #ifndef MERCATOR_TERRAIN_MOD_IMPL_H #define MERCATOR_TERRAIN_MOD_IMPL_H #include namespace Mercator { template ShapeTerrainMod::~ShapeTerrainMod() { } template WFMath::AxisBox<2> ShapeTerrainMod::bbox() const { return m_shape.boundingBox(); } template LevelTerrainMod::~LevelTerrainMod() { } template void LevelTerrainMod::apply(float &point, int x, int y) const { if (Contains(this->m_shape,WFMath::Point<2>(x,y),true)) { point = m_level; } } template TerrainMod * LevelTerrainMod::clone() const { return new LevelTerrainMod(m_level, this->m_shape); } template AdjustTerrainMod::~AdjustTerrainMod() { } template void AdjustTerrainMod::apply(float &point, int x, int y) const { if (Contains(this->m_shape,WFMath::Point<2>(x,y),true)) { point += m_dist; } } template TerrainMod * AdjustTerrainMod::clone() const { return new AdjustTerrainMod(m_dist, this->m_shape); } template SlopeTerrainMod::~SlopeTerrainMod() { } template void SlopeTerrainMod::apply(float &point, int x, int y) const { if (Contains(this->m_shape,WFMath::Point<2>(x,y),true)) { point = m_level + (this->m_shape.getCenter()[0] - x) * m_dx + (this->m_shape.getCenter()[1] - y) * m_dy; } } template TerrainMod * SlopeTerrainMod::clone() const { return new SlopeTerrainMod(m_level, m_dx, m_dy, this->m_shape); } } //namespace Mercator #endif // MERCATOR_TERRAIN_MOD_IMPL_H