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

This renderer translates a map feature whose geometry is an IlvMapText into an IlvLabel. More...

#include <ilviews/maps/rendering/textrdr.h>

Inheritance diagram for IlvDefaultTextRenderer:
IlvFeatureRenderer

Public Member Functions

 IlvDefaultTextRenderer (const IlvDefaultTextRenderer &source)
 Initializes a new instance of the text renderer as a copy of another one. More...
 
 IlvDefaultTextRenderer (IlvDisplay *display)
 Initializes a new instance of this text renderer. More...
 
IlvPalettegetPalette () const
 Returns the palette used to create the graphic object. More...
 
IlvColorgetTextColor () const
 Returns the color of labels produced by this renderer. More...
 
IlvFontgetTextFont () const
 Returns the font of the generated graphic object. More...
 
virtual IlvGraphicmakeGraphic (const IlvMapFeature &feature, const IlvMapInfo &targetMapInfo, IlvMapsError &status) const
 Translates an IlvMapFeature into a graphic object. More...
 
void setPalette (IlvPalette *palette)
 Sets the palette used to create the graphic object. More...
 
IlvMapsError setTextColor (const char *colorName)
 Sets the color of labels produced by this renderer. More...
 
void setTextColor (IlvColor *color)
 Sets the color of labels produced by this renderer. More...
 
IlvMapsError setTextFont (const char *fontName)
 Sets the font of the generated graphic object. More...
 
void setTextFont (IlvFont *font)
 Sets the font of the generated graphic objects. More...
 
- Public Member Functions inherited from IlvFeatureRenderer
virtual IlvFeatureRenderercopy () const =0
 Copies the object. More...
 
IlvDisplaygetDisplay () const
 Returns the renderer display. More...
 
IlBoolean isPersistent () const
 Checks if the renderer can be saved. More...
 
void save (IlvOutputFile &file) const
 Saves the object to an IlvOutputFile. More...
 
virtual void write (IlvOutputFile &file) const =0
 Writes the renderer to an IlvOutputStream. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvFeatureRenderer
static IlvFeatureRendererLoad (IlvInputFile &file)
 Loads a renderer from an IlvInputFile. More...
 
- Protected Member Functions inherited from IlvFeatureRenderer
 IlvFeatureRenderer (IlvDisplay *display, IlBoolean persistent=IlTrue)
 Constructor. More...
 

Detailed Description

This renderer translates a map feature whose geometry is an IlvMapText into an IlvLabel.

Library: ilvmaps

Constructor & Destructor Documentation

◆ IlvDefaultTextRenderer() [1/2]

IlvDefaultTextRenderer::IlvDefaultTextRenderer ( IlvDisplay display)

Initializes a new instance of this text renderer.

Parameters
displayThe display used to create the graphic object.

◆ IlvDefaultTextRenderer() [2/2]

IlvDefaultTextRenderer::IlvDefaultTextRenderer ( const IlvDefaultTextRenderer source)

Initializes a new instance of the text renderer as a copy of another one.

Parameters
sourceThe object to be copied.

Member Function Documentation

◆ getPalette()

IlvPalette* IlvDefaultTextRenderer::getPalette ( ) const

Returns the palette used to create the graphic object.

Returns
IlvPalette that should not be modified, because it can potentially be shared by other objects. However, it is possible to lock it if an other object has to use it.
See also
IlvResource::lock().

◆ getTextColor()

IlvColor* IlvDefaultTextRenderer::getTextColor ( ) const

Returns the color of labels produced by this renderer.

Returns
0 if no color is specified (in this case, the default display foreground color is used), or an IlvColor that should not be modified, because it can potentially be shared by other objects. However, it is possible to lock it if an other object has to use it.

◆ getTextFont()

IlvFont* IlvDefaultTextRenderer::getTextFont ( ) const

Returns the font of the generated graphic object.

Returns
0 if no font is specified (in this case, the default display font is used), or an IlvFont that should not be modified, because it can potentially be shared by other objects. However, it is possible to lock it if an other object has to use it.

◆ makeGraphic()

virtual IlvGraphic* IlvDefaultTextRenderer::makeGraphic ( const IlvMapFeature feature,
const IlvMapInfo targetMapInfo,
IlvMapsError &  status 
) const
virtual

Translates an IlvMapFeature into a graphic object.

If the targetMapInfo has a non-null projection, or a projection that is not an instance of IlvUnknownProjection, the graphic object is projected to the projection system of targetMapInfo. Otherwise, only the map adapter of targetMapInfo is used to convert the feature coordinate into the manager coordinate system.

Parameters
featureThe map feature to be translated.
targetMapInfoThis parameter specifies the projection in which the graphic object must be returned. If this projection is not defined (targetMapInfo.getProjection() is 0), the graphic object is returned to the projection of the map feature (only the map adapter is used).
statusIs set to an error code if the renderer cannot process the map feature (most of the time, because the renderer does not support the feature geometry, but it can also indicate that a projection error occurred).
Returns
An IlvGraphic or 0 if a severe error occurred.

Implements IlvFeatureRenderer.

◆ setPalette()

void IlvDefaultTextRenderer::setPalette ( IlvPalette palette)

Sets the palette used to create the graphic object.

Parameters
paletteThe palette.

◆ setTextColor() [1/2]

IlvMapsError IlvDefaultTextRenderer::setTextColor ( const char *  colorName)

Sets the color of labels produced by this renderer.

Parameters
colorNameThe name of the color.
Note
This function is a convenience function that can be used instead of setPalette().
Returns
IlvMapsError::NoError() or IlvMaps::IllegalArgument() if the color name cannot be translated into a color.

◆ setTextColor() [2/2]

void IlvDefaultTextRenderer::setTextColor ( IlvColor color)

Sets the color of labels produced by this renderer.

Note
This function is a convenience function that can be used instead of setPalette().
Parameters
colorThe color to be set.

◆ setTextFont() [1/2]

IlvMapsError IlvDefaultTextRenderer::setTextFont ( const char *  fontName)

Sets the font of the generated graphic object.

Note
This function is a convenience function that can be used instead of setPalette().
Returns
IlvMapsError::NoError() or IlvMaps::IllegalArgument() if the font name cannot be translated into a color.

◆ setTextFont() [2/2]

void IlvDefaultTextRenderer::setTextFont ( IlvFont font)

Sets the font of the generated graphic objects.

Note
This function is a convenience function that can be used instead of setPalette().
Parameters
fontThe font of the generated graphic object.