Class TBGRACustomPathCursor

Unit

Declaration

type TBGRACustomPathCursor = class(TObject)

Description

Class that contains a cursor to browse an existing path

Hierarchy

Overview

Methods

Public function MoveBackward(ADistance: single; ACanJump: boolean = true): single; virtual; abstract;
Public function MoveForward(ADistance: single; ACanJump: boolean = true): single; virtual; abstract;
Protected function GetArcPos: single; virtual; abstract;
Protected function GetBounds: TRectF; virtual; abstract;
Protected function GetCurrentCoord: TPointF; virtual; abstract;
Protected function GetCurrentTangent: TPointF; virtual; abstract;
Protected function GetLoopClosedShapes: boolean; virtual; abstract;
Protected function GetLoopPath: boolean; virtual; abstract;
Protected function GetPathLength: single; virtual; abstract;
Protected function GetStartCoordinate: TPointF; virtual; abstract;
Protected procedure SetArcPos(AValue: single); virtual; abstract;
Protected procedure SetLoopClosedShapes(AValue: boolean); virtual; abstract;
Protected procedure SetLoopPath(AValue: boolean); virtual; abstract;

Properties

Public property CurrentCoordinate: TPointF read GetCurrentCoord;
Public property CurrentTangent: TPointF read GetCurrentTangent;
Public property LoopClosedShapes: boolean read GetLoopClosedShapes write SetLoopClosedShapes;
Public property LoopPath: boolean read GetLoopPath write SetLoopPath;
Public property PathLength: single read GetPathLength;
Public property Position: single read GetArcPos write SetArcPos;
Public property StartCoordinate: TPointF read GetStartCoordinate;

Description

Methods

Public function MoveBackward(ADistance: single; ACanJump: boolean = true): single; virtual; abstract;

Go backward, decreasing the value of Position. If ADistance is negative, then it goes forward instead. ACanJump specifies if the cursor can jump from one shape to another without a line or an arc. Otherwise, the cursor is stuck, and the return value is less than the value ADistance provided. If all the way has been travelled, the return value is equal to ADistance

Public function MoveForward(ADistance: single; ACanJump: boolean = true): single; virtual; abstract;

Go forward in the path, increasing the value of Position. If ADistance is negative, then it goes backward instead. ACanJump specifies if the cursor can jump from one shape to another without a line or an arc. Otherwise, the cursor is stuck, and the return value is less than the value ADistance provided. If all the way has been travelled, the return value is equal to ADistance

Protected function GetArcPos: single; virtual; abstract;

Retrieves the current position from the start

Protected function GetBounds: TRectF; virtual; abstract;

Compute the bounds of the path

Protected function GetCurrentCoord: TPointF; virtual; abstract;

Returns the current coordinate in the path

Protected function GetCurrentTangent: TPointF; virtual; abstract;

Returns the tangent vector to the current position

Protected function GetLoopClosedShapes: boolean; virtual; abstract;

Retrieves if the cursor loops when there is a closed shape

Protected function GetLoopPath: boolean; virtual; abstract;

Retrieves if the cursor loops at the end of the whole path

Protected function GetPathLength: single; virtual; abstract;

Retreive the full arc length of the path

Protected function GetStartCoordinate: TPointF; virtual; abstract;

Starting coordinate of the path

Protected procedure SetArcPos(AValue: single); virtual; abstract;

Sets the current position from the start

Protected procedure SetLoopClosedShapes(AValue: boolean); virtual; abstract;

Sets if the cursor loops when there is a closed shape

Protected procedure SetLoopPath(AValue: boolean); virtual; abstract;

Sets if the cursor loops at the end of the whole path

Properties

Public property CurrentCoordinate: TPointF read GetCurrentCoord;

Returns the current coordinate in the path

Public property CurrentTangent: TPointF read GetCurrentTangent;

Returns the tangent vector. It is a vector of length one that is parallel to the curve at the current point. A normal vector is easily deduced as PointF(y,-x)

Public property LoopClosedShapes: boolean read GetLoopClosedShapes write SetLoopClosedShapes;

Specifies if the cursor loops when there is a closed shape

Public property LoopPath: boolean read GetLoopPath write SetLoopPath;

Specifies if the cursor loops at the end of the path. Note that if it needs to jump to go to the beginning, it will be only possible if the parameter ACanJump is set to True when moving along the path

Public property PathLength: single read GetPathLength;

Full arc length of the path

Public property Position: single read GetArcPos write SetArcPos;

Current position in the path, as a distance along the arc from the starting point of the path

Public property StartCoordinate: TPointF read GetStartCoordinate;

Starting coordinate of the path