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::LineFP Class Reference

#include <cartotype_arithmetic.h>

Public Member Functions

 LineFP (const PointFP &aStart, const PointFP &aEnd)
 
double Length () const
 
const PointFPStart () const
 
const PointFPEnd () const
 
bool DistanceExceeds (double aX1, double aY1, double aX2, double aY2, int32_t aPoints, double aMaxDistance) const
 
PointFP PointAtLength (double aLength) const
 
LineFP Reverse () const
 

Detailed Description

A straight line or line segment defined using floating-point numbers.

Constructor & Destructor Documentation

◆ LineFP()

CartoTypeCore::LineFP::LineFP ( const PointFP aStart,
const PointFP aEnd 
)
inline

Creates a line from aStart to aEnd.

Member Function Documentation

◆ DistanceExceeds()

bool CartoTypeCore::LineFP::DistanceExceeds ( double  aX1,
double  aY1,
double  aX2,
double  aY2,
int32_t  aPoints,
double  aMaxDistance 
) const

Returns true if the distance from the line segment of either of the one or two supplied points exceeds aMaxDistance. This function is used when flattening curved paths, for finding whether the path is flat enough, which is when all the control points are near enough to the line segments.

◆ End()

const PointFP & CartoTypeCore::LineFP::End ( ) const
inline

Returns the end of the line segment.

◆ Length()

double CartoTypeCore::LineFP::Length ( ) const
inline

Returns the length of the line segment.

◆ PointAtLength()

PointFP CartoTypeCore::LineFP::PointAtLength ( double  aLength) const

Returns a point at a certain length along a line in aPoint. aLength can be negative, or beyond the end of the line. In these cases the line is extended in the same direction.

◆ Reverse()

LineFP CartoTypeCore::LineFP::Reverse ( ) const
inline

Returns a reversed copy of this line.

◆ Start()

const PointFP & CartoTypeCore::LineFP::Start ( ) const
inline

Returns the start of the line segment.


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