5 #ifndef MERCATOR_TERRAIN_MOD_IMPL_H
6 #define MERCATOR_TERRAIN_MOD_IMPL_H
8 #include <Mercator/TerrainMod.h>
10 #include <Mercator/Segment.h>
14 template <
template <
int>
class Shape>
25 template <
template <
int>
class Shape>
26 bool ShapeTerrainMod<Shape>::checkIntersects(
const Segment& s)
const
28 return WFMath::Intersect(m_shape, s.getRect(),
false) ||
29 WFMath::Contains(s.getRect(), m_shape.getCorner(0),
false);
32 template <
template <
int>
class Shape>
33 void ShapeTerrainMod<Shape>::setShape(
const Shape<2> & s)
36 m_box = m_shape.boundingBox();
39 template <
template <
int>
class Shape> LevelTerrainMod<Shape>::~LevelTerrainMod()
43 template <
template <
int>
class Shape>
46 if (Contains(this->m_shape,WFMath::Point<2>(x,y),
true)) {
51 template <
template <
int>
class Shape>
57 template <
template <
int>
class Shape>
64 template <
template <
int>
class Shape> AdjustTerrainMod<Shape>::~AdjustTerrainMod()
68 template <
template <
int>
class Shape>
71 if (Contains(this->m_shape,WFMath::Point<2>(x,y),
true)) {
76 template <
template <
int>
class Shape>
82 template <
template <
int>
class Shape>
89 template <
template <
int>
class Shape> SlopeTerrainMod<Shape>::~SlopeTerrainMod()
93 template <
template <
int>
class Shape>
96 if (Contains(this->m_shape,WFMath::Point<2>(x,y),
true)) {
97 point = m_level + (this->m_shape.getCenter()[0] - x) * m_dx
98 + (this->m_shape.getCenter()[1] - y) * m_dy;
102 template <
template <
int>
class Shape>
108 template <
template <
int>
class Shape>
118 template <
template <
int>
class Shape> CraterTerrainMod<Shape>::~CraterTerrainMod()
122 template <
template <
int>
class Shape>
125 if (Contains(this->m_shape,WFMath::Point<2>(x,y),
true)) {
130 template <
template <
int>
class Shape>
136 template <
template <
int>
class Shape>
146 #endif // MERCATOR_TERRAIN_MOD_IMPL_H