5 #ifndef MERCATOR_AREASHADER_H
6 #define MERCATOR_AREASHADER_H
8 #include <Mercator/Shader.h>
37 #endif // of MERCATOR_AREASHADER_H
void shadeArea(Surface &s, const Area *const ar) const
helper to shader a single area into the surface
Definition: AreaShader.cpp:239
const Segment & getSegment() const
Accessor for the terrain height segment this buffer is associated with.
Definition: Buffer.h:55
EdgeAtY(WFMath::CoordType y)
Definition: AreaShader.cpp:98
const int getSize() const
Accessor for array size of this segment.
Definition: Segment.h:81
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
Shader for handling areas.
Definition: AreaShader.h:16
The edge of an area.
Definition: AreaShader.cpp:32
const Segment & m_segment
The terrain height segment this buffer is associated with.
Definition: Buffer.h:17
Vector2 m_seg
The vector describing the edge from its start.
Definition: AreaShader.cpp:86
Data store for terrain surface data.
Definition: Surface.h:22
const Areastore & getAreas() const
Accessor for multimap of Area objects.
Definition: Segment.h:195
Point2 end() const
Determine the point describing the end of the edge.
Definition: AreaShader.cpp:60
Region of terrain surface which is modified.
Definition: Area.h:28
Point2 start() const
Accessor for the point describing the start of the edge.
Definition: AreaShader.cpp:58
WFMath::AxisBox< 2 > getRect() const
The 2d area covered by this segment.
Definition: Segment.cpp:752
The edge of an area parallel to the x axis.
Definition: AreaShader.cpp:92
DataType * getData()
Accessor for a pointer to buffer containing data values.
Definition: Buffer.h:70
std::multimap< int, const Area * > Areastore
STL multimap of pointers to Area objects affecting this segment.
Definition: Segment.h:42
AreaShader(int layer)
Constructor.
Definition: AreaShader.cpp:205
WFMath::CoordType m_y
The coordinate on the y axis of the edge.
Definition: AreaShader.cpp:107
virtual bool checkIntersect(const Segment &) const
Check whether this Shader has any effect on the given Segment.
Definition: AreaShader.cpp:212
bool operator<(const Edge &other) const
Compare the y coordinate of the start with another edge.
Definition: AreaShader.cpp:78
int m_layer
The layer number.
Definition: AreaShader.h:32
Base class for Shader objects which create surface data for use when rendering terrain.
Definition: Shader.h:29
WFMath::CoordType m_inverseGradient
The inverse of the gradient of the line.
Definition: AreaShader.cpp:88
Point2 m_start
The point describing the start of the edge.
Definition: AreaShader.cpp:84
Edge(const Point2 &a, const Point2 &b)
Constructor.
Definition: AreaShader.cpp:39
WFMath::CoordType xValueAtY(WFMath::CoordType y) const
Determine the x coordinate at a given y coordinate.
Definition: AreaShader.cpp:67
bool operator()(const Edge &u, const Edge &v) const
Determine which edge crosses this edge at a lower x coordinate.
Definition: AreaShader.cpp:101
virtual void shade(Surface &s) const
Populate a Surface with data.
Definition: AreaShader.cpp:218
WFMath::Polygon< 2 > clipToSegment(const Segment &s) const
Clip the shape of this area to a given segment.
Definition: Area.cpp:284
unsigned int getSize() const
Accessor for the size of segment, m_res + 1.
Definition: Buffer.h:60