Polyline

Since: BlackBerry 10.2.0

#include <bb/platform/geo/Polyline>

To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmaps

A Polyline in geographic space that is represented by an ordered set of latitude and longitude coordinates (vertices).

Note: Invalid coordinates are ignored when it comes to adding new coordinates.


Overview

Public Functions Index

Polyline ()
Polyline (const Polyline &src)
Polyline (const QList< Coordinate > &points)
~Polyline ()
voidappend (const Coordinate &vertex)
voidappend (const QList< Coordinate > &vertices)
Coordinateat (int index) const
BoundingBoxboundingBox () const
voidclear ()
intcount () const
voidinsertAt (const Coordinate &vertex, int index)
boolisEmpty () const
booloperator!= (const Polyline &other) const
Polyline &operator= (const Polyline &src)
booloperator== (const Polyline &other) const
voidremoveAt (int index)
voidreplace (int index, const Coordinate &point)
intsize () const

Public Functions

Polyline ()

Creates a Polyline instance, default constructor.

Since:

BlackBerry 10.2.0

Polyline (

Copy constructor.

Parameters
src

The source of the copy information.

Since:

BlackBerry 10.2.0

Polyline (

Given a list of Coordinates, creates a Polyline instance.

Parameters
points

The list of Coordinates (vertices) used to compose the Polyline. Invalid coordinates are ignored.

Since:

BlackBerry 10.2.0

~Polyline ()

Destructor.

Since:

BlackBerry 10.2.0

void append (

Appends the vertex to this Polyline.

Parameters
vertex

The coordinate to the appended. An invalid coordinate is ignored.

Since:

BlackBerry 10.2.0

void append (

Appends the list of given vertices to this object.

Parameters
vertices

The list of coordinates to be appended. Invalid coordinates are ignored.

Since:

BlackBerry 10.2.0

Coordinate at (
  • intindex)

Returns the Coordinate (vertex) at index position.

Index must be a valid index position (i.e., 0 <= index < size()).

Parameters
index

The position of the desired coordinate.

Return:

The desired coordinate. If the index is out of bounds, then an invalid Coordinate is returned.

Since:

BlackBerry 10.2.0

BoundingBox boundingBox ()

Retrieves the bounding box for this shape.

Since:

BlackBerry 10.2.0

void clear ()

Removes all Coordinates (vertices).

Since:

BlackBerry 10.2.0

int count ()

Equivalent to size().

Since:

BlackBerry 10.2.0

void insertAt (

Inserts point at index position.

Parameters
vertex

The vertex to be inserted. An invalid coordinate is ignored.

index

The position for the vertex to be added. If index is 0, the value is prepended to the Polyline. If index is size(), the value is appended to the Polyline. If the index is outside the accepted range, then the operation is ignored.

Since:

BlackBerry 10.2.0

bool isEmpty ()

Determines if there are any vertices in this Polyline.

Return:

true if the size is zero.

Since:

BlackBerry 10.2.0

bool operator!= (

Inequality operator.

Parameters
other

The Polyline to compare.

Return:

true if there is any difference in value or order between this object and the parameter.

Since:

BlackBerry 10.2.0

Polyline & operator= (

Assignment operator.

Parameters
src

The source of the assignment.

Since:

BlackBerry 10.2.0

bool operator== (

Equality operator.

Parameters
other

The Polyline to compare.

Return:

true if all the coordinates of the two lines are equal in value and order.

Since:

BlackBerry 10.2.0

void removeAt (
  • intindex)

Removes the vertex at the position index.

Parameters
index

The position index. index must be a valid index position (i.e., 0 <= index < size()). If the index is outside the accepted range, then the operation is ignored.

Since:

BlackBerry 10.2.0

void replace (

Replaces the vertex at the position index.

Parameters
index

The position index. index must be a valid index position (i.e., 0 <= index < size()). If the index is outside the accepted range, then the operation is ignored.

point

The new Coordinate to replace the point at index. If point is an invalid coordinate, it is ignored.

Since:

BlackBerry 10.2.0

int size ()

Returns the number of points (vertices) in the Polyline.

Since:

BlackBerry 10.2.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus