libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::ScreenBox Class Referencefinal

#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
 
ScreenBoxoperator= (const ScreenBox &other)=default
 Assign the value of other. More...
 
ScreenBoxoperator= (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
 

Detailed Description

Anonymous screen rectangular bounding box.

The bounding box is defined by two coordinates (type Vertex2D) that span a (in coordinate space) rectangular area.

Constructor & Destructor Documentation

◆ ScreenBox() [1/4]

osmscout::ScreenBox::ScreenBox ( )
default

The default constructor creates an invalid instance.

◆ ScreenBox() [2/4]

osmscout::ScreenBox::ScreenBox ( const ScreenBox other)
default

Copy-Constructor.

◆ ScreenBox() [3/4]

osmscout::ScreenBox::ScreenBox ( ScreenBox &&  other)
default

Move-Constructor.

◆ ScreenBox() [4/4]

osmscout::ScreenBox::ScreenBox ( const Vertex2D coordA,
const Vertex2D coordB 
)

Initialize the GeoBox based on the given coordinates.

The two Coordinates together span a rectangular (in coordinates, not on the sphere) area.

Member Function Documentation

◆ GetCenter()

Vertex2D osmscout::ScreenBox::GetCenter ( ) const
inline

Returns the center coordinates of the box.

Returns
the center coordinates

References osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().

Referenced by osmscout::MapPainterAgg::DrawSymbol(), osmscout::MapPainterSVG::DrawSymbol(), and osmscout::SymbolRenderer::Render().

◆ GetHeight()

double osmscout::ScreenBox::GetHeight ( ) const
inline

◆ GetMaxX()

double osmscout::ScreenBox::GetMaxX ( ) const
inline

◆ GetMaxY()

double osmscout::ScreenBox::GetMaxY ( ) const
inline

◆ GetMinX()

double osmscout::ScreenBox::GetMinX ( ) const
inline

◆ GetMinY()

double osmscout::ScreenBox::GetMinY ( ) const
inline

◆ GetSize()

double osmscout::ScreenBox::GetSize ( ) const
inline

Returns the size of the screen box (width*height).

Returns
GetWidth()*GetHeight()

◆ GetWidth()

double osmscout::ScreenBox::GetWidth ( ) const
inline

◆ Intersects() [1/2]

bool osmscout::ScreenBox::Intersects ( const ScreenBox other) const

◆ Intersects() [2/2]

bool osmscout::ScreenBox::Intersects ( const ScreenBox other,
bool  openInterval 
) const

◆ IsEmpty()

bool osmscout::ScreenBox::IsEmpty ( ) const
inline

Check if size of the screen box is zero.

Returns
GetSize()==0.0

◆ Merge()

ScreenBox osmscout::ScreenBox::Merge ( const ScreenBox other) const

◆ operator=() [1/2]

ScreenBox& osmscout::ScreenBox::operator= ( const ScreenBox other)
default

Assign the value of other.

◆ operator=() [2/2]

ScreenBox& osmscout::ScreenBox::operator= ( ScreenBox &&  other)
default

Move assignment operator.

◆ operator==()

bool osmscout::ScreenBox::operator== ( const ScreenBox other) const

Compare two values.

◆ Resize()

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!

Parameters
offsetthe amount to change the coordinates.
Returns
the resulting ScreenBox

References GetHeight(), GetWidth(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().

Referenced by osmscout::MapPainter::IsVisibleArea(), and osmscout::MapPainter::IsVisibleWay().

Member Data Documentation

◆ EMPTY

const ScreenBox osmscout::ScreenBox::EMPTY
static

The documentation for this class was generated from the following files: