CartoType API
Public Types | Public Member Functions | Static Public Member Functions
CartoType::CContour Class Reference

#include <cartotype_graphics.h>

Inheritance diagram for CartoType::CContour:
CartoType::MPath CartoType::MWritableContour CartoType::CMarker

List of all members.

Public Types

enum  TEllipseAngleType { EShortest, ELongest, EPositive, ENegative }

Public Member Functions

 CContour ()
int32 Contours () const
void GetContour (int32, TContour &aContour) const
TOutlinePointPoint ()
int32 Points ()
void ReduceSizeTo (int32 aPoints)
TResult AppendPoint (const TOutlinePoint &aPoint)
TResult AppendPointEvenIfSame (const TOutlinePoint &aPoint)
TResult AppendPoints (const TOutlinePoint *aPoint, int32 aPoints)
void Clear ()
void SetSizeToZero ()
TResult SetSize (int32 aSize)
void ReplacePoint (int32 aIndex, const TOutlinePoint &aPoint)
void ReplaceLastPoint (const TOutlinePoint &aPoint)
void RemovePoint (int32 aIndex)
void RemovePoints (int32 aIndex, int32 aCount)
TResult AppendTransformedPointFixed (const TTransform &aTransform, const TPointFixed &aPoint, TPointType aPointType)
TResult AppendPointFixed (const TPointFixed &aPoint, TPointType aPointType)
TResult AppendPointDouble (double aX, double aY, TPointType aPointType)
TResult ReservePoints (int32 aCount)
const TOutlinePointPoint () const
const TOutlinePointPoint (int32 aIndex) const
int32 Points () const
 operator TContour () const
int32 MemoryUsed () const
CT_IMPORT TResult AppendCircularArc (const TPoint &aCenter, const TPoint &aStart, const TPoint &aEnd, TEllipseAngleType aAngleType=EShortest, bool aAppendStart=false)
CT_IMPORT TResult AppendHalfCircle (const TPoint &aCenter, const TPoint &aStart, const TPoint &aEnd, TEllipseAngleType aAngleType=EShortest, bool aAppendStart=false)
CT_IMPORT TResult AppendEllipticalArc (const TPoint &aCenter, const TFixed &aRX, const TFixed &aRY, const TFixedSmall &aEllipseAngle, const TFixedSmall &aStartAngle, const TFixedSmall &aEndAngle, TEllipseAngleType aAngleType=EShortest, bool aAppendStart=false)
CT_IMPORT TResult AppendEllipticalArc (const TPoint &aStart, const TFixed &aRX, const TFixed &aRY, const TFixedSmall &aEllipseAngle, bool aLargeArc, bool aSweep, const TPoint &aEnd, bool aAppendStart=false)
bool Closed () const
void SetClosed (bool aClosed)
CT_IMPORT void Transform (const TTransform &aTransform)
CT_IMPORT void Offset (int32 aDx, int32 aDy)
CT_IMPORT int32 Length () const
CT_IMPORT TResult AppendHalfCircle (double aCx, double aCy, double aSx, double aSy, double aEx, double aEy, double aRadius, bool aAppendStart, bool aIsExactHalfCircle, bool aClockwise)
CT_IMPORT TResult AppendQuadrant (double aCx, double aCy, double aSx, double aSy, double aEx, double aEy, double aRadius, bool aAppendStart, bool aIsExactQuadrant, bool aClockwise)

Static Public Member Functions

static CT_IMPORT CContourEllipse (TResult &aError, const TPoint &aCenter, const TFixed &aRX, const TFixed &aRY, const TFixedSmall &aEllipseAngle)
static CT_IMPORT CContourCircle (TResult &aError, const TPoint &aCenter, const TFixed &aRadius)
static CT_IMPORT CContourRoundedRectangle (TResult &aError, const TPoint &aTopLeft, const TFixed &aWidth, const TFixed &aHeight, const TFixed &aRX, const TFixed &aRY)
static CT_IMPORT CContourRectangle (TResult &aError, const TPoint &aTopLeft, const TFixed &aWidth, const TFixed &aHeight)

Detailed Description

A contour that owns its data.


Member Enumeration Documentation

Flags used for appending ellipses to determine the angle between start and end point or start and end angle.

Enumerator:
EShortest 

Select the shortest arc between start and end.

ELongest 

Select the longest arc between start and end.

EPositive 

Select the arc from start to end in positive direction.

ENegative 

Select the arc from start to end in negative direction.


Constructor & Destructor Documentation

CartoType::CContour::CContour ( ) [inline]

Create an empty open contour.


Member Function Documentation

CT_EXPORT TResult CContour::AppendCircularArc ( const TPoint aCenter,
const TPoint aStart,
const TPoint aEnd,
TEllipseAngleType  aAngleType = EShortest,
bool  aAppendStart = false 
)

Append 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.

CT_EXPORT TResult CContour::AppendEllipticalArc ( const TPoint aCenter,
const TFixed aRX,
const TFixed aRY,
const TFixedSmall aEllipseAngle,
const TFixedSmall aStartAngle,
const TFixedSmall aEndAngle,
TEllipseAngleType  aAngleType = EShortest,
bool  aAppendStart = false 
)

Append arc of an ellipse, using center parameterization. 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. Implementation notes: The arc is divided into sections of less than pi/2. For each section three points are appended: two control points and the end point.

CT_EXPORT TResult CContour::AppendEllipticalArc ( const TPoint aStart,
const TFixed aRX,
const TFixed aRY,
const TFixedSmall aEllipseAngle,
bool  aLargeArc,
bool  aSweep,
const TPoint aEnd,
bool  aAppendStart = false 
)

