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

#include <cartotype_path.h>

Inheritance diagram for CartoType::COutline:
CartoType::MPath

Public Member Functions

 COutline (const MPath &aPath)
 
 COutline (const TRect &aRect)
 
COutlineoperator= (const MPath &aPath)
 
COutlineoperator= (const TRect &aRect)
 
size_t Contours () const override
 
bool MayHaveCurves () const override
 
TContour Contour (size_t aIndex) const override
 
void AppendContour (CContour &&aContour)
 
void Clear ()
 
CContourAppendContour ()
 
void AppendContour (const MContour &aContour)
 
CContourContour (size_t aIndex)
 
void MapCoordinatesToLatLong (const CProjection &aProjection, int32_t aLatLongFractionalBits=16)
 
void LatLongToMapCoordinates (const CProjection &aProjection, int32_t aLatLongFractionalBits=16)
 
void RemoveData (std::vector< CContour > &aDest)
 
std::vector< CContour >::iterator begin ()
 
std::vector< CContour >::iterator end ()
 
std::vector< CContour >::const_iterator begin () const
 
std::vector< CContour >::const_iterator end () const
 
- 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
 

Static Public Member Functions

static COutline Read (TDataInputStream &aInput)
 

Detailed Description

The standard path class.

Constructor & Destructor Documentation

◆ COutline() [1/2]

CartoType::COutline::COutline ( const MPath aPath)

Creates a COutline from a path object.

◆ COutline() [2/2]

CartoType::COutline::COutline ( const TRect aRect)

Creates a COutline from a rectangle.

Member Function Documentation

◆ AppendContour() [1/3]

CContour & CartoType::COutline::AppendContour ( )
inline

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

◆ AppendContour() [2/3]

void CartoType::COutline::AppendContour ( CContour &&  aContour)
inline

Appends a contour.

◆ AppendContour() [3/3]

void CartoType::COutline::AppendContour ( const MContour aContour)
inline

Appends a contour to the outline.

◆ begin() [1/2]

std::vector< CContour >::iterator CartoType::COutline::begin ( )
inline

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

◆ begin() [2/2]

std::vector< CContour >::const_iterator CartoType::COutline::begin ( ) const
inline

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

◆ Clear()

void CartoType::COutline::Clear ( )
inline

Clears the outline by removing all contours.

◆ Contour() [1/2]

CContour & CartoType::COutline::Contour ( size_t  aIndex)
inline

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

◆ Contour() [2/2]

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

Returns the contour indexed by aIndex.

Implements CartoType::MPath.

◆ Contours()

size_t CartoType::COutline::Contours ( ) const
inlineoverridevirtual

Returns the number of contours.

Implements CartoType::MPath.

◆ end() [1/2]

std::vector< CContour >::iterator CartoType::COutline::end ( )
inline

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

◆ end() [2/2]

std::vector< CContour >::const_iterator CartoType::COutline::end ( ) const
inline

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

◆ LatLongToMapCoordinates()

void CartoType::COutline::LatLongToMapCoordinates ( const CProjection &  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 CartoType::COutline::MapCoordinatesToLatLong ( const CProjection &  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 CartoType::COutline::MayHaveCurves ( ) const
inlineoverridevirtual

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

Implements CartoType::MPath.

◆ operator=() [1/2]

COutline & CartoType::COutline::operator= ( const MPath aPath)

Sets this outline to a path object.

◆ operator=() [2/2]

COutline & CartoType::COutline::operator= ( const TRect aRect)

Sets this outline to a rectangle.

◆ Read()

COutline CartoType::COutline::Read ( TDataInputStream aInput)
static

Reads a serialized outline from a stream.

◆ RemoveData()

void CartoType::COutline::RemoveData ( std::vector< CContour > &  aDest)
inline

Removes the vector of contours and puts it into aDest.


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