CartoType API
Public Member Functions | Protected Member Functions
CartoType::CMapObject Class Reference

#include <cartotype_map_data.h>

Inheritance diagram for CartoType::CMapObject:
CartoType::MPath CartoType::CBasicMapObject CartoType::CType1MapObject CartoType::CShpMapObject CartoType::CType1Array CartoType::CType1MultipleLineOrPolygon CartoType::CType1SingleContourObject CartoType::CShpLineOrPolygon CartoType::CShpPointOrMultiPoint CartoType::CType1Point CartoType::CType1SingleLineOrPolygon CartoType::CShpLine CartoType::CShpPolygon CartoType::CShpMultiPoint CartoType::CShpPoint

List of all members.

Public Member Functions

 CMapObject (const CMapDataLayer &aLayer, TMapObjectType aType, const TMapDataCondition *aCondition=NULL)
virtual const MStringLabel () const =0
virtual TMapAttribute Attribute (int32 aIndex) const =0
virtual int32 Attributes () const =0
void SetCondition (const TMapDataCondition *aCondition)
virtual MWritableContourWritableContour (int32 aIndex)=0
const MPathProjectedPath () const
virtual CT_IMPORT void GetStringAttribute (const MString *aName, TText &aValue) const
virtual CT_IMPORT uint32 Id () const
virtual CT_IMPORT void ClearContents ()
virtual CT_IMPORT const MStringStringAttributes () const
virtual CT_IMPORT const TBitmapBitmap () const
virtual CT_IMPORT const
TTransformFP
BitmapTransform () const
virtual CT_IMPORT TResult Simplify (int32 aResolution)
TMapObjectType Type () const
const CMapDataLayerLayer () const
int32 StyleIndex () const
CT_IMPORT TResult Project (const TCoordinateTransform &aProjection)
CT_IMPORT TResult ProjectTo64ths (const TCoordinateTransform &aProjection)
CT_IMPORT void Offset (int32 aDx, int32 aDy)
CT_IMPORT const TMapDataConditionMatchingCondition (const CArray< TMapDataCondition > &aCondition) const
CT_IMPORT void GetStringAttributeUsingPath (const MString &aPath, const MString &aDefault, TText &aValue) const

Protected Member Functions

void SetType (TMapObjectType aType)

Detailed Description

The abstract base map object class. A map object is a path that also possesses cartographic attributes. All objects returned by map data accessors are derived from CMapObject. A CMapObject has a reference to a CMapDataLayer object that gives the layer name and attribute definitions.


Member Function Documentation

virtual TMapAttribute CartoType::CMapObject::Attribute ( int32  aIndex) const [pure virtual]

Return the attribute specified by aIndex.

Implemented in CartoType::CBasicMapObject, and CartoType::CType1MapObject.

virtual int32 CartoType::CMapObject::Attributes ( ) const [pure virtual]

Return the number of attributes stored in the object.

Implemented in CartoType::CBasicMapObject, and CartoType::CType1MapObject.

CT_EXPORT const TBitmap * CMapObject::Bitmap ( ) const [virtual]

If the object contains array data that can be represented as a bitmap, return a pointer to the bitmap. The default implementation returns null.

Reimplemented in CartoType::CType1Array.

CT_EXPORT const TTransformFP * CMapObject::BitmapTransform ( ) const [virtual]

If the object contains array data that can be represented as a bitmap, return a transform to convert from the bitmap bounds to the extent in map coordinates. The default implementation returns null.

Reimplemented in CartoType::CType1Array.

CT_EXPORT void CMapObject::ClearContents ( ) [virtual]

Clear the contents of a map object so that it can be re-used. Derived classes must call this base function from any overriding function.

Reimplemented in CartoType::CBasicMapObject, CartoType::CType1Array, CartoType::CType1MultipleLineOrPolygon, CartoType::CType1SingleContourObject, CartoType::CType1MapObject, and CartoType::CShpMapObject.

CT_EXPORT void CMapObject::GetStringAttribute ( const MString aName,
TText aValue 
) const [virtual]

Get a string attribute.

If aName is null or empty return the standard name of the object. Return the empty string if no attribute called aName exists.

Reimplemented in CartoType::CBasicMapObject, and CartoType::CType1MapObject.

CT_EXPORT void CMapObject::GetStringAttributeUsingPath ( const MString aPath,
const MString aDefault,
TText aValue 
) const

Get a string attribute from a list of semi-colon-separated names in aPath. Replace empty names with aDefault (as for example if aPath is empty and aDefault is 'name:es'). Return the first non-empty result.

CT_EXPORT uint32 CMapObject::Id ( ) const [virtual]

Return the identifier of this object.

Identifiers are opaque 32-bit numbers that are specific to a database. The value zero is reserved and means 'no identifier'. Objects with the same identifier are linked parts of the same object, as for example a road made of many segments.

Reimplemented in CartoType::CBasicMapObject.

virtual const MString* CartoType::CMapObject::Label ( ) const [pure virtual]

Return the text label or name of the object, or null if there is none.

Implemented in CartoType::CBasicMapObject, and CartoType::CType1MapObject.

const CMapDataLayer& CartoType::CMapObject::Layer ( ) const [inline]

Return the layer this object belongs to.

CT_EXPORT const TMapDataCondition * CMapObject::MatchingCondition ( const CArray< TMapDataCondition > &  aCondition) const

Find out whether a map object matches one of the conditions in aCondition. If so, return a pointer to the first condition that matches. If none of the conditions match return NULL.

CT_EXPORT void CMapObject::Offset ( int32  aDx,
int32  aDy 
)

Offset all points in the projected path by the specified amounts.

CT_EXPORT TResult CMapObject::Project ( const TCoordinateTransform aProjection)

Project all the points to pixels using the specified projection. Call ProjectedPath to get the resulting path.

const MPath& CartoType::CMapObject::ProjectedPath ( ) const [inline]

Return the object's path in its current projected state.

CT_EXPORT TResult CMapObject::ProjectTo64ths ( const TCoordinateTransform aProjection)

Project all the points to 64ths of pixels using the specified projection. Call ProjectedPath to get the resulting path.

void CartoType::CMapObject::SetCondition ( const TMapDataCondition aCondition) [inline]

Set the condition that was fulfilled by this object when it was found in the database. This function is for the use of data accessors.

CT_EXPORT TResult CMapObject::Simplify ( int32  aResolution) [virtual]

Simplify a map object by re-sampling it at a specified resolution. The default implementation does nothing.

Reimplemented in CartoType::CBasicMapObject.

CT_EXPORT const MString * CMapObject::StringAttributes ( ) const [virtual]

If possible, return all the string attributes, null-separated; all except the first, which is the default label, must start with '<name>='. This function must be implemented correctly for all map objects used when creating CTM1 files; for the moment that means CBasicMapObject only.

Reimplemented in CartoType::CBasicMapObject.

int32 CartoType::CMapObject::StyleIndex ( ) const [inline]

Return the index of the conditional style (see CMapDataCondition) that is fulfilled for this object to be returned. Return -1 if the main style is used, not a conditional style. The style index can be used by the caller to select a drawing style.

TMapObjectType CartoType::CMapObject::Type ( ) const [inline]

Return the type of the object.

virtual MWritableContour& CartoType::CMapObject::WritableContour ( int32  aIndex) [pure virtual]

Return a writable interface to the contour indexed by aIndex.

Implemented in CartoType::CBasicMapObject, CartoType::CType1Array, CartoType::CType1MultipleLineOrPolygon, and CartoType::CType1SingleContourObject.


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