Rogue Wave Views Maps Package API Reference Guide |
Rogue Wave Views Documentation Home |
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) | |
Constructor. More... | |
const IlvColor * | getBackground () |
Retrieves the background color. More... | |
const IlvGraphic * | getCartographicNeedle () |
Retrieves the IlvGraphic used to indicate the cartographic north direction. More... | |
IlDouble | getCartographicNorth () |
Returns the current cartographic north. More... | |
const IlvColor * | getForeground () |
Retrieves the foreground color. More... | |
const IlvGraphic * | getGeographicNeedle () |
Retrieves the IlvGraphic used to indicate the geographic north direction. More... | |
IlDouble | getGeographicNorth () |
Returns the current geographic north. More... | |
const IlvView * | getView () |
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 IlvGraphic used to indicate the cartographic north direction. More... | |
void | setForeground (IlvColor *color) |
Sets the foreground color. More... | |
void | setGeographicNeedle (IlvGraphic *gn) |
Sets the IlvGraphic 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
view. 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 |
||
) |
Constructor.
Construct an IlvMapCompass
.
display | The IlvDisplay . |
rect | The initial size and position of the object. |
cartoNeedle | An IlvGraphic used to indicate the cartographic north. If none is supplied, an IlvMapDefaultNeedle is internally created. |
geoNeedle | An IlvGraphic used to indicate the geographic north. If none is supplied, an IlvMapDefaultNeedle is internally created. |
palette | The IlvPalette . |
const IlvColor* IlvMapCompass::getBackground | ( | ) |
Retrieves the background color.
const IlvGraphic* IlvMapCompass::getCartographicNeedle | ( | ) |
Retrieves the IlvGraphic
used to indicate the cartographic north direction.
IlvMapCompass
is still owner of the object. IlDouble IlvMapCompass::getCartographicNorth | ( | ) |
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 | ( | ) |
Retrieves the foreground color.
const IlvGraphic* IlvMapCompass::getGeographicNeedle | ( | ) |
Retrieves the IlvGraphic
used to indicate the geographic north direction.
IlvMapCompass
is still owner of the object. IlDouble IlvMapCompass::getGeographicNorth | ( | ) |
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 | ( | ) |
Returns the view for which the compass displays the north direction.
|
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 IlvGraphic
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 * | gn | ) |
Sets the IlvGraphic
used to indicate the geographic north direction.
gn | 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. A null value can be used to deactivate the compass. |
© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.