A compass object. More...
#include <ilviews/maps/gui/compass.h>
Public Member Functions | |
IlvMapCompass (IlvDisplay *display, IlvRect &rect, IlvGraphic *cartoNeedle=0, IlvGraphic *geoNeedle=0, IlvPalette *palette=0) | |
Initializes a new IlvMapCompass instance. More... | |
const IlvColor * | getBackground () const |
Retrieves the background color. More... | |
const IlvGraphic * | getCartographicNeedle () |
Retrieves the graphic object used to indicate the cartographic north direction. More... | |
IlDouble | getCartographicNorth () const |
Returns the current cartographic north. More... | |
const IlvColor * | getForeground () const |
Retrieves the foreground color. More... | |
const IlvGraphic * | getGeographicNeedle () const |
Retrieves the graphic object used to indicate the geographic north direction. More... | |
IlDouble | getGeographicNorth () const |
Returns the current geographic north. More... | |
const IlvView * | getView () const |
Returns the view for which the compass displays the north direction. More... | |
void | setBackground (IlvColor *color) |
Sets the background color. More... | |
void | setCartographicNeedle (IlvGraphic *graphic) |
Sets the graphic object used to indicate the cartographic north direction. More... | |
void | setForeground (IlvColor *color) |
Sets the foreground color. More... | |
void | setGeographicNeedle (IlvGraphic *graphic) |
Sets the graphic object used to indicate the geographic north direction. More... | |
void | setView (IlvView *view) |
Sets the view for which the compass will display the north direction. More... | |
A compass object.
Library: ilvmaps
This class defines an IlvGraphic
representing a compass. The needles can indicate:
IlvView
. The geographic north is defined as the tangent to a meridian line passing at the center of the manager view that controls the compass. IlvView
. The cartographic north is defined as the vertical when the map is displayed without rotation. These needles are IlvGraphic
object. The user can supply needle objects or let the compass use the default needle objects IlvMapDefaultNeedle
.
IlvMapCompass::IlvMapCompass | ( | IlvDisplay * | display, |
IlvRect & | rect, | ||
IlvGraphic * | cartoNeedle = 0 , |
||
IlvGraphic * | geoNeedle = 0 , |
||
IlvPalette * | palette = 0 |
||
) |
Initializes a new IlvMapCompass
instance.
display | The display that is used. |
rect | The initial size and position of the object. |
cartoNeedle | The graphic object used indicate the cartographic north. If none is supplied, an IlvMapDefaultNeedle is internally created. |
geoNeedle | The graphic object used to indicate the geographic north. If none is supplied, an IlvMapDefaultNeedle is internally created. |
palette | The palette that is used by this object. |
const IlvColor* IlvMapCompass::getBackground | ( | ) | const |
Retrieves the background color.
const IlvGraphic* IlvMapCompass::getCartographicNeedle | ( | ) |
Retrieves the graphic object used to indicate the cartographic north direction.
IlvMapCompass
is still owner of the object. IlDouble IlvMapCompass::getCartographicNorth | ( | ) | const |
Returns the current cartographic north.
The cartographic north is computed using the transformer of the current view. It is expressed in radians, clockwise, with 0 at 12 o'clock.
const IlvColor* IlvMapCompass::getForeground | ( | ) | const |
Retrieves the foreground color.
const IlvGraphic* IlvMapCompass::getGeographicNeedle | ( | ) | const |
Retrieves the graphic object used to indicate the geographic north direction.
IlvMapCompass
is still owner of the object. IlDouble IlvMapCompass::getGeographicNorth | ( | ) | const |
Returns the current geographic north.
The geographic north is computed using the current transformer and current projection of the view.
The geographic north is expressed in radians, clockwise, relative to the cartographic north.
const IlvView* IlvMapCompass::getView | ( | ) | const |
Returns the view for which the compass displays the north direction.
0
if there is none.
|
virtual |
Sets the background color.
Sets the background color used to draw the underlying decoration.
color | The background color. This IlvColor is locked by the object. |
Reimplemented from IlvSimpleGraphic.
void IlvMapCompass::setCartographicNeedle | ( | IlvGraphic * | graphic | ) |
Sets the graphic object used to indicate the cartographic north direction.
graphic | The object used to indicate the cartographic north direction. The previous object (if any) is destroyed. The IlvMapCompass becomes owner of the graphic. |
|
virtual |
Sets the foreground color.
Sets the foreground color used to draw the underlying decoration.
color | The foreground color. This IlvColor is locked by the object. |
Reimplemented from IlvSimpleGraphic.
void IlvMapCompass::setGeographicNeedle | ( | IlvGraphic * | graphic | ) |
Sets the graphic object used to indicate the geographic north direction.
graphic | The object used to indicate the geographic north direction. The previous object (if any) is destroyed. The IlvMapCompass becomes owner of the graphic. |
void IlvMapCompass::setView | ( | IlvView * | view | ) |
Sets the view for which the compass will display the north direction.
To show the direction of the geographic north in the manager view, the compass must know the projection used to display the map. If the manager of the view has an IlvMapInfo
, the compass will use the associated projection, otherwise, it will assume that the geographic north is in the same direction as the cartographic north.
view | The view. 0 can be used to deactivate the compass. |