CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | List of all members
CartoType::MWritableContour Class Referenceabstract

#include <cartotype_path.h>

Inheritance diagram for CartoType::MWritableContour:
CartoType::MContour CartoType::MPath CartoType::CContourBase< TOutlinePoint > CartoType::CContourBase< TPoint > CartoType::CContourBase< T > CartoType::TSimpleContourData CartoType::TWritableContour CartoType::CContour CartoType::COnCurveContour

Public Member Functions

MWritableContouroperator= (const MContour &aContour)
 
virtual void SetPoint (size_t aIndex, const TOutlinePoint &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 TOutlinePoint &aPoint)=0
 
virtual TOutlinePointOutlinePointData ()=0
 
virtual TPointPointData ()=0
 
void Offset (int32_t aDx, int32_t aDy)
 
void AppendContour (const TContour &aContour)
 
void SetLastPoint (const TOutlinePoint &aPoint)
 
void Simplify (double aResolutionArea)
 
void AppendCircularArc (const TPoint &aCenter, const TPoint &aStart, const TPoint &aEnd, TEllipseAngleType aAngleType=TEllipseAngleType::Shortest, bool aAppendStart=false)
 
void AppendHalfCircle (const TPoint &aCenter, const TPoint &aStart, const TPoint &aEnd, TEllipseAngleType aAngleType=TEllipseAngleType::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 CartoType::MContour
virtual size_t Points () const =0
 
virtual TOutlinePoint Point (size_t aIndex) const =0
 
virtual bool Closed () const =0
 
 operator TContour () const
 
size_t Contours () const
 
TOutlinePoint LastPoint () const
 
TOutlinePoint FractionalPoint (double aIndex) const
 
bool IsGridOrientedRectangle (TRect *aRect=nullptr) const
 
bool Anticlockwise () const
 
bool Contains (double aX, double aY) const
 
bool Contains (const TPoint &aPoint) const
 
COutline ClippedContour (const TRect &aClip) const
 
void AppendClippedContour (COutline &aDest, const TRect &aClip) const
 
size_t AppendSplitContour (COutline &aDest, const TPointFP &aLineStart, const TPointFP &aLineVector)
 
CContour TruncatedContour (double aStart, double aEnd) const
 
CContour SubContourBetweenFractionalPoints (double aStartIndex, double aEndIndex) const
 
CContour SubContourBetweenNearestPoints (const TPointFP *aStartPoint, const TPointFP *aEndPoint) const
 
CContour CentralPath (std::shared_ptr< CEngine > aEngine, const TRect &aClip, bool aFractionalPixels, TLine &aFallbackLine, bool aFallbackMustBeHorizontal) const
 
CContour Smooth (double aRadius) const
 
bool MayIntersect (const TRect &aRect) const
 
bool Intersects (const TRect &aRect) const
 
TPathIntersectionType IntersectionType (const MContour &aOther, double *aDistance=nullptr, TPointFP *aNearest1=nullptr, TPointFP *aNearest2=nullptr) const
 
TPathIntersectionInfo IntersectionInfo (const MContour &aOther) const
 
double DistanceFrom (const MContour &aOther, TPointFP *aNearest1=nullptr, TPointFP *aNearest2=nullptr, TPathIntersectionType *aType=nullptr) const
 
double DistanceFromPoint (const TPointFP &aPoint, TPointFP *aNearest=nullptr, double *aNearestLength=nullptr, bool *aLeft=nullptr, size_t *aLineIndex=nullptr, double *aFractionalLineIndex=nullptr, bool aTreatAsOpen=false) const
 
TPointFP PointAtLength (double aLength, double aOffset=0, int32_t *aLineIndex=nullptr) const
 
void GetOrientation (const TPoint &aCenter, TPoint &aOrientation) const
 
void GetPrincipalAxis (TPointFP &aCenter, TPointFP &aVector) const
 
void Write (TDataOutputStream &aOutput) const
 
void GetAngles (double aDistance, double &aStartAngle, double &aEndAngle)
 
- Public Member Functions inherited from CartoType::MPath
virtual ~MPath ()
 
virtual size_t Contours () const =0
 
virtual TContour Contour (size_t aIndex) const =0
 
virtual bool MayHaveCurves () const =0
 
template<class MPathTraverser >
void Traverse (MPathTraverser &aTraverser, const TRect &aClip) const
 
template<class MPathTraverser >
void Traverse (MPathTraverser &aTraverser, const TRect *aClip=nullptr) const
 
bool operator== (const MPath &aOther) const
 
TRect CBox () const
 
bool CBoxBiggerThan (int32_t aSize) const
 
bool IsContainedIn (const TRect &aRect) const
 
bool Contains (double aX, double aY) const
 
bool Contains (const TPoint &aPoint) const
 
bool Contains (const TPointFP &aPoint) const
 
bool MayIntersect (const TRect &aRect) const
 
bool MayIntersect (const TRect &aRect, int32_t aBorder) const
 
bool Intersects (const TRect &aRect) const
 
bool Intersects (const MPath &aPath, const TRect *aBounds=nullptr) const
 
int32_t MaxDistanceFromOrigin () const
 
TPathIntersectionType IntersectionType (const MPath &aOther, double *aDistance=nullptr, TPointFP *aNearest1=nullptr, TPointFP *aNearest2=nullptr) const
 
TPathIntersectionInfo IntersectionInfo (const MPath &aOther) const
 
double DistanceFrom (const MPath &aOther, TPointFP *aNearest1=nullptr, TPointFP *aNearest2=nullptr, TPathIntersectionType *aType=nullptr) const
 
double DistanceFromPoint (const TPointFP &aPoint, TPointFP *aNearest=nullptr, size_t *aContourIndex=nullptr, size_t *aLineIndex=nullptr, double *aFractionaLineIndex=nullptr, bool aTreatAsOpen=false) const
 
bool IsClippingNeeded (const TRect &aClip) const
 
COutline Copy () const
 
COutline ClippedPath (const TRect &aClip) const
 
COutline ClippedPath (const MPath &aClip) const
 
COutline ClippedPath (const TClipRegion &aClip) const
 
COutline Clip (TClipOperation aClipOperation, const MPath &aClip) const
 
COutline Envelope (double aOffset) const
 
bool IsSmoothingNeeded () const
 
COutline SmoothPath () const
 
COutline FlatPath (double aMaxDistance) const
 
COutline TruncatedPath (double aStart, double aEnd) const
 
COutline OffsetPath (double aOffset) const
 
COutline TransformedPath (const TTransform &aTransform) const
 
COutline TransformedPath (TDrawResult &aError, MPointTransformer &aTransformer, int32_t aFractionalBits) const
 
std::array< TLine, 3 > GetHorizontalPaths (int32_t aPathLength, int32_t aLabelHeight, const TPointFP &aUpVector, const TRect *aBounds, const TRect *aClip) const
 
TPointFP CenterOfGravity () const
 
void GetCenterOfGravity (TPoint &aCenter) const
 
double Length () const
 
double Area () const
 
TPointFP PointAtLength (double aPos) const
 
std::pair< TPoint, bool > End () const
 
void Write (TDataOutputStream &aOutput) const
 
bool IsEmpty () const
 
bool IsPoint () const
 
bool IsGridOrientedRectangle (TRect *aRect=nullptr) const
 
void GetSphericalAreaAndLength (const CProjection &aProjection, double *aArea, double *aLength) const
 
TClipType ClipType (const TRect &aRect) const
 
bool HasCurves () const
 
ConstIter begin () const
 
ConstIter end () const
 

Detailed Description

An interface class for writable contour data.

Member Function Documentation

◆ AppendCircularArc()

void CartoType::MWritableContour::AppendCircularArc ( const TPoint aCenter,
const TPoint aStart,
const TPoint aEnd,
TEllipseAngleType  aAngleType = TEllipseAngleType::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 CartoType::MWritableContour::AppendContour ( const TContour aContour)

Appends the points of a contour to this contour.

◆ AppendHalfCircle() [1/2]

void CartoType::MWritableContour::AppendHalfCircle ( const TPoint aCenter,
const TPoint aStart,
const TPoint aEnd,
TEllipseAngleType  aAngleType = TEllipseAngleType::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 CartoType::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 CartoType::MWritableContour::AppendPoint ( const TOutlinePoint aPoint)
pure virtual

◆ AppendQuadrant()

void CartoType::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 CartoType::MWritableContour::Offset ( int32_t  aDx,
int32_t  aDy 
)
inline

Offsets all the points by (aDx,aDy).

◆ operator=()

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

The assignment operator.

◆ OutlinePointData()

virtual TOutlinePoint * CartoType::MWritableContour::OutlinePointData ( )
pure virtual

Returns a writable pointer to TOutlinePoint data if possible.

Implemented in CartoType::TSimpleContourData, CartoType::CContour, CartoType::COnCurveContour, and CartoType::TWritableContour.

◆ PointData()

virtual TPoint * CartoType::MWritableContour::PointData ( )
pure virtual

Returns a writable pointer to TPoint data if possible.

Implemented in CartoType::TSimpleContourData, CartoType::CContour, CartoType::COnCurveContour, and CartoType::TWritableContour.

◆ ReduceSizeTo()

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

Reduces the number of points to aPoints. The address of the points must not change.

Implemented in CartoType::TSimpleContourData, CartoType::CContourBase< T >, CartoType::CContourBase< TOutlinePoint >, CartoType::CContourBase< TPoint >, and CartoType::TWritableContour.

◆ SetClosed()

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

Sets this contour's closed attribute. Does nothing if that is not possible.

Implemented in CartoType::TSimpleContourData, CartoType::CContourBase< T >, CartoType::CContourBase< TOutlinePoint >, CartoType::CContourBase< TPoint >, and CartoType::TWritableContour.

◆ SetLastPoint()

void CartoType::MWritableContour::SetLastPoint ( const TOutlinePoint aPoint)
inline

Sets the last point to aPoint.

◆ SetPoint()

virtual void CartoType::MWritableContour::SetPoint ( size_t  aIndex,
const TOutlinePoint aPoint 
)
pure virtual

◆ SetSize()

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

Sets the number of points to aPoints. The address of the points may change.

Implemented in CartoType::TSimpleContourData, CartoType::TWritableContour, CartoType::CContourBase< T >, CartoType::CContourBase< TOutlinePoint >, and CartoType::CContourBase< TPoint >.

◆ Simplify()

void CartoType::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: