CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_geometry.h>
Public Member Functions | |
CGeometry (const CMapObject &aMapObject) | |
TPathIntersectionType | IntersectionType (const CMapObject &aMapObject) const |
TPathIntersectionInfo | IntersectionInfo (const CMapObject &aMapObject) const |
std::vector< TPathIntersectionType > | IntersectionType (std::function< const CMapObject *(size_t)> aObject, size_t aObjectCount) const |
std::vector< TPathIntersectionType > | IntersectionType (const CMapObjectArray &aMapObjectArray) const |
std::vector< TPathIntersectionInfo > | IntersectionInfo (std::function< const CMapObject *(size_t)> aObject, size_t aObjectCount) const |
std::vector< TPathIntersectionInfo > | IntersectionInfo (const CMapObjectArray &aMapObjectArray) const |
bool | Intersects (const CMapObject &aMapObject) const |
bool | Contains (const CMapObject &aMapObject) const |
bool | Contained (const CMapObject &aMapObject) const |
CGeometry | Clip (TClipOperation aClipOperation, const CMapObject &aMapObject) const |
std::vector< CGeometry > | Clip (TClipOperation aClipOperation, const CMapObjectArray &aMapObjectArray) const |
std::vector< CGeometry > | Clip (TClipOperation aClipOperation, std::function< const CMapObject *(size_t)> aObject, size_t aObjectCount) const |
CGeneralGeometry () | |
CGeneralGeometry (TCoordType aCoordType, bool aClosed=false) | |
CGeneralGeometry (const MPath &aPath, TCoordType aCoordType, bool aClosed) | |
CGeneralGeometry (const TRectFP &aRect, TCoordType aCoordType) | |
CGeneralGeometry (const point_t &aPoint, TCoordType aCoordType) | |
CGeneralGeometry (const CGeneralGeometry &aOther, size_t aContourIndex) | |
Public Member Functions inherited from CartoType::CGeneralGeometry< TOutlinePointFP > | |
CGeneralGeometry () | |
CGeneralGeometry (TCoordType aCoordType, bool aClosed=false) | |
CGeneralGeometry (const MPath &aPath, TCoordType aCoordType, bool aClosed) | |
CGeneralGeometry (const TRectFP &aRect, TCoordType aCoordType) | |
CGeneralGeometry (const TOutlinePointFP &aPoint, TCoordType aCoordType) | |
CGeneralGeometry (const CGeneralGeometry &aOther, size_t aContourIndex) | |
operator COutline () const | |
void | Clear () |
TCoordType | CoordType () const |
size_t | ContourCount () const |
const contour_t & | Contour (size_t aIndex) const |
bool | ContourIsOuter (size_t aIndex) const |
size_t | PointCount (size_t aContourIndex) const |
const TOutlinePointFP & | Point (size_t aContourIndex, size_t aPointIndex) const |
TOutlinePointFP & | Point (size_t aContourIndex, size_t aPointIndex) |
bool | IsEmpty () const |
bool | IsClosed () const |
void | SetClosed (bool aClosed) |
TWritableCoordSet | CoordSet (size_t aContourIndex) |
TCoordSet | CoordSet (size_t aContourIndex) const |
TRectFP | Bounds () const |
void | AppendPoint (const TOutlinePointFP &aPoint) |
void | AppendPoint (double aX, double aY) |
void | AppendPoint (double aX, double aY, TPointType aPointType) |
void | BeginContour () |
void | Reverse () |
void | ConvertCoords (TCoordType aToCoordType, std::function< void(TWritableCoordSet &aCoordSet)> aConvertFunction) |
Static Public Member Functions | |
static CGeometry | Envelope (const CMapObject &aMapObject, double aOffsetInMeters) |
Additional Inherited Members | |
Public Types inherited from CartoType::CGeneralGeometry< TOutlinePointFP > | |
using | contour_t = std::vector< TOutlinePointFP > |
A geometry class for creating map objects and specifying view areas.
There are also functions for the determining distance and intersection type between a geometry object and map objects. Those functions do not work with geometry objects in display coordinates, or map objects with no known projection, for which they give a path intersection type of Unknown. If the geometry is in map units or map meters the caller is responsible for ensuring that the units are the same as those of the map object or objects.
|
explicit |
Creates a geometry object containing the geometry of a map object. The geometry object is closed if the map object is a polygon or array (i.e., a texture), otherwise open.
|
inline |
Creates an empty open geometry object using map coordinates.
|
inline |
Creates a geometry object representing a single contour of another geometry object.
|
inline |
Creates a geometry object by copying a path, using given coordinates and open/closed status. Ignores the open/closed status of individual contours in the path.
|
inline |
Creates an open geometry object containing a single point.
|
inline |
Creates a closed geometry object from an axis-aligned rectangle.
|
inlineexplicit |
Creates a geometry object with given coordinates and open/closed status.
CGeometry CartoType::CGeometry::Clip | ( | TClipOperation | aClipOperation, |
const CMapObject & | aMapObject | ||
) | const |
Returns the result of clipping a map object using this geometry, which must be closed. Supports intersection, union, difference and exclusive-or operations. All operations except difference are commutative. The difference operation subtracts this geometry from aMapObject.
The returned geometry object is in degrees.
std::vector< CGeometry > CartoType::CGeometry::Clip | ( | TClipOperation | aClipOperation, |
const CMapObjectArray & | aMapObjectArray | ||
) | const |
Returns the results of clipping an array of map objects using this geometry, which must be closed. Supports intersection, union, difference and exclusive-or operations. All operations except difference are commutative. The difference operation subtracts this geometry from the map objects.
The returned geometry objects are in degrees.
std::vector< CGeometry > CartoType::CGeometry::Clip | ( | TClipOperation | aClipOperation, |
std::function< const CMapObject *(size_t)> | aObject, | ||
size_t | aObjectCount | ||
) | const |
Returns the results of clipping a sequence of map objects returned by a function using this geometry, which must be closed. Returns an empty array if this geometry is not closed. Supports intersection, union, difference and exclusive-or operations. All operations except difference are commutative. The difference operation subtracts this geometry from the map objects.
The returned geometry objects are in degrees.
|
inline |
Returns true if this geometry is contained by the map object aMapObject.
|
inline |
Returns true if this geometry contains the map object aMapObject.
|
static |
Returns a geometry that is the envelope of a map object, created by offsetting the path by aOffset. The offset may be negative if the subject path is made of polygons only.
The returned geometry object is in degrees.
TPathIntersectionInfo CartoType::CGeometry::IntersectionInfo | ( | const CMapObject & | aMapObject | ) | const |
Returns information about the intersection of this geometry with a map object. The nearest positions are in degrees (X = longitude, Y = latitude) and the the distance is in meters.
std::vector< TPathIntersectionInfo > CartoType::CGeometry::IntersectionInfo | ( | const CMapObjectArray & | aMapObjectArray | ) | const |
Returns information about the intersection of this geometry with an array of map objects. The nearest positions are in degrees (X = longitude, Y = latitude) and the the distances are in meters.
std::vector< TPathIntersectionInfo > CartoType::CGeometry::IntersectionInfo | ( | std::function< const CMapObject *(size_t)> | aObject, |
size_t | aObjectCount | ||
) | const |
Returns information about the intersection of this geometry with a sequence of map objects returned by a function. The nearest positions are in degrees (X = longitude, Y = latitude) and the the distances are in meters.
TPathIntersectionType CartoType::CGeometry::IntersectionType | ( | const CMapObject & | aMapObject | ) | const |
Returns the intersection type of this geometry with a map object.
std::vector< TPathIntersectionType > CartoType::CGeometry::IntersectionType | ( | const CMapObjectArray & | aMapObjectArray | ) | const |
Returns the intersection types of this geometry with an array of map objects.
std::vector< TPathIntersectionType > CartoType::CGeometry::IntersectionType | ( | std::function< const CMapObject *(size_t)> | aObject, |
size_t | aObjectCount | ||
) | const |
Returns the intersection types of this geometry with an sequence of map objects returned by a function.
|
inline |
Returns true if this geometry intersects, contains or is contained by the map object aMapObject.