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

#include <cartotype_path.h>

Inheritance diagram for CartoType::TContour:
CartoType::MContour CartoType::MPath

Classes

class  Iter
 
class  LineIter
 

Public Member Functions

 TContour ()
 
 TContour (const TOutlinePoint *aPoint, size_t aPoints, bool aClosed)
 
 TContour (const TPoint *aPoint, size_t aPoints, bool aClosed)
 
TContour Contour (size_t) const override
 
bool MayHaveCurves () const override
 
size_t Points () const override
 
TOutlinePoint Point (size_t aIndex) const override
 
bool Closed () const override
 
TContour SubContour (size_t aStart, size_t aPoints)
 
const TPointPointData () const
 
const TOutlinePointOutlinePointData () const
 
template<class MTraverser >
void Traverse (MTraverser &aTraverser, const TRect *aClip=nullptr) const
 
Iter begin () const
 
Iter end () const
 
LineIter begin_lines () const
 
LineIter end_lines () const
 
- 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

A TContour is a concrete class implementing MContour and designed to be returned by implementations of MPath.

Constructor & Destructor Documentation

◆ TContour() [1/3]

CartoType::TContour::TContour ( )
inline

Creates an empty contour.

◆ TContour() [2/3]

CartoType::TContour::TContour ( const TOutlinePoint aPoint,
size_t  aPoints,
bool  aClosed 
)
inline

Creates a contour from an array of TOutlinePoint objects.

◆ TContour() [3/3]

CartoType::TContour::TContour ( const TPoint aPoint,
size_t  aPoints,
bool  aClosed 
)
inline

Creates a contour from an array of TPoint objects.

Member Function Documentation

◆ begin()

Iter CartoType::TContour::begin ( ) const
inline

Returns a constant iterator positioned at the start of the points.

◆ begin_lines()

LineIter CartoType::TContour::begin_lines ( ) const
inline

Returns a constant iterator positioned at the start of the lines.

◆ Closed()

bool CartoType::TContour::Closed ( ) const
inlineoverridevirtual

Returns true if this is a closed contour.

Implements CartoType::MContour.

◆ Contour()

TContour CartoType::TContour::Contour ( size_t  aIndex) const
inlineoverridevirtual

Returns the contour indexed by aIndex.

Implements CartoType::MPath.

◆ end()

Iter CartoType::TContour::end ( ) const
inline

Returns a constant iterator positioned at the end of the points.

◆ end_lines()

LineIter CartoType::TContour::end_lines ( ) const
inline

Returns a constant iterator positioned at the end of the lines.

◆ MayHaveCurves()

bool CartoType::TContour::MayHaveCurves ( ) const
inlineoverridevirtual

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

Implements CartoType::MPath.

◆ OutlinePointData()

const TOutlinePoint * CartoType::TContour::OutlinePointData ( ) const
inline

Returns a pointer to start of the TOutlinePoint data if this contour may have off-curve points, otherwise returns null.

◆ Point()

TOutlinePoint CartoType::TContour::Point ( size_t  aIndex) const
inlineoverridevirtual

Returns a point selected by its index.

Implements CartoType::MContour.

◆ PointData()

const TPoint * CartoType::TContour::PointData ( ) const
inline

Returns a pointer to start of the TPoint data if this contour has only on-curve points, otherwise returns null.

◆ Points()

size_t CartoType::TContour::Points ( ) const
inlineoverridevirtual

Returns the number of points in the contour.

Implements CartoType::MContour.

◆ SubContour()

TContour CartoType::TContour::SubContour ( size_t  aStart,
size_t  aPoints 
)
inline

Returns a sub-contour of this contour, starting at the point indexed by aStart, and containing aPoints points.

◆ Traverse()

template<class MTraverser >
void CartoType::TContour::Traverse ( MTraverser &  aTraverser,
const TRect aClip = nullptr 
) const
inline

Traverses this contour, calling the functions defined by aTraverser to handle moves, lines, and curves. Clips the output to aClip if aClip is non-null.


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