libosmscout
0.1
|
#include <ScreenBox.h>
Public Member Functions | |
Vertex2D | GetCenter () const |
Returns the center coordinates of the box. More... | |
double | GetHeight () const |
Returns the height of the bounding box (maxLat-minLat). More... | |
double | GetMaxX () const |
double | GetMaxY () const |
double | GetMinX () const |
double | GetMinY () const |
double | GetSize () const |
Returns the size of the screen box (width*height). More... | |
double | GetWidth () const |
Returns the width of the bounding box (maxLon-minLon). More... | |
bool | Intersects (const ScreenBox &other) const |
bool | Intersects (const ScreenBox &other, bool openInterval) const |
bool | IsEmpty () const |
Check if size of the screen box is zero. More... | |
ScreenBox | Merge (const ScreenBox &other) const |
ScreenBox & | operator= (const ScreenBox &other)=default |
Assign the value of other. More... | |
ScreenBox & | operator= (ScreenBox &&other)=default |
Move assignment operator. More... | |
bool | operator== (const ScreenBox &other) const |
Compare two values. More... | |
ScreenBox | Resize (double offset) const |
Resize the rectangle in all dimension using the given amount. More... | |
ScreenBox ()=default | |
The default constructor creates an invalid instance. More... | |
ScreenBox (const ScreenBox &other)=default | |
Copy-Constructor. More... | |
ScreenBox (const Vertex2D &coordA, const Vertex2D &coordB) | |
Initialize the GeoBox based on the given coordinates. More... | |
ScreenBox (ScreenBox &&other)=default | |
Move-Constructor. More... | |
Static Public Attributes | |
static const ScreenBox | EMPTY |
Anonymous screen rectangular bounding box.
The bounding box is defined by two coordinates (type Vertex2D) that span a (in coordinate space) rectangular area.
|
default |
The default constructor creates an invalid instance.
|
default |
Copy-Constructor.
|
default |
Move-Constructor.
Initialize the GeoBox based on the given coordinates.
The two Coordinates together span a rectangular (in coordinates, not on the sphere) area.
|
inline |
Returns the center coordinates of the box.
References osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
Referenced by osmscout::MapPainterAgg::DrawSymbol(), osmscout::MapPainterSVG::DrawSymbol(), and osmscout::SymbolRenderer::Render().
|
inline |
Returns the height of the bounding box (maxLat-minLat).
References osmscout::Vertex2D::GetY().
Referenced by osmscout::MapPainterCairo::DrawContourSymbol(), osmscout::Symbol::GetHeight(), osmscout::MapPainter::IsVisibleArea(), and Resize().
|
inline |
References osmscout::Vertex2D::GetX().
Referenced by osmscout::Symbol::GetBoundingBox(), and Intersects().
|
inline |
References osmscout::Vertex2D::GetY().
Referenced by osmscout::Symbol::GetBoundingBox(), and Intersects().
|
inline |
References osmscout::Vertex2D::GetX().
Referenced by osmscout::Symbol::GetBoundingBox(), and Intersects().
|
inline |
References osmscout::Vertex2D::GetY().
Referenced by osmscout::Symbol::GetBoundingBox(), and Intersects().
|
inline |
Returns the size of the screen box (width*height).
|
inline |
Returns the width of the bounding box (maxLon-minLon).
References osmscout::Vertex2D::GetX().
Referenced by osmscout::MapPainterCairo::DrawContourSymbol(), osmscout::Symbol::GetWidth(), osmscout::MapPainter::IsVisibleArea(), and Resize().
bool osmscout::ScreenBox::Intersects | ( | const ScreenBox & | other | ) | const |
Referenced by osmscout::MapPainter::IsVisibleArea(), and osmscout::MapPainter::IsVisibleWay().
bool osmscout::ScreenBox::Intersects | ( | const ScreenBox & | other, |
bool | openInterval | ||
) | const |
References GetMaxX(), GetMaxY(), GetMinX(), GetMinY(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
|
inline |
Check if size of the screen box is zero.
References osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
Referenced by osmscout::Symbol::AddPrimitive().
Assign the value of other.
bool osmscout::ScreenBox::operator== | ( | const ScreenBox & | other | ) | const |
Compare two values.
ScreenBox osmscout::ScreenBox::Resize | ( | double | offset | ) | const |
Resize the rectangle in all dimension using the given amount.
If offset is >=0 the resulting area will be bigger, else smaller.
If the reduction (negative offset) is bigger than width/2 or height/2, resulted screen box will have zero size (will be empty).
The size delta will be 2*offset in width and in height!
offset | the amount to change the coordinates. |
References GetHeight(), GetWidth(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
Referenced by osmscout::MapPainter::IsVisibleArea(), and osmscout::MapPainter::IsVisibleWay().
|
static |