rwlogo

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvMapCompass Class Reference

A compass object. More...

#include <ilviews/maps/gui/compass.h>

Inheritance diagram for IlvMapCompass:
IlvSimpleGraphic IlvGraphic

Public Member Functions

 IlvMapCompass (IlvDisplay *display, IlvRect &rect, IlvGraphic *cartoNeedle=0, IlvGraphic *geoNeedle=0, IlvPalette *palette=0)
 Constructor. More...
 
const IlvColorgetBackground ()
 Retrieves the background color. More...
 
const IlvGraphicgetCartographicNeedle ()
 Retrieves the IlvGraphic used to indicate the cartographic north direction. More...
 
IlDouble getCartographicNorth ()
 Returns the current cartographic north. More...
 
const IlvColorgetForeground ()
 Retrieves the foreground color. More...
 
const IlvGraphicgetGeographicNeedle ()
 Retrieves the IlvGraphic used to indicate the geographic north direction. More...
 
IlDouble getGeographicNorth ()
 Returns the current geographic north. More...
 
const IlvViewgetView ()
 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...
 

Detailed Description

A compass object.

Library: ilvmaps

This class defines an IlvGraphic representing a compass. The needles can indicate:

These needles are IlvGraphic object. The user can supply needle objects or let the compass use the default needle objects IlvMapDefaultNeedle.

Constructor & Destructor Documentation

IlvMapCompass::IlvMapCompass ( IlvDisplay display,
IlvRect rect,
IlvGraphic cartoNeedle = 0,
IlvGraphic geoNeedle = 0,
IlvPalette palette = 0 
)

Constructor.

Construct an IlvMapCompass.

Parameters
displayThe IlvDisplay.
rectThe initial size and position of the object.
cartoNeedleAn IlvGraphic used to indicate the cartographic north. If none is supplied, an IlvMapDefaultNeedle is internally created.
geoNeedleAn IlvGraphic used to indicate the geographic north. If none is supplied, an IlvMapDefaultNeedle is internally created.
paletteThe IlvPalette.

Member Function Documentation

const IlvColor* IlvMapCompass::getBackground ( )

Retrieves the background color.

Returns
The background color.
const IlvGraphic* IlvMapCompass::getCartographicNeedle ( )

Retrieves the IlvGraphic used to indicate the cartographic north direction.

Returns
The object used to indicate the cartographic north direction. The 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. The cartographic north is expressed in radians, clockwise, with 0 at 12 o'clock.

Returns
The current cartographic north.
const IlvColor* IlvMapCompass::getForeground ( )

Retrieves the foreground color.

Returns
The foreground color.
const IlvGraphic* IlvMapCompass::getGeographicNeedle ( )

Retrieves the IlvGraphic used to indicate the geographic north direction.

Returns
The object used to indicate the geographic north direction. The 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.

Returns
The attached view or a null pointer if there is none.
void IlvMapCompass::setBackground ( IlvColor color)
virtual

Sets the background color.

Sets the background color used to draw the underlying decoration.

Parameters
colorThe background color. This IlvColor is locked by the object.

Reimplemented from IlvGraphic.

void IlvMapCompass::setCartographicNeedle ( IlvGraphic graphic)

Sets the IlvGraphic used to indicate the cartographic north direction.

Parameters
graphicThe object used to indicate the cartographic north direction. The previous object (if any) is destroyed. The IlvMapCompass becomes owner of the graphic.
void IlvMapCompass::setForeground ( IlvColor color)
virtual

Sets the foreground color.

Sets the foreground color used to draw the underlying decoration.

Parameters
colorThe foreground color. This IlvColor is locked by the object.

Reimplemented from IlvGraphic.

void IlvMapCompass::setGeographicNeedle ( IlvGraphic gn)

Sets the IlvGraphic used to indicate the geographic north direction.

Parameters
graphicThe 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.

Parameters
viewThe view. A null value can be used to deactivate the compass.

© Copyright 2014, 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.