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

#include <cartotype_path.h>

Inheritance diagram for CartoTypeCore::ContourView:
CartoTypeCore::MContour CartoTypeCore::MPath

Classes

class  Iter
 
class  LineIter
 

Public Member Functions

 ContourView ()
 
 ContourView (const OutlinePoint *aPoint, size_t aPoints, bool aClosed)
 
 ContourView (const CartoTypeCore::Point *aPoint, size_t aPoints, bool aClosed)
 
ContourView ContourByIndex (size_t) const override
 
bool MayHaveCurves () const override
 
size_t Points () const override
 
OutlinePoint Point (size_t aIndex) const override
 
bool Closed () const override
 
ContourView SubContour (size_t aStart, size_t aPoints)
 
const CartoTypeCore::PointPointData () const
 
const OutlinePointOutlinePointData () const
 
template<class MTraverser >
void Traverse (MTraverser &aTraverser, const Rect *aClip=nullptr) const
 
Iter begin () const
 
Iter end () const
 
LineIter begin_lines () const
 
LineIter end_lines () const
 
- 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

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

Constructor & Destructor Documentation

◆ ContourView() [1/3]

CartoTypeCore::ContourView::ContourView ( )
inline

Creates an empty contour.

◆ ContourView() [2/3]

CartoTypeCore::ContourView::ContourView ( const OutlinePoint aPoint,
size_t  aPoints,
bool  aClosed 
)
inline

Creates a contour from an array of OutlinePoint objects.

◆ ContourView() [3/3]

CartoTypeCore::ContourView::ContourView ( const CartoTypeCore::Point aPoint,
size_t  aPoints,
bool  aClosed 
)
inline

Creates a contour from an array of Point objects.

Member Function Documentation

◆ begin()

Iter CartoTypeCore::ContourView::begin ( ) const
inline

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

◆ begin_lines()

LineIter CartoTypeCore::ContourView::begin_lines ( ) const
inline

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

◆ Closed()

bool CartoTypeCore::ContourView::Closed ( ) const
inlineoverridevirtual

Returns true if this is a closed contour.

Implements CartoTypeCore::MContour.

◆ ContourByIndex()

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

Returns the contour indexed by aIndex.

Implements CartoTypeCore::MPath.

◆ end()

Iter CartoTypeCore::ContourView::end ( ) const
inline

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

◆ end_lines()

LineIter CartoTypeCore::ContourView::end_lines ( ) const
inline

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

◆ MayHaveCurves()

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

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

Implements CartoTypeCore::MPath.

◆ OutlinePointData()

const OutlinePoint * CartoTypeCore::ContourView::OutlinePointData ( ) const
inline

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

◆ Point()

OutlinePoint CartoTypeCore::ContourView::Point ( size_t  aIndex) const
inlineoverridevirtual

Returns a point selected by its index.

Implements CartoTypeCore::MContour.

◆ PointData()

const CartoTypeCore::Point * CartoTypeCore::ContourView::PointData ( ) const
inline

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

◆ Points()

size_t CartoTypeCore::ContourView::Points ( ) const
inlineoverridevirtual

Returns the number of points in the contour.

Implements CartoTypeCore::MContour.

◆ SubContour()

ContourView CartoTypeCore::ContourView::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 CartoTypeCore::ContourView::Traverse ( MTraverser &  aTraverser,
const Rect 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: