#include <linestring.h>
Public Slots | |
virtual void | setVisible (bool visible) |
if visible is true, the layer is made visible | |
Signals | |
void | geometryClicked (Geometry *geometry, QPoint point) |
This signal is emitted when a Geometry is clicked. | |
void | positionChanged (Geometry *geom) |
A Geometry emits this signal, when its position gets changed. | |
Public Member Functions | |
void | addPoint (Point *point) |
adds a point at the end of the LineString | |
virtual QRectF | boundingBox () |
returns the BoundingBox | |
virtual QList< Geometry * > | clickedPoints () |
returns the clicked Points | |
bool | Equals (Geometry *geom) |
virtual bool | hasClickedPoints () const |
returns true if the LineString has clicked Points | |
virtual bool | hasPoints () const |
returns true if the LineString has Childs | |
bool | isVisible () const |
returns true if this Geometry is visible | |
LineString (QList< Point * > const points, QString name=QString(), QPen *pen=0) | |
constructor | |
QString | name () const |
returns the name of this Geometry | |
int | numberOfPoints () const |
returns the number of Points the LineString consists of | |
Geometry * | parentGeometry () const |
returns the parent Geometry of this Geometry | |
QPen * | pen () const |
returns the QPen which is used on drawing | |
QList< Point * > | points () |
returns the points of the LineString | |
void | setName (QString name) |
sets the name of the geometry | |
void | setPoints (QList< Point * > points) |
sets the given list as points of the LineString | |
QString | toString () |
returns a String representation of this Geometry |
A LineString is a Curve with linear interpolation between Points. Each consecutive pair of Points defines a Line segment.
LineString | ( | QList< Point * > const | points, | |
QString | name = QString() , |
|||
QPen * | pen = 0 | |||
) |
constructor
The constructor of a LineString takes a list of Points to form a line.
points | a list of points | |
name | the name of the LineString | |
pen | a QPen can be used to modify the look of the line. |
References LineString::setPoints().
void addPoint | ( | Point * | point | ) |
adds a point at the end of the LineString
point | the point which should be added to the LineString |
QRectF boundingBox | ( | ) | [virtual] |
returns the BoundingBox
The bounding box in world coordinates
Implements Geometry.
References Point::latitude(), and Point::longitude().
QList< Geometry * > clickedPoints | ( | ) | [virtual] |
returns the clicked Points
If a LineString was clicked it could be neccessary to figure out which of its points where clicked. Do do so the methods hasPoints() and clickedPoints() can be used. When a point is added to a LineString the Point becomes its child. It is possible (depending on the zoomfactor) to click more than one Point of a LineString, so this method returns a list.
Reimplemented from Geometry.
bool Equals | ( | Geometry * | geom | ) | [inherited] |
void geometryClicked | ( | Geometry * | geometry, | |
QPoint | point | |||
) | [signal, inherited] |
This signal is emitted when a Geometry is clicked.
A Geometry is clickable, if the containing layer is clickable. The objects emits a signal if it gets clicked
geometry | The clicked Geometry | |
point | -unused- |
Referenced by Point::Touches().
bool hasClickedPoints | ( | ) | const [virtual] |
returns true if the LineString has clicked Points
Reimplemented from Geometry.
bool hasPoints | ( | ) | const [virtual] |
returns true if the LineString has Childs
This is equal to: numberOfPoints() > 0
Reimplemented from Geometry.
bool isVisible | ( | ) | const [inherited] |
returns true if this Geometry is visible
Referenced by Point::Touches().
QString name | ( | ) | const [inherited] |
int numberOfPoints | ( | ) | const |
returns the number of Points the LineString consists of
Geometry * parentGeometry | ( | ) | const [inherited] |
returns the parent Geometry of this Geometry
A LineString is a composition of many Points. This methods returns the parent (the LineString) of a Point
QPen * pen | ( | ) | const [inherited] |
returns the QPen which is used on drawing
The pen is set depending on the Geometry. A CirclePoint for example takes one with the constructor.
QList< Point * > points | ( | ) | [virtual] |
returns the points of the LineString
Implements Geometry.
void positionChanged | ( | Geometry * | geom | ) | [signal, inherited] |
void setName | ( | QString | name | ) | [inherited] |
sets the name of the geometry
name | the new name of the geometry |
void setPoints | ( | QList< Point * > | points | ) |
sets the given list as points of the LineString
points | the points which should be set for the LineString |
Referenced by LineString::LineString().
void setVisible | ( | bool | visible | ) | [virtual, slot, inherited] |
if visible is true, the layer is made visible
visible | if the layer should be visible |
Reimplemented in Point.
References Geometry::boundingBox().
QString toString | ( | ) | [inherited] |