CartoType API
Public Types | Public Member Functions | Protected Attributes
CartoType::CSymbol Class Reference

#include <cartotype_symbol.h>

Inheritance diagram for CartoType::CSymbol:
CartoType::CPathSymbol CartoType::CSvgSymbol

List of all members.

Public Types

enum  { ERepeatedSymbolIsOneWayArrow = 1, ERepeatedSymbolIsLabel = 2, ERepeatedSymbolCanOverlapEdge = 4 }

Public Member Functions

 CSymbol (TFixed aGap)
virtual TResult Draw (const TTransform &aTransform)=0
virtual TResult OnStartDrawing ()=0
virtual TResult OnEndDrawing ()=0
virtual TFixed LeftEdge () const =0
virtual TFixed MaxDistanceFromOrigin () const =0
TFixed Gap () const
CT_IMPORT TResult DrawRepeated (CGraphicsContext &aGc, CLabelGraphicsContext &aLabelGc, const MPath &aPath, bool aFractionalPixels, bool aReflect, uint32 aRepeatedSymbolFlags)
CT_IMPORT TResult StartDrawing (CGraphicsContext &aGc, CLabelGraphicsContext &aLabelGc, uint32 aRepeatedSymbolFlags)
CT_IMPORT TResult EndDrawing ()

Protected Attributes

CGraphicsContextiGc
CLabelGraphicsContextiLabelGc
bool iIsLabel
bool iCanOverlapEdge

Detailed Description

An abstract base class for a small object drawn on a map, possibly repeated along a path. A good example is an arrow used to show the direction of a one-way street.


Member Enumeration Documentation

anonymous enum

Bit values supplied to DrawRepeated and StartDrawing.

Enumerator:
ERepeatedSymbolIsOneWayArrow 

The repeated symbol if any is a one-way arrow. One-way arrows are drawn only on one-way streets and only in the road layer.

ERepeatedSymbolIsLabel 

The repeated symbol if any is to be drawn as if each instance of the symbol is a label so that symbols do not overlap each other or labels, and are drawn just after the label for this object.

ERepeatedSymbolCanOverlapEdge 

The repeated symbol can overlap the edge of the map. If not, any symbols that would do so are not drawn.


Member Function Documentation

virtual TResult CartoType::CSymbol::Draw ( const TTransform aTransform) [pure virtual]

Draw the symbol, transformed by aTransform, using iGc and iLabelGc. Do nothing if iGc is null. If iLabelGc is non-null test the symbol for overlap and draw it only if there is no overlap.

Implemented in CartoType::CSvgSymbol, and CartoType::CPathSymbol.

CT_EXPORT TResult CSymbol::DrawRepeated ( CGraphicsContext aGc,
CLabelGraphicsContext aLabelGc,
const MPath aPath,
bool  aFractionalPixels,
bool  aReflect,
uint32  aRepeatedSymbolFlags 
)

Draw one or more symbols along the specified path, which is in fractional pixels if aFractionalPixels is true. If aReflect is true, rotate the symbol by 180 degrees before drawing it.

TFixed CartoType::CSymbol::Gap ( ) const [inline]

Return the distance in pixels between successive symbols. Used for repeated symbols.

virtual TFixed CartoType::CSymbol::LeftEdge ( ) const [pure virtual]

Return the left edge of the symbol so that it can be aligned with the start of the path.

Implemented in CartoType::CSvgSymbol, and CartoType::CPathSymbol.

virtual TFixed CartoType::CSymbol::MaxDistanceFromOrigin ( ) const [pure virtual]

Return a distance in pixels guaranteed to be greater than the maximum distance of any part of the symbol from the origin. This is used in ensuring that a margin is drawn round a map so that parts of objects just off it appear, thus enabling tiles to be drawn that match along their edges.

Implemented in CartoType::CSvgSymbol, and CartoType::CPathSymbol.

virtual TResult CartoType::CSymbol::OnEndDrawing ( ) [pure virtual]

Called at the end of a series of drawing operations to indicate that any GC pointers and cached data can be discarded.

Implemented in CartoType::CSvgSymbol, and CartoType::CPathSymbol.

virtual TResult CartoType::CSymbol::OnStartDrawing ( ) [pure virtual]

Called at the start of a series of drawing operations to allow graphics state, etc., to be set.

Implemented in CartoType::CSvgSymbol, and CartoType::CPathSymbol.


The documentation for this class was generated from the following files: