Views
Maps Package API Reference Guide
Product Documentation:
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 IlvValueInterface

Public Member Functions

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

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::IlvMapCompass ( IlvDisplay display,
IlvRect rect,
IlvGraphic cartoNeedle = 0,
IlvGraphic geoNeedle = 0,
IlvPalette palette = 0 
)

Initializes a new IlvMapCompass instance.

Parameters
displayThe display that is used.
rectThe initial size and position of the object.
cartoNeedleThe graphic object used indicate the cartographic north. If none is supplied, an IlvMapDefaultNeedle is internally created.
geoNeedleThe graphic object used to indicate the geographic north. If none is supplied, an IlvMapDefaultNeedle is internally created.
paletteThe palette that is used by this object.

Member Function Documentation

◆ getBackground()

const IlvColor* IlvMapCompass::getBackground ( ) const

Retrieves the background color.

Returns
The background color.

◆ getCartographicNeedle()

const IlvGraphic* IlvMapCompass::getCartographicNeedle ( )

Retrieves the graphic object 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.

◆ getCartographicNorth()

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.

Returns
The current cartographic north.

◆ getForeground()

const IlvColor* IlvMapCompass::getForeground ( ) const

Retrieves the foreground color.

Returns
The foreground color.

◆ getGeographicNeedle()

const IlvGraphic* IlvMapCompass::getGeographicNeedle ( ) const

Retrieves the graphic object 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.

◆ getGeographicNorth()

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.

Returns
The current geographic north.

◆ getView()

const IlvView* IlvMapCompass::getView ( ) const

Returns the view for which the compass displays the north direction.

Returns
The attached view or a 0 if there is none.

◆ setBackground()

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 IlvSimpleGraphic.

◆ setCartographicNeedle()

void IlvMapCompass::setCartographicNeedle ( IlvGraphic graphic)

Sets the graphic object 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.

◆ setForeground()

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 IlvSimpleGraphic.

◆ setGeographicNeedle()

void IlvMapCompass::setGeographicNeedle ( IlvGraphic graphic)

Sets the graphic object 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.

◆ setView()

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. 0 can be used to deactivate the compass.