rwlogo

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
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 (IlvDisplay *display)
 Creates an instance of a text renderer. More...
 
 IlvDefaultTextRenderer (const IlvDefaultTextRenderer &source)
 Copies the constructor. 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...
 
void setTextColor (IlvColor *color)
 Sets the color of labels produced by this renderer. More...
 
IlvMapsError setTextColor (const char *colorName)
 Sets the color of labels produced by this renderer. More...
 
void setTextFont (IlvFont *font)
 Sets the font of the generated graphic objects. More...
 
IlvMapsError setTextFont (const char *fontName)
 Sets the font of the generated graphic object. 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::IlvDefaultTextRenderer ( IlvDisplay display)

Creates an instance of a text renderer.

Parameters
displayThe display used to create the graphic object.
IlvDefaultTextRenderer::IlvDefaultTextRenderer ( const IlvDefaultTextRenderer source)

Copies the constructor.

Parameters
sourceThe object to be copied.

Member Function Documentation

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()
IlvColor* IlvDefaultTextRenderer::getTextColor ( ) const

Returns the color of labels produced by this renderer.

Returns
A null pointer 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.
IlvFont* IlvDefaultTextRenderer::getTextFont ( ) const

Returns the font of the generated graphic object.

Returns
A null pointer 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.
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 NULL), 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 a null pointer if a severe error occurred.

Implements IlvFeatureRenderer.

void IlvDefaultTextRenderer::setPalette ( IlvPalette palette)

Sets the palette used to create the graphic object.

Parameters
paletteThe palette.
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.
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.
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.
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.

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