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

This renderer translates a map feature whose geometry is an IlvMapPoint into an IlvMarker. More...

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

Inheritance diagram for IlvDefaultPointRenderer:
IlvFeatureRenderer

Public Member Functions

 IlvDefaultPointRenderer (const IlvDefaultPointRenderer &source)
 Initializes a new instance of the renderer as a copy of another one. More...
 
 IlvDefaultPointRenderer (IlvDisplay *display)
 Initializes a new instance of the renderer. More...
 
IlvColorgetForeground () const
 Returns the foreground color used to draw the marker. More...
 
IlUShort getLineWidth () const
 Returns the line width. More...
 
IlUShort getMarkerSize () const
 Returns the size of marker produced by this renderer. More...
 
IlvMarkerType getMarkerType () const
 Returns the marker type. More...
 
IlvPalettegetPalette () const
 Returns the palette used to create the graphic objects. More...
 
IlvPatterngetPattern () const
 Returns the pattern used for the marker. More...
 
virtual IlvGraphicmakeGraphic (const IlvMapFeature &feature, const IlvMapInfo &targetMapInfo, IlvMapsError &status) const
 Translates an IlvMapFeature into a graphic object. More...
 
IlvMapsError setForeground (const char *colorName)
 Sets the foreground color of the marker. More...
 
void setForeground (IlvColor *color)
 Sets the foreground color of the marker. More...
 
void setLineWidth (IlUShort lineWidth)
 Sets the line width for the marker lines. More...
 
void setMarkerSize (IlUShort markerSize)
 Sets the size of the marker produced by this renderer. More...
 
void setMarkerType (IlvMarkerType markerType)
 Sets the marker type used by this renderer. More...
 
void setPalette (IlvPalette *palette)
 Sets the palette used to create the graphic objects. More...
 
IlvMapsError setPattern (const char *fileName)
 Sets a pattern for the marker by specifying a file name. More...
 
void setPattern (IlvPattern *pattern)
 Sets a pattern for the marker. 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 IlvMapPoint into an IlvMarker.

Library: ilvmaps

Constructor & Destructor Documentation

◆ IlvDefaultPointRenderer() [1/2]

IlvDefaultPointRenderer::IlvDefaultPointRenderer ( IlvDisplay display)

Initializes a new instance of the renderer.

Parameters
displayThe display used to create the graphic objects.

◆ IlvDefaultPointRenderer() [2/2]

IlvDefaultPointRenderer::IlvDefaultPointRenderer ( const IlvDefaultPointRenderer source)

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

Parameters
sourceThe object to be copied.

Member Function Documentation

◆ getForeground()

IlvColor* IlvDefaultPointRenderer::getForeground ( ) const

Returns the foreground color used to draw the marker.

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.

◆ getLineWidth()

IlUShort IlvDefaultPointRenderer::getLineWidth ( ) const

Returns the line width.

Returns
The line width.

◆ getMarkerSize()

IlUShort IlvDefaultPointRenderer::getMarkerSize ( ) const

Returns the size of marker produced by this renderer.

Returns
The marker size.

◆ getMarkerType()

IlvMarkerType IlvDefaultPointRenderer::getMarkerType ( ) const

Returns the marker type.

Returns
The marker type.

◆ getPalette()

IlvPalette* IlvDefaultPointRenderer::getPalette ( ) const

Returns the palette used to create the graphic objects.

Returns
An IlvPalette object 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().

◆ getPattern()

IlvPattern* IlvDefaultPointRenderer::getPattern ( ) const

Returns the pattern used for the marker.

Returns
0 if no pattern is specified, or an IlvPattern 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* IlvDefaultPointRenderer::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 a null pointer if a severe error occurred.

Implements IlvFeatureRenderer.

◆ setForeground() [1/2]

IlvMapsError IlvDefaultPointRenderer::setForeground ( const char *  colorName)

Sets the foreground color of the marker.

It can be a predefined color or the string can have the syntax "#RRGGBB" in hexadecimal. The foreground color is used if there is no pattern or if there is a non-color pattern.

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

◆ setForeground() [2/2]

void IlvDefaultPointRenderer::setForeground ( IlvColor color)

Sets the foreground color of the marker.

The foreground color is used if there is no pattern or if there is a non-color pattern.

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

◆ setLineWidth()

void IlvDefaultPointRenderer::setLineWidth ( IlUShort  lineWidth)

Sets the line width for the marker lines.

If the value is greater than 0, then the lines will be drawn using the fill pattern if any.

Note
This function is a convenience function that can be used instead of setPalette().
Parameters
lineWidthThe new line width.

◆ setMarkerSize()

void IlvDefaultPointRenderer::setMarkerSize ( IlUShort  markerSize)

Sets the size of the marker produced by this renderer.

Parameters
markerSizeThe size of the marker.

◆ setMarkerType()

void IlvDefaultPointRenderer::setMarkerType ( IlvMarkerType  markerType)

Sets the marker type used by this renderer.

Parameters
markerTypeThe marker type.

◆ setPalette()

void IlvDefaultPointRenderer::setPalette ( IlvPalette palette)

Sets the palette used to create the graphic objects.

Parameters
paletteThe palette to be set.

◆ setPattern() [1/2]

IlvMapsError IlvDefaultPointRenderer::setPattern ( const char *  fileName)

Sets a pattern for the marker by specifying a file name.

The pattern is used for the marker types that fill an area (IlvMarkerFilledSquare, IlvMarkerFilledCircle, IlvMarkerFilledDiamond, IlvMarkerFilledTriangle).

Parameters
fileNameName of the file containing the pattern.
Note
This function is a convenience function that can be used instead of setPalette().
Returns
MapsError::IllegalArgument() if the name supplied is not a valid bitmap file name.

◆ setPattern() [2/2]

void IlvDefaultPointRenderer::setPattern ( IlvPattern pattern)

Sets a pattern for the marker.

The pattern is used for the marker types that fill an area (IlvMarkerFilledSquare, IlvMarkerFilledCircle, IlvMarkerFilledDiamond, IlvMarkerFilledTriangle).

Note
function is a convenience function that can be used instead of setPalette().
Parameters
patternThe pattern.