Views
Maps Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvMapScale Class Reference

A scale object that displays the scale of a view. More...

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

Inheritance diagram for IlvMapScale:
IlvSimpleGraphic IlvGraphic IlvValueInterface

Public Member Functions

 IlvMapScale (IlvDisplay *display, const IlvRect &rect, IlvMapScaleTextMode mode=IlvMapScaleThreeLabels, IlvGraphic *bar=0, IlvDim margin=5, IlvPalette *palette=0)
 Initializes a new IlvMapScale instance. More...
 
IlDouble getFarLimit () const
 Retrieves the far limit. More...
 
const IlvUnitConvertergetFarUnitConverter () const
 Retrieves the far unit converter. More...
 
const IlvGraphicgetGraphic () const
 Retrieves the scale bar IlvGraphic. More...
 
IlvDim getMargin () const
 Retrieves the margin. More...
 
const IlvUnitConvertergetNearUnitConverter () const
 Retrieves the near unit converter. More...
 
IlvMapScaleTextMode getScaleTextMode () const
 Retrieves the text mode. More...
 
IlvDim getSpacing () const
 Retrieves the spacing between the text and the scale bar. More...
 
void setFarLimit (IlDouble limit)
 Sets the far limit. More...
 
void setFarUnitConverter (IlvUnitConverter *farConv)
 Sets the far unit converter. More...
 
void setGraphic (IlvGraphic *graphic)
 Sets a new graphic object to represent the scale bar part of the scale. More...
 
void setMargin (IlvDim margin)
 Sets the margin. More...
 
void setNearUnitConverter (IlvUnitConverter *nearConv)
 Sets the near unit converter. More...
 
void setScaleTextMode (IlvMapScaleTextMode mode)
 Sets the label displaying mode. More...
 
void setSpacing (IlvDim spacing)
 Sets the spacing (in pixels) between the text and the scale bar. More...
 
void setView (IlvView *view)
 Attaches a view to the scale. More...
 

Detailed Description

A scale object that displays the scale of a view.

Library: ilvmaps

This component works only if the manager of the target view has an IlvMapInfo property attached. This property defines the coordinate system of the manager and its units.

Constructor & Destructor Documentation

◆ IlvMapScale()

IlvMapScale::IlvMapScale ( IlvDisplay display,
const IlvRect rect,
IlvMapScaleTextMode  mode = IlvMapScaleThreeLabels,
IlvGraphic bar = 0,
IlvDim  margin = 5,
IlvPalette palette = 0 
)

Initializes a new IlvMapScale instance.

Parameters
displayThe display to use to draw this object.
rectThe initial size and position.
modeSpecifies if a unique label (IlvMapScaleUniqueLabel) or a set of labels (IlvMapScaleThreeLabels) is to be drawn.
barThe graphic object representing the bar. If no bar is specified, the scale will automatically create a IlvMapDefaultScaleBar. If an IlvGraphic is provided, it is then owned by the IlvMapScale.
marginThe margin.
paletteThe palette to use to draw this object.

Member Function Documentation

◆ getFarLimit()

IlDouble IlvMapScale::getFarLimit ( ) const

Retrieves the far limit.

Returns the switch limit between a text display of the scale in a small unit (for instance, meters) and a text display in a large unit (for instance, kilometers).

Returns
The upper limit.

◆ getFarUnitConverter()

const IlvUnitConverter* IlvMapScale::getFarUnitConverter ( ) const

Retrieves the far unit converter.

Returns
The far unit converter. The scale is still owner of the returned converter.
See also
setFarUnitConverter().

◆ getGraphic()

const IlvGraphic* IlvMapScale::getGraphic ( ) const

Retrieves the scale bar IlvGraphic.

Returns
The scale bar. This IlvGraphic is still owned by the scale bar.

◆ getMargin()

IlvDim IlvMapScale::getMargin ( ) const

Retrieves the margin.

Returns
The minimum space between the scale bar and the border of the scale.

◆ getNearUnitConverter()

const IlvUnitConverter* IlvMapScale::getNearUnitConverter ( ) const

Retrieves the near unit converter.

Returns
The near unit converter. The scale is still owner of the returned converter.
See also
setNearUnitConverter().

◆ getScaleTextMode()

IlvMapScaleTextMode IlvMapScale::getScaleTextMode ( ) const

Retrieves the text mode.

Returns
The text mode.

◆ getSpacing()

IlvDim IlvMapScale::getSpacing ( ) const

Retrieves the spacing between the text and the scale bar.

Returns
The space between the tex and the scale bar.

◆ setFarLimit()

void IlvMapScale::setFarLimit ( IlDouble  limit)

Sets the far limit.

The far limit is the switch limit between a text display of the scale in a small unit (for instance, meters) and a text display in a large unit (for instance, kilometers).

If the map distance represented by the scale bar exceeds the limit, expressed in the small unit system, then the scale will be displayed in the large unit.

Parameters
limitThe upper limit.
See also
setNearUnitConverter(), setFarUnitConverter().

◆ setFarUnitConverter()

void IlvMapScale::setFarUnitConverter ( IlvUnitConverter farConv)

Sets the far unit converter.

The far unit converter is the converter that specifies the unit to display the length of the scale bar for small scales.

Parameters
farConvThe far unit converter. The scale becomes owner of the converter. This converter must be allocated in the heap memory.

◆ setGraphic()

void IlvMapScale::setGraphic ( IlvGraphic graphic)

Sets a new graphic object to represent the scale bar part of the scale.

Parameters
graphicThe new graphic object. This graphic is now owned by the IlvMapScale. The previous IlvGraphic, if there is one, is deleted.

◆ setMargin()

void IlvMapScale::setMargin ( IlvDim  margin)

Sets the margin.

Parameters
marginThe minimum space between the scale bar and the border of the scale.

◆ setNearUnitConverter()

void IlvMapScale::setNearUnitConverter ( IlvUnitConverter nearConv)

Sets the near unit converter.

The near unit converter is the converter that specifies the unit to display the length of the scale bar for large scales.

Parameters
nearConvThe near unit converter. The scale becomes owner of the converter. This converter must be allocated in the heap memory.

◆ setScaleTextMode()

void IlvMapScale::setScaleTextMode ( IlvMapScaleTextMode  mode)

Sets the label displaying mode.

Parameters
modeThe text displaying style.

◆ setSpacing()

void IlvMapScale::setSpacing ( IlvDim  spacing)

Sets the spacing (in pixels) between the text and the scale bar.

Parameters
spacingThe space between the tex and the scale bar.

◆ setView()

void IlvMapScale::setView ( IlvView view)

Attaches a view to the scale.

Parameters
viewThe IlvView whose manager defines the coordinate system.