CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Static Public Member Functions | List of all members
CartoTypeCore::Outline Class Reference

#include <cartotype_path.h>

Inheritance diagram for CartoTypeCore::Outline:
CartoTypeCore::MPath

Public Member Functions

 Outline (const MPath &aPath)
 
 Outline (const Rect &aRect)
 
Outlineoperator= (const MPath &aPath)
 
Outlineoperator= (const Rect &aRect)
 
size_t Contours () const override
 
bool MayHaveCurves () const override
 
ContourView ContourByIndex (size_t aIndex) const override
 
void AppendContour (Contour &&aContour)
 
void Clear ()
 
ContourAppendContour ()
 
void AppendContour (const MContour &aContour)
 
ContourContourByIndex (size_t aIndex)
 
void MapCoordinatesToLatLong (const Projection &aProjection, int32_t aLatLongFractionalBits=16)
 
void LatLongToMapCoordinates (const Projection &aProjection, int32_t aLatLongFractionalBits=16)
 
void RemoveData (std::vector< Contour > &aDest)
 
std::vector< Contour >::iterator begin ()
 
std::vector< Contour >::iterator end ()
 
std::vector< Contour >::const_iterator begin () const
 
std::vector< Contour >::const_iterator end () const
 
- Public Member Functions inherited from CartoTypeCore::MPath
virtual ~MPath ()
 
virtual size_t Contours () const =0
 
virtual ContourView ContourByIndex (size_t aIndex) const =0
 
virtual bool MayHaveCurves () const =0
 
template<class MPathTraverser >
void Traverse (MPathTraverser &aTraverser, const Rect &aClip) const
 
template<class MPathTraverser >
void Traverse (MPathTraverser &aTraverser, const Rect *aClip=nullptr) const
 
bool operator== (const MPath &aOther) const
 
Rect CBox () const
 
bool CBoxBiggerThan (int32_t aSize) const
 
bool IsContainedIn (const Rect &aRect) const
 
bool Contains (double aX, double aY) const
 
bool Contains (const Point &aPoint) const
 
bool Contains (const PointFP &aPoint) const
 
bool MayIntersect (const Rect &aRect) const
 
bool MayIntersect (const Rect &aRect, int32_t aBorder) const
 
bool Intersects (const Rect &aRect) const
 
bool Intersects (const MPath &aPath, const Rect *aBounds=nullptr) const
 
int32_t MaxDistanceFromOrigin () const
 
PathIntersectionType IntersectionType (const MPath &aOther, double *aDistance=nullptr, PointFP *aNearest1=nullptr, PointFP *aNearest2=nullptr) const
 
PathIntersectionInfo IntersectionInfo (const MPath &aOther) const
 
double DistanceFrom (const MPath &aOther, PointFP *aNearest1=nullptr, PointFP *aNearest2=nullptr, PathIntersectionType *aType=nullptr) const
 
double DistanceFromPoint (const PointFP &aPoint, PointFP *aNearest=nullptr, size_t *aContourIndex=nullptr, size_t *aLineIndex=nullptr, double *aFractionaLineIndex=nullptr, bool aTreatAsOpen=false) const
 
bool IsClippingNeeded (const Rect &aClip) const
 
Outline Copy () const
 
Outline ClippedPath (const Rect &aClip) const
 
Outline ClippedPath (const MPath &aClip) const
 
Outline ClippedPath (const ClipRegion &aClip) const
 
Outline Clip (ClipOperation aClipOperation, const MPath &aClip) const
 
Outline Envelope (double aOffset) const
 
Outline ConcaveHull (double aMaxEdgeLength, PolygonOrientation aAssumedOrientation=PolygonOrientation::None) const
 
bool IsSmoothingNeeded () const
 
Outline SmoothPath () const
 
Outline FlatPath (double aMaxDistance) const
 
Outline TruncatedPath (double aStart, double aEnd) const
 
Outline OffsetPath (double aOffset) const
 
Outline TransformedPath (const AffineTransform &aTransform) const
 
Outline TransformedPath (DrawResult &aError, MPointTransformer &aTransformer, int32_t aFractionalBits) const
 
Outline Interpolate (int32_t aGranularity) const
 
std::array< Line, 3 > HorizontalPaths (GraphicsContext *aGc, int32_t aPathLength, int32_t aLabelAscent, int32_t aLabelDescent, const PointFP &aUpVector, const Rect *aBounds, const Rect *aClip) const
 
PointFP CenterOfGravity () const
 
double Length () const
 
double Area () const
 
PointFP PointAtLength (double aPos) const
 
std::pair< Point, bool > End () const
 
void Write (OutputStream &aOutput) const
 
void WriteAsXml (OutputStream &aOutput) const
 
bool IsEmpty () const
 
bool IsPoint () const
 
bool IsGridOrientedRectangle (Rect *aRect=nullptr) const
 
void GetSphericalAreaAndLength (const Projection &aProjection, double *aArea, double *aLength) const
 
CartoTypeCore::ClipType ClipType (const Rect &aRect) const
 
bool HasCurves () const
 
size_t PointCount () const
 
ConstIter begin () const
 
ConstIter end () const
 

Static Public Member Functions

static Outline Read (InputStream &aInput)
 
static Outline ReadFromXml (InputStream &aInput)
 

Detailed Description

The standard path class.

Constructor & Destructor Documentation

◆ Outline() [1/2]

CartoTypeCore::Outline::Outline ( const MPath aPath)

Creates an Outline from a path object.

◆ Outline() [2/2]

CartoTypeCore::Outline::Outline ( const Rect aRect)

Creates an Outline from a rectangle.

Member Function Documentation

◆ AppendContour() [1/3]

Contour & CartoTypeCore::Outline::AppendContour ( )
inline

Appends a new empty contour to the outline and returns it.

◆ AppendContour() [2/3]

void CartoTypeCore::Outline::AppendContour ( const MContour aContour)
inline

Appends a contour to the outline.

◆ AppendContour() [3/3]

void CartoTypeCore::Outline::AppendContour ( Contour &&  aContour)
inline

Appends a contour.

◆ begin() [1/2]

std::vector< Contour >::iterator CartoTypeCore::Outline::begin ( )
inline

Returns an iterator to the start of the vector of contours.

◆ begin() [2/2]

std::vector< Contour >::const_iterator CartoTypeCore::Outline::begin ( ) const
inline

Returns a constant iterator to the start of the vector of contours.

◆ Clear()

void CartoTypeCore::Outline::Clear ( )
inline

Clears the outline by removing all contours.

◆ ContourByIndex() [1/2]

Contour & CartoTypeCore::Outline::ContourByIndex ( size_t  aIndex)
inline

Return a non-constant reference to a contour, selected by its index.

◆ ContourByIndex() [2/2]

ContourView CartoTypeCore::Outline::ContourByIndex ( size_t  aIndex) const
inlineoverridevirtual

Returns the contour indexed by aIndex.

Implements CartoTypeCore::MPath.

◆ Contours()

size_t CartoTypeCore::Outline::Contours ( ) const
inlineoverridevirtual

Returns the number of contours.

Implements CartoTypeCore::MPath.

◆ end() [1/2]

std::vector< Contour >::iterator CartoTypeCore::Outline::end ( )
inline

Returns an iterator to the end of the vector of contours.

◆ end() [2/2]

std::vector< Contour >::const_iterator CartoTypeCore::Outline::end ( ) const
inline

Returns a constant iterator to the end of the vector of contours.

◆ LatLongToMapCoordinates()

void CartoTypeCore::Outline::LatLongToMapCoordinates ( const Projection &  aProjection,
int32_t  aLatLongFractionalBits = 16 
)

Project an outline from degrees lat/long to map coordinates using the supplied projection. The input point format is degrees in fixed point form with a number of fractional bits determined by aLatLongFractionalBits (default = 16).

◆ MapCoordinatesToLatLong()

void CartoTypeCore::Outline::MapCoordinatesToLatLong ( const Projection &  aProjection,
int32_t  aLatLongFractionalBits = 16 
)

Project an outline to degrees lat/long using the inverse of the supplied projection. The output point format is degrees in fixed point form with a number of fractional bits determined by aLatLongFractionalBits (default = 16).

◆ MayHaveCurves()

bool CartoTypeCore::Outline::MayHaveCurves ( ) const
inlineoverridevirtual

Returns true if the path may have off-curve points.

Implements CartoTypeCore::MPath.

◆ operator=() [1/2]

Outline & CartoTypeCore::Outline::operator= ( const MPath aPath)

Sets this outline to a path object.

◆ operator=() [2/2]

Outline & CartoTypeCore::Outline::operator= ( const Rect aRect)

Sets this outline to a rectangle.

◆ Read()

Outline CartoTypeCore::Outline::Read ( InputStream aInput)
static

Reads a serialized outline from a stream.

◆ ReadFromXml()

Outline CartoTypeCore::Outline::ReadFromXml ( InputStream aInput)
static

Reads an outline from XML.

See also
MPath::WriteAsXml for the format.

◆ RemoveData()

void CartoTypeCore::Outline::RemoveData ( std::vector< Contour > &  aDest)
inline

Removes the vector of contours and puts it into aDest.


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