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

Hold a reference to a range of data within a CoordBuffer. More...

#include <Transformation.h>

Public Member Functions

 CoordBufferRange ()=default
 
 CoordBufferRange (const CoordBufferRange &other)=default
 
 CoordBufferRange (CoordBuffer &coordBuffer, size_t start, size_t end)
 
Vertex2D Get (size_t index) const
 Return the element with the given index. More...
 
size_t GetEnd () const
 THe index of the last element. More...
 
Vertex2D GetFirst () const
 Return the first element on the path. More...
 
Vertex2D GetLast () const
 Return the last element on the path. More...
 
double GetLength () const
 Returns the on-screen length of the path from the first to the last element. More...
 
size_t GetSize () const
 Returns the number of elements (end-start+1) More...
 
size_t GetStart () const
 Return the index of the first element. More...
 
bool IsValid () const
 
CoordBufferRangeoperator= (const CoordBufferRange &other)
 

Detailed Description

Hold a reference to a range of data within a CoordBuffer.

Constructor & Destructor Documentation

◆ CoordBufferRange() [1/3]

osmscout::CoordBufferRange::CoordBufferRange ( )
default

◆ CoordBufferRange() [2/3]

osmscout::CoordBufferRange::CoordBufferRange ( const CoordBufferRange other)
default

◆ CoordBufferRange() [3/3]

osmscout::CoordBufferRange::CoordBufferRange ( CoordBuffer coordBuffer,
size_t  start,
size_t  end 
)
inline

Member Function Documentation

◆ Get()

Vertex2D osmscout::CoordBufferRange::Get ( size_t  index) const
inline

Return the element with the given index.

Parameters
indexwhere index>=start && index<=end
Returns
the element at the given index

References osmscout::CoordBuffer::buffer.

Referenced by osmscout::MapPainterCairo::DrawArea(), osmscout::MapPainterQt::DrawArea(), osmscout::MapPainterCairo::DrawContourSymbol(), osmscout::MapPainterCairo::DrawPath(), and osmscout::MapPainterQt::DrawPath().

◆ GetEnd()

◆ GetFirst()

Vertex2D osmscout::CoordBufferRange::GetFirst ( ) const
inline

◆ GetLast()

Vertex2D osmscout::CoordBufferRange::GetLast ( ) const
inline

Return the last element on the path.

Returns
last element

References osmscout::CoordBuffer::buffer.

Referenced by osmscout::MapPainterCairo::DrawPath(), and osmscout::MapPainterQt::DrawPath().

◆ GetLength()

double osmscout::CoordBufferRange::GetLength ( ) const
inline

Returns the on-screen length of the path from the first to the last element.

Returns
length of path

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

Referenced by osmscout::MapPainterCairo::DrawContourSymbol().

◆ GetSize()

size_t osmscout::CoordBufferRange::GetSize ( ) const
inline

Returns the number of elements (end-start+1)

Returns
number of elements

◆ GetStart()

◆ IsValid()

bool osmscout::CoordBufferRange::IsValid ( ) const
inline

◆ operator=()

CoordBufferRange& osmscout::CoordBufferRange::operator= ( const CoordBufferRange other)
inline

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