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

#include <cartotype_path.h>

Inheritance diagram for CartoTypeCore::MWritableContour:
CartoTypeCore::MContour CartoTypeCore::MPath CartoTypeCore::ContourBase< OutlinePoint > CartoTypeCore::ContourBase< Point > CartoTypeCore::ContourBase< T > CartoTypeCore::SimpleContourData CartoTypeCore::WritableContourView CartoTypeCore::Contour CartoTypeCore::OnCurveContour

Public Member Functions

MWritableContouroperator= (const MContour &aContour)
 
virtual void SetPoint (size_t aIndex, const OutlinePoint &aPoint)=0
 
virtual void ReduceSizeTo (size_t aPoints)=0
 
virtual void SetSize (size_t aPoints)=0
 
virtual void SetClosed (bool aClosed)=0
 
virtual void AppendPoint (const OutlinePoint &aPoint)=0
 
virtual OutlinePointOutlinePointData ()=0
 
virtual CartoTypeCore::PointPointData ()=0
 
void Offset (int32_t aDx, int32_t aDy)
 
void AppendContour (const ContourView &aContour)
 
void SetLastPoint (const OutlinePoint &aPoint)
 
void Simplify (double aResolutionArea)
 
void AppendCircularArc (const CartoTypeCore::Point &aCenter, const CartoTypeCore::Point &aStart, const CartoTypeCore::Point &aEnd, EllipseAngleType aAngleType=EllipseAngleType::Shortest, bool aAppendStart=false)
 
void AppendHalfCircle (const CartoTypeCore::Point &aCenter, const CartoTypeCore::Point &aStart, const CartoTypeCore::Point &aEnd, EllipseAngleType aAngleType=EllipseAngleType::Shortest, bool aAppendStart=false)
 
void AppendHalfCircle (double aCx, double aCy, double aSx, double aSy, double aEx, double aEy, double aRadius, bool aAppendStart, bool aIsExactHalfCircle, bool aClockwise)
 
void AppendQuadrant (double aCx, double aCy, double aSx, double aSy, double aEx, double aEy, double aRadius, bool aAppendStart, bool aIsExactQuadrant, bool aClockwise)
 
- Public Member Functions inherited from CartoTypeCore::MContour
virtual size_t Points () const =0
 
virtual OutlinePoint Point (size_t aIndex) const =0
 
virtual bool Closed () const =0
 
 operator ContourView () const
 
size_t Contours () const
 
OutlinePoint LastPoint () const
 
OutlinePoint FractionalPoint (double aIndex) const
 
bool IsGridOrientedRectangle (Rect *aRect=nullptr) const
 
bool Anticlockwise () const
 
PolygonOrientation Orientation () const
 
bool Contains (double aX, double aY) const
 
bool Contains (const CartoTypeCore::Point &aPoint) const
 
Outline ClippedContour (const Rect &aClip) const
 
void AppendClippedContour (Outline &aDest, const Rect &aClip) const
 
size_t AppendSplitContour (Outline &aDest, const PointFP &aLineStart, const PointFP &aLineVector)
 
Contour TruncatedContour (double aStart, double aEnd) const
 
Contour SubContourBetweenFractionalPoints (double aStartIndex, double aEndIndex) const
 
Contour SubContourBetweenNearestPoints (const PointFP *aStartPoint, const PointFP *aEndPoint) const
 
Contour CentralPath (std::shared_ptr< CEngine > aEngine, const Rect &aClip, bool aFractionalPixels, Line &aFallbackLine, bool aFallbackMustBeHorizontal) const
 
Contour Smooth (double aRadius) const
 
Contour ConcaveHull (double aMaxEdgeLength, PolygonOrientation aAssumedOrientation=PolygonOrientation::None) const
 
bool MayIntersect (const Rect &aRect) const
 
bool Intersects (const Rect &aRect) const
 
PathIntersectionType IntersectionType (const MContour &aOther, double *aDistance=nullptr, PointFP *aNearest1=nullptr, PointFP *aNearest2=nullptr) const
 
PathIntersectionInfo IntersectionInfo (const MContour &aOther) const
 
double DistanceFrom (const MContour &aOther, PointFP *aNearest1=nullptr, PointFP *aNearest2=nullptr, PathIntersectionType *aType=nullptr) const
 
double DistanceFromPoint (const PointFP &aPoint, PointFP *aNearest=nullptr, double *aNearestLength=nullptr, bool *aLeft=nullptr, size_t *aLineIndex=nullptr, double *aFractionalLineIndex=nullptr, bool aTreatAsOpen=false) const
 
PointFP PointAtLength (double aLength, double aOffset=0, int32_t *aLineIndex=nullptr) const
 
CartoTypeCore::Point Orientation (const CartoTypeCore::Point &aCenter) const
 
void GetPrincipalAxis (PointFP &aCenter, PointFP &aVector) const
 
void Write (OutputStream &aOutput) const
 
void GetAngles (double aDistance, double &aStartAngle, double &aEndAngle)
 
- 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
 

Detailed Description

An interface class for writable contour data.

Member Function Documentation

◆ AppendCircularArc()

void CartoTypeCore::MWritableContour::AppendCircularArc ( const CartoTypeCore::Point aCenter,
const CartoTypeCore::Point aStart,
const CartoTypeCore::Point aEnd,
EllipseAngleType  aAngleType = EllipseAngleType::Shortest,
bool  aAppendStart = false 
)

Append an arc of a circle. The input points are in 64ths of pixels, and must be within the 22 bit range -2097152..2097152. if aAppendStart is true, the start point is also appended to the contour. Some code duplicated with appending of elliptical arc for performance reasons.

◆ AppendContour()

void CartoTypeCore::MWritableContour::AppendContour ( const ContourView aContour)

Appends the points of a contour to this contour.

◆ AppendHalfCircle() [1/2]

void CartoTypeCore::MWritableContour::AppendHalfCircle ( const CartoTypeCore::Point aCenter,
const CartoTypeCore::Point aStart,
const CartoTypeCore::Point aEnd,
EllipseAngleType  aAngleType = EllipseAngleType::Shortest,
bool  aAppendStart = false 
)

Append half circle. The input points are in 64ths of pixels, and must be within the 22 bit range -2097152..2097152. if aAppendStart is true, the start point is also appended to the contour. High performance version of AppendCircularArc.

◆ AppendHalfCircle() [2/2]

void CartoTypeCore::MWritableContour::AppendHalfCircle ( double  aCx,
double  aCy,
double  aSx,
double  aSy,
double  aEx,
double  aEy,
double  aRadius,
bool  aAppendStart,
bool  aIsExactHalfCircle,
bool  aClockwise 
)

Append a half circle or less.

◆ AppendPoint()

virtual void CartoTypeCore::MWritableContour::AppendPoint ( const OutlinePoint aPoint)
pure virtual

◆ AppendQuadrant()

void CartoTypeCore::MWritableContour::AppendQuadrant ( double  aCx,
double  aCy,
double  aSx,
double  aSy,
double  aEx,
double  aEy,
double  aRadius,
bool  aAppendStart,
bool  aIsExactQuadrant,
bool  aClockwise 
)

Append a small (90 degrees or less) arc of a circle.

aCx X coordinate of centre. aCy Y coordinate of centre. aSx X part of vector to start point. aSy Y part of vector to start point. aEx X part of vector to end point. aEy Y part of vector to end point. aAppendStart if true, append the start point.

◆ Offset()

void CartoTypeCore::MWritableContour::Offset ( int32_t  aDx,
int32_t  aDy 
)
inline

Offsets all the points by (aDx,aDy).

◆ operator=()

MWritableContour & CartoTypeCore::MWritableContour::operator= ( const MContour aContour)
inline

The assignment operator.

◆ OutlinePointData()

virtual OutlinePoint * CartoTypeCore::MWritableContour::OutlinePointData ( )
pure virtual

◆ PointData()

virtual CartoTypeCore::Point * CartoTypeCore::MWritableContour::PointData ( )
pure virtual

◆ ReduceSizeTo()

virtual void CartoTypeCore::MWritableContour::ReduceSizeTo ( size_t  aPoints)
pure virtual

◆ SetClosed()

virtual void CartoTypeCore::MWritableContour::SetClosed ( bool  aClosed)
pure virtual

◆ SetLastPoint()

void CartoTypeCore::MWritableContour::SetLastPoint ( const OutlinePoint aPoint)
inline

Sets the last point to aPoint.

◆ SetPoint()

virtual void CartoTypeCore::MWritableContour::SetPoint ( size_t  aIndex,
const OutlinePoint aPoint 
)
pure virtual

◆ SetSize()

virtual void CartoTypeCore::MWritableContour::SetSize ( size_t  aPoints)
pure virtual

◆ Simplify()

void CartoTypeCore::MWritableContour::Simplify ( double  aResolutionArea)

Simplifies a contour by removing all points with an area less than aResolutionArea. A point's area is the area of the triangle made by the point and its two neighbours.

The start and end of an open contour are not removed. Closed contours may be reduced to nothing.


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