|
CartoType API
|
#include <cartotype_map_data.h>
Public Member Functions | |
| CBasicMapObject (const CMapDataLayer &aLayer, TMapObjectType aType, uint32 aId=0) | |
| int32 | Contours () const |
| void | GetContour (int32 aIndex, TContour &aContour) const |
| const MString * | Label () const |
| CT_IMPORT void | GetStringAttribute (const MString *aName, TText &aValue) const |
| void | ClearContents () |
| TMapAttribute | Attribute (int32 aIndex) const |
| int32 | Attributes () const |
| const MString * | StringAttributes () const |
| CT_IMPORT TResult | Simplify (int32 aResolution) |
| int32 | PointsInContour (int32 aContourIndex) const |
| uint32 | Id () const |
| CT_IMPORT TResult | AppendContour (CContour *aContour) |
| CT_IMPORT CContour * | AppendContour (TResult &aError) |
| CT_IMPORT TResult | SetStringAttributes (const MString &aAttrib) |
| CT_IMPORT TResult | SetLabel (const MString &aAttrib) |
| CT_IMPORT TResult | AddStringAttribute (const MString &aKey, const MString &aValue) |
| TResult | AddAttributeValue (TMapAttribute aAttribute) |
| CT_IMPORT CBasicMapObject * | Copy (TResult &aError) const |
| MWritableContour & | WritableContour (int32 aIndex) |
| CContour & | Contour (int32 aIndex) |
| CT_IMPORT void | ReverseContours () |
Static Public Member Functions | |
| static CT_IMPORT CBasicMapObject * | New (TResult &aError, const CMapObject &aObject, const CMapDataLayer *aLayer, int32 aCircleRadius) |
A simple map object class
| CT_EXPORT TResult CBasicMapObject::AddStringAttribute | ( | const MString & | aKey, |
| const MString & | aValue | ||
| ) |
Add a string attribute with a given key and value. No check is made for duplicates.
Append a supplied new contour to the map object, taking ownership of it.
Append a new contour to the map object and return a pointer to it.
| TMapAttribute CartoType::CBasicMapObject::Attribute | ( | int32 | aIndex | ) | const [inline, virtual] |
Return the attribute specified by aIndex.
Implements CartoType::CMapObject.
| int32 CartoType::CBasicMapObject::Attributes | ( | ) | const [inline, virtual] |
Return the number of attributes stored in the object.
Implements CartoType::CMapObject.
| void CartoType::CBasicMapObject::ClearContents | ( | ) | [inline, 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 from CartoType::CMapObject.
Reimplemented in CartoType::CShpMapObject.
| int32 CartoType::CBasicMapObject::Contours | ( | ) | const [inline, virtual] |
Return the number of contours.
Implements CartoType::MPath.
| CT_EXPORT CBasicMapObject * CBasicMapObject::Copy | ( | TResult & | aError | ) | const |
Return a copy of a basic map object.
| void CartoType::CBasicMapObject::GetContour | ( | int32 | aIndex, |
| TContour & | aContour | ||
| ) | const [inline, virtual] |
Return the contour indexed by aIndex.
Implements CartoType::MPath.
| CT_EXPORT void CBasicMapObject::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 from CartoType::CMapObject.
| uint32 CartoType::CBasicMapObject::Id | ( | ) | const [inline, 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 from CartoType::CMapObject.
| const MString* CartoType::CBasicMapObject::Label | ( | ) | const [inline, virtual] |
Return the text label or name of the object, or null if there is none.
Implements CartoType::CMapObject.
| CT_EXPORT CBasicMapObject * CBasicMapObject::New | ( | TResult & | aError, |
| const CMapObject & | aObject, | ||
| const CMapDataLayer * | aLayer, | ||
| int32 | aCircleRadius | ||
| ) | [static] |
Create a copy of any map object. If aLayer is non-null, use it instead of aObject's own layer. The copy will contain only the standard data of a map object; any data known only to the actual class of the source object will not be copied. If aObject is a point object and aCircleRadius is greater than zero, convert it to a circle.
| CT_EXPORT void CBasicMapObject::ReverseContours | ( | ) |
Reverse the order of the contours in a basic map object. This function can be used to correct polylines stored in reverse order: that is, the start of contour N is the same as the end of contour N + 1.
Set the label without changing any other attributes.
Set the string attributes including the label. The label comes first. If there are any other string attributes they are separated by nulls and each one is stored as <key>=
.
| CT_EXPORT TResult CBasicMapObject::Simplify | ( | int32 | aResolution | ) | [virtual] |
Simplify a map object by re-sampling it at a specified resolution. The default implementation does nothing.
Reimplemented from CartoType::CMapObject.
| const MString* CartoType::CBasicMapObject::StringAttributes | ( | ) | const [inline, 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 from CartoType::CMapObject.
| MWritableContour& CartoType::CBasicMapObject::WritableContour | ( | int32 | aIndex | ) | [inline, virtual] |
Return a writable interface to the contour indexed by aIndex.
Implements CartoType::CMapObject.
1.7.5.1