QMapControl  0.9.7.4
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
ArrowPoint Class Reference

Draws a directed arrow (showing orientation) into the map. More...

#include <arrowpoint.h>

Inheritance diagram for ArrowPoint:
Point Geometry QObject

Public Types

enum  Alignment {
  TopLeft, TopRight, TopMiddle, BottomLeft,
  BottomRight, BottomMiddle, Middle
}
 sets where the point should be aligned More...
 

Signals

void geometryClicked (Geometry *geometry, QPoint point)
 This signal is emitted when a Geometry is clicked. More...
 
void positionChanged (Geometry *geom)
 A Geometry emits this signal, when its position gets changed. More...
 

Public Member Functions

 ArrowPoint (qreal x, qreal y, int sideLength, qreal heading, QString name=QString(), Alignment alignment=Middle, QPen *pen=0)
 
virtual QRectF boundingBox ()
 returns the bounding box of the point More...
 
QPointF coordinate () const
 returns the coordinate of the point More...
 
bool Equals (Geometry *geom)
 
qreal getHeading () const
 gets the current heading of the arrow
 
bool isVisible () const
 returns true if this Geometry is visible More...
 
qreal latitude () const
 returns the latitude of the point More...
 
qreal longitude () const
 returns the longitude of the point More...
 
QString name () const
 returns the name of this Geometry More...
 
GeometryparentGeometry () const
 returns the parent Geometry of this Geometry More...
 
QPen * pen () const
 returns the QPen which is used on drawing More...
 
QPixmap pixmap ()
 returns the pixmap of the point More...
 
void setBaselevel (int zoomlevel)
 Sets the zoom level on which the points pixmap gets displayed on full size. More...
 
void setHeading (qreal heading)
 sets the heading of the arrow and redraws it in the new orientation More...
 
void setMaxsize (QSize maxsize)
 sets a maximal size for the pixmap More...
 
void setMinsize (QSize minsize)
 sets a minimal size for the pixmap More...
 
void setName (QString name)
 sets the name of the geometry More...
 
virtual void setPen (QPen *pen)
 sets the QPen which is used for drawing the arrow More...
 
QString toString ()
 returns a String representation of this Geometry More...
 
QWidgetwidget ()
 returns the widget of the point More...
 

Protected Member Functions

virtual bool Touches (Point *click, const MapAdapter *mapadapter)
 returns true if the given Point touches this Point More...
 

Detailed Description

Draws a directed arrow (showing orientation) into the map.

This is a convenience class for Point. It configures the pixmap of a Point to draw an arrow in a specific direction. A QPen could be used to change the color or line-width of the arrow

Author
Jeffery MacEachern j.mac.nosp@m.each.nosp@m.ern@g.nosp@m.mail.nosp@m..com

Member Enumeration Documentation

enum Alignment
inherited

sets where the point should be aligned

Enumerator
TopLeft 

Align on TopLeft

TopRight 

Align on TopRight

TopMiddle 

Align on TopLeft

BottomLeft 

Align on BottomLeft

BottomRight 

Align on BottomRight

BottomMiddle 

Align on BottomMiddle

Middle 

Align on Middle

Constructor & Destructor Documentation

ArrowPoint ( qreal  x,
qreal  y,
int  sideLength,
qreal  heading,
QString  name = QString(),
Alignment  alignment = Middle,
QPen *  pen = 0 
)
Parameters
xlongitude
ylatitude
sideLengthside length of the arrow's bounding box (square)
headingcompass heading determining direction that arrow faces, measured in degrees clockwise from North
namename of the arrow point
alignmentalignment (Middle or TopLeft)
penQPen for drawing

References Geometry::pen().

Member Function Documentation

QRectF boundingBox ( )
virtualinherited

returns the bounding box of the point

The Bounding contains the coordinate of the point and its size. The size is set, if the point contains a pixmap or a widget

Returns
the bounding box of the point

Implements Geometry.

References Point::latitude(), and Point::longitude().

QPointF coordinate ( ) const
inherited

returns the coordinate of the point

The x component of the returned QPointF is the longitude value, the y component the latitude

Returns
the coordinate of a point

Referenced by MapControl::setView(), and Point::Touches().

bool Equals ( Geometry geom)
inherited

returns true if the given Geometry is equal to this Geometry not implemented yet!

Parameters
geomThe Geometry to be tested
Returns
true if the given Geometry is equal to this
void geometryClicked ( Geometry geometry,
QPoint  point 
)
signalinherited

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

Parameters
geometryThe clicked Geometry
point-unused-

Referenced by Point::Touches().

bool isVisible ( ) const
inherited

returns true if this Geometry is visible

Returns
true if this Geometry is visible

Referenced by Point::Touches().

qreal latitude ( ) const
inherited

returns the latitude of the point

Returns
the latitude of the point

Referenced by LineString::boundingBox(), and Point::boundingBox().

qreal longitude ( ) const
inherited

returns the longitude of the point

Returns
the longitude of the point

Referenced by LineString::boundingBox(), and Point::boundingBox().

QString name ( ) const
inherited

returns the name of this Geometry

Returns
the name of this Geometry

Referenced by Geometry::setName().

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

Returns
the parent Geometry of this Geometry
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.

Returns
the QPen which is used for drawing

Referenced by ArrowPoint::ArrowPoint(), CirclePoint::CirclePoint(), LineString::LineString(), ArrowPoint::setPen(), and CirclePoint::setPen().

QPixmap pixmap ( )
inherited

returns the pixmap of the point

Returns
the pixmap of the point

Referenced by FixedImageOverlay::FixedImageOverlay(), and ImagePoint::ImagePoint().

void positionChanged ( Geometry geom)
signalinherited

A Geometry emits this signal, when its position gets changed.

Parameters
geomthe Geometry
void setBaselevel ( int  zoomlevel)
inherited

Sets the zoom level on which the points pixmap gets displayed on full size.

Use this method to set a zoom level on which the pixmap gets displayed with its real size. On zoomlevels below it will be displayed smaller, and on zoom levels thereover it will be displayed larger

See also
setMinsize, setMaxsize
Parameters
zoomlevelthe zoomlevel on which the point will be displayed on full size
void setHeading ( qreal  heading)

sets the heading of the arrow and redraws it in the new orientation

Parameters
headingnew heading
void setMaxsize ( QSize  maxsize)
inherited

sets a maximal size for the pixmap

When the point´s pixmap should change its size on zooming, this method sets the maximal size.

See also
setBaselevel
Parameters
maxsizethe maximal size which the pixmap should have
void setMinsize ( QSize  minsize)
inherited

sets a minimal size for the pixmap

When the point's pixmap should change its size on zooming, this method sets the minimal size.

See also
setBaselevel
Parameters
minsizethe minimal size which the pixmap should have
void setName ( QString  name)
inherited

sets the name of the geometry

Parameters
namethe new name of the geometry

References Geometry::name().

void setPen ( QPen *  pen)
virtual

sets the QPen which is used for drawing the arrow

A QPen can be used to modify the look of the drawn arrow

Parameters
penthe QPen which should be used for drawing
See also
http://doc.trolltech.com/4.3/qpen.html

Reimplemented from Geometry.

References Geometry::pen().

QString toString ( )
inherited

returns a String representation of this Geometry

not implemented yet!

Returns
a String representation of this Geometry
bool Touches ( Point click,
const MapAdapter mapadapter 
)
protectedvirtualinherited

returns true if the given Point touches this Point

The collision detection checks for the bounding rectangulars.

Parameters
geomthe other point which should be tested on collision
mapadapterthe mapadapter which is used for calculations
Returns

Implements Geometry.

References Point::coordinate(), MapAdapter::coordinateToDisplay(), Geometry::geometryClicked(), and Geometry::isVisible().

QWidget * widget ( )
inherited

returns the widget of the point

Returns
the widget of the point

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