Append arc of an ellipse, using endpoint parameterization. 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.

CT_EXPORT TResult CContour::AppendHalfCircle ( const TPoint aCenter,
const TPoint aStart,
const TPoint aEnd,
TEllipseAngleType  aAngleType = EShortest,
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.

CT_EXPORT TResult CContour::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.

TResult CartoType::CContour::AppendPoint ( const TOutlinePoint aPoint) [inline]

Append a point to the contour, but only if it differs from the previous point or is a control point.

TResult CartoType::CContour::AppendPointDouble ( double  aX,
double  aY,
TPointType  aPointType 
) [inline]

Convert point from double precision floating point to point in 64ths and append.

TResult CartoType::CContour::AppendPointEvenIfSame ( const TOutlinePoint aPoint) [inline]

Append a point to the contour whether or not it differs from the previous point.

TResult CartoType::CContour::AppendPointFixed ( const TPointFixed aPoint,
TPointType  aPointType 
) [inline]

Convert point from fixed point to point in 64ths and append.

TResult CartoType::CContour::AppendPoints ( const TOutlinePoint aPoint,
int32  aPoints 
) [inline]

Append some points to the contour.

CT_EXPORT TResult CContour::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.

TResult CContour::AppendTransformedPointFixed ( const TTransform aTransform,
const TPointFixed aPoint,
TPointType  aPointType 
)

Apply transform to point, convert from fixed point to point in 64ths and append.

CT_EXPORT CContour * CContour::Circle ( TResult aError,
const TPoint aCenter,
const TFixed aRadius 
) [static]

Create a contour that is a circle. The center is specified in 64ths and the output is also in 64ths. The radius is in whole units.

void CartoType::CContour::Clear ( ) [inline]

Set the path to its newly constructed state: empty and open.

bool CartoType::CContour::Closed ( ) const [inline]

Return true if the contour is closed.

int32 CartoType::CContour::Contours ( ) const [inline, virtual]

Return the number of contours.

Implements CartoType::MPath.

CT_EXPORT CContour * CContour::Ellipse ( TResult aError,
const TPoint aCenter,
const TFixed aRX,
const TFixed aRY,
const TFixedSmall aEllipseAngle 
) [static]

Create a contour that is an ellipse. The center is specified in 64ths of pixels.

void CartoType::CContour::GetContour ( int32  aIndex,
TContour aContour 
) const [inline, virtual]

Return the contour indexed by aIndex.

Implements CartoType::MPath.

CT_EXPORT int32 CContour::Length ( ) const

Calculate the straight-line length of the contour: that is, the sum of the distances between the points, whether or not they are on or off the curve.

int32 CartoType::CContour::MemoryUsed ( ) const [inline]

Return the number of heap bytes used by the contour.

CT_EXPORT void CContour::Offset ( int32  aDx,
int32  aDy 
)

Apply an offset to every point in a contour.

Reimplemented from CartoType::MWritableContour.

CartoType::CContour::operator TContour ( ) const [inline]

Return a TContour object representing the data owned by this CContour object.

TOutlinePoint* CartoType::CContour::Point ( ) [inline, virtual]

Return a writable pointer to the point data.

Implements CartoType::MWritableContour.

const TOutlinePoint* CartoType::CContour::Point ( ) const [inline]

Return a constant pointer to the array of points.

const TOutlinePoint& CartoType::CContour::Point ( int32  aIndex) const [inline]

Return a point selected by its index.

int32 CartoType::CContour::Points ( ) [inline, virtual]

Return the number of points.

Implements CartoType::MWritableContour.

int32 CartoType::CContour::Points ( ) const [inline]

Return the number of points in the contour.

CT_EXPORT CContour * CContour::Rectangle ( TResult aError,
const TPoint aTopLeft,
const TFixed aWidth,
const TFixed aHeight 
) [static]

Create a contour that is a rectangle. The top left corner is specified in 64ths of pixels.

void CartoType::CContour::ReduceSizeTo ( int32  aPoints) [inline, virtual]

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

Implements CartoType::MWritableContour.

void CartoType::CContour::RemovePoint ( int32  aIndex) [inline]

Remove a point specified by an index.

void CartoType::CContour::RemovePoints ( int32  aIndex,
int32  aCount 
) [inline]

Remove a series of aCount points starting at aIndex.

void CartoType::CContour::ReplaceLastPoint ( const TOutlinePoint aPoint) [inline]

Replace last point.

void CartoType::CContour::ReplacePoint ( int32  aIndex,
const TOutlinePoint aPoint 
) [inline]

Replace a point selected by an index.

TResult CartoType::CContour::ReservePoints ( int32  aCount) [inline]

Pre-allocate enough space to hold at least aCount points. This function has no effect on behaviour but may increase speed.

CT_EXPORT CContour * CContour::RoundedRectangle ( TResult aError,
const TPoint aTopLeft,
const TFixed aWidth,
const TFixed aHeight,
const TFixed aRX,
const TFixed aRY 
) [static]

Create a contour that is a rounded rectangle. The top left corner is specified in 64ths of pixels.

void CartoType::CContour::SetClosed ( bool  aClosed) [inline]

Set the contour to closed or open.

TResult CartoType::CContour::SetSize ( int32  aSize) [inline]

Set the number of points to a specified size.

void CartoType::CContour::SetSizeToZero ( ) [inline]

Reduce the number of points to zero but retain any memory for re-use.

CT_EXPORT void CContour::Transform ( const TTransform aTransform)

Apply a transformation to every point in a contour.


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