CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_geometry.h>
Public Member Functions | |
Geometry (const MapObject &aMapObject) | |
PathIntersectionType | IntersectionType (const MapObject &aMapObject) const |
PathIntersectionInfo | IntersectionInfo (const MapObject &aMapObject) const |
std::vector< PathIntersectionType > | IntersectionType (std::function< const MapObject *(size_t)> aObject, size_t aObjectCount) const |
std::vector< PathIntersectionType > | IntersectionType (const MapObjectArray &aMapObjectArray) const |
std::vector< PathIntersectionInfo > | IntersectionInfo (std::function< const MapObject *(size_t)> aObject, size_t aObjectCount) const |
std::vector< PathIntersectionInfo > | IntersectionInfo (const MapObjectArray &aMapObjectArray) const |
bool | Intersects (const MapObject &aMapObject) const |
bool | Contains (const MapObject &aMapObject) const |
bool | Contained (const MapObject &aMapObject) const |
Geometry | Clip (ClipOperation aClipOperation, const MapObject &aMapObject) const |
std::vector< Geometry > | Clip (ClipOperation aClipOperation, const MapObjectArray &aMapObjectArray) const |
std::vector< Geometry > | Clip (ClipOperation aClipOperation, std::function< const MapObject *(size_t)> aObject, size_t aObjectCount) const |
Result | ConvertLinesToGreatCircles (double aMaxDistanceInMeters) |
GeneralGeometry () | |
GeneralGeometry (CartoTypeCore::CoordType aCoordType, bool aClosed=false) | |
GeneralGeometry (const MPath &aPath, CartoTypeCore::CoordType aCoordType, bool aClosed) | |
GeneralGeometry (const RectFP &aRect, CartoTypeCore::CoordType aCoordType) | |
GeneralGeometry (const point_t &aPoint, CartoTypeCore::CoordType aCoordType) | |
GeneralGeometry (const GeneralGeometry &aOther, size_t aContourIndex) | |
Public Member Functions inherited from CartoTypeCore::GeneralGeometry< OutlinePointFP > | |
GeneralGeometry () | |
GeneralGeometry (CartoTypeCore::CoordType aCoordType, bool aClosed=false) | |
GeneralGeometry (const MPath &aPath, CartoTypeCore::CoordType aCoordType, bool aClosed) | |
GeneralGeometry (const RectFP &aRect, CartoTypeCore::CoordType aCoordType) | |
GeneralGeometry (const OutlinePointFP &aPoint, CartoTypeCore::CoordType aCoordType) | |
GeneralGeometry (const GeneralGeometry &aOther, size_t aContourIndex) | |
operator Outline () const | |
void | Clear () |
CartoTypeCore::CoordType | CoordType () const |
size_t | ContourCount () const |
const contour_t & | ContourByIndex (size_t aIndex) const |
bool | ContourIsOuter (size_t aIndex) const |
size_t | PointCount (size_t aContourIndex) const |
const OutlinePointFP & | Point (size_t aContourIndex, size_t aPointIndex) const |
OutlinePointFP & | Point (size_t aContourIndex, size_t aPointIndex) |
bool | IsEmpty () const |
bool | IsClosed () const |
void | SetClosed (bool aClosed) |
WritableCoordSet | CoordSet (size_t aContourIndex) |
CartoTypeCore::CoordSet | CoordSet (size_t aContourIndex) const |
RectFP | Bounds () const |
void | AppendPoint (const OutlinePointFP &aPoint) |
void | AppendPoint (double aX, double aY) |
void | AppendPoint (double aX, double aY, PointType aPointType) |
void | BeginContour () |
void | Reverse () |
void | ConvertCoords (CartoTypeCore::CoordType aToCoordType, std::function< void(WritableCoordSet &aCoordSet)> aConvertFunction) |
Static Public Member Functions | |
static Geometry | Envelope (const MapObject &aMapObject, double aOffsetInMeters) |
Additional Inherited Members | |
Public Types inherited from CartoTypeCore::GeneralGeometry< OutlinePointFP > | |
using | contour_t = std::vector< OutlinePointFP > |
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.
Geometry CartoTypeCore::Geometry::Clip | ( | ClipOperation | aClipOperation, |
const MapObject & | 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< Geometry > CartoTypeCore::Geometry::Clip | ( | ClipOperation | aClipOperation, |
const MapObjectArray & | 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< Geometry > CartoTypeCore::Geometry::Clip | ( | ClipOperation | aClipOperation, |
std::function< const MapObject *(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.
Result CartoTypeCore::Geometry::ConvertLinesToGreatCircles | ( | double | aMaxDistanceInMeters | ) |
Interpolates points at a maximum distance apart to convert lines to great circles. Works only with degree coordinates, and with on-curve points.
|
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.
|
inline |
Creates an empty open geometry object using map coordinates.
|
inlineexplicit |
Creates a geometry object with given coordinates and open/closed status.
|
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.
PathIntersectionInfo CartoTypeCore::Geometry::IntersectionInfo | ( | const MapObject & | 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< PathIntersectionInfo > CartoTypeCore::Geometry::IntersectionInfo | ( | const MapObjectArray & | 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< PathIntersectionInfo > CartoTypeCore::Geometry::IntersectionInfo | ( | std::function< const MapObject *(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.
PathIntersectionType CartoTypeCore::Geometry::IntersectionType | ( | const MapObject & | aMapObject | ) | const |
Returns the intersection type of this geometry with a map object.
std::vector< PathIntersectionType > CartoTypeCore::Geometry::IntersectionType | ( | const MapObjectArray & | aMapObjectArray | ) | const |
Returns the intersection types of this geometry with an array of map objects.
std::vector< PathIntersectionType > CartoTypeCore::Geometry::IntersectionType | ( | std::function< const MapObject *(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.