5 #ifndef MERCATOR_AREA_H
6 #define MERCATOR_AREA_H
8 #include <Mercator/Effector.h>
10 #include <wfmath/axisbox.h>
11 #include <wfmath/polygon.h>
35 Area(
int layer,
bool hole);
44 void setShape(
const WFMath::Polygon<2>& p);
46 void setShader(
const Shader * shader)
const;
49 bool contains(WFMath::CoordType x, WFMath::CoordType y)
const;
64 const WFMath::Polygon<2> &
shape()
const
69 const Shader * getShader()
const
74 int addToSegment(Segment &)
const;
75 void updateToSegment(Segment &)
const;
76 void removeFromSegment(Segment &)
const;
105 #endif // of MERCATOR_AREA_H
bool inside(const Point2 &p) const
Check a point is outside this clip.
Definition: Area.cpp:87
BottomClip(CoordType t)
Definition: Area.cpp:81
bool m_hole
A flag indicating whether this is a hole.
Definition: Area.h:96
bool checkIntersects(const Segment &s) const
Definition: Area.cpp:299
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
WFMath::Polygon< 2 > m_shape
The geometric shape.
Definition: Area.h:98
bool inside(const Point2 &p) const
Check a point is outside this clip.
Definition: Area.cpp:163
Helper to clip points to a given range.
Definition: Area.cpp:151
int getLayer() const
Accessor for the layer number.
Definition: Area.h:52
void setShape(const WFMath::Polygon< 2 > &p)
Set the geometric shape of this area.
Definition: Area.cpp:239
Point2 clip(const Point2 &u, const Point2 &v) const
Determine the point where a line crosses this clip.
Definition: Area.cpp:97
bool inside(const Point2 &p) const
Check a point is outside this clip.
Definition: Area.cpp:46
void setLayer(int layer, bool hole)
Set the layer number and flag indicating whether this is a hole.
CoordType topY
Top of y range.
Definition: Area.cpp:71
RightClip(CoordType t)
Definition: Area.cpp:157
Helper to clip points to a given range.
Definition: Area.cpp:112
Region of terrain surface which is modified.
Definition: Area.h:28
Helper to clip points to a given range.
Definition: Area.cpp:34
CoordType bottomY
Bottom of y range.
Definition: Area.cpp:108
Point2 clip(const Point2 &u, const Point2 &v) const
Determine the point where a line crosses this clip.
Definition: Area.cpp:56
WFMath::AxisBox< 2 > getRect() const
The 2d area covered by this segment.
Definition: Segment.cpp:752
TopClip(CoordType t)
Definition: Area.cpp:40
bool isHole() const
Accessor for the flag indicating whether this is a hole.
Definition: Area.h:58
Device which effects a change in the terrain.
Definition: Effector.h:25
int m_layer
The layer number.
Definition: Area.h:94
WFMath::AxisBox< 2 > m_box
The bounding box of the geometric shape.
Definition: Effector.h:70
const WFMath::Polygon< 2 > & shape() const
Accessor for the geometric shape.
Definition: Area.h:64
Base class for Shader objects which create surface data for use when rendering terrain.
Definition: Shader.h:29
const Shader * m_shader
Shader that shades this area.
Definition: Area.h:100
LeftClip(CoordType t)
Definition: Area.cpp:118
Point2 clip(const Point2 &u, const Point2 &v) const
Determine the point where a line crosses this clip.
Definition: Area.cpp:173
CoordType leftX
Left of x range.
Definition: Area.cpp:147
Point2 clip(const Point2 &u, const Point2 &v) const
Determine the point where a line crosses this clip.
Definition: Area.cpp:134
Helper to clip points to a given range.
Definition: Area.cpp:75
CoordType rightX
Right of x range.
Definition: Area.cpp:186
Area(int layer, bool hole)
Constructor.
Definition: Area.cpp:232
bool contains(WFMath::CoordType x, WFMath::CoordType y) const
Determine if a point is contained by the shape of this area.
Definition: Area.cpp:251
bool inside(const Point2 &p) const
Check a point is outside this clip.
Definition: Area.cpp:124
WFMath::Polygon< 2 > clipToSegment(const Segment &s) const
Clip the shape of this area to a given segment.
Definition: Area.cpp:284
int addArea(const Area *a)
Add an area to those that affect this segment.
Definition: Segment.cpp:683