Class TNearest2DInterpolator

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TNearest2DInterpolator = class(TCustomAnisotropicInterpolator)

Description

TNearest2DInterpolator implements an interpolator that returns the value of the TScreenObject nearest to the point of interest.

Hierarchy

Overview

Fields

Private FStoredLocations: TList;
Private FExpression: TExpression;
Private FQuadTree: TRbwQuadTree;
Private FListOfTScreenObjects: TList;

Methods

Private function GetExpression(const Location: TPoint2D): TExpression;
Protected procedure StoreData(Sender: TObject; const DataSet: TDataArray);
Protected function GetNearestScreenObject(const Location: TPoint2D; out ClosestLocation: TPoint2D; out SectionIndex: integer): TScreenObject;
Public procedure Finalize(const DataSet: TDataArray); override;
Public constructor Create(AOwner: TComponent); override;
Public class function InterpolatorName: string; override;
Public destructor Destroy; override;
Public function BooleanResult(const Location: TPoint2D): boolean; override;
Public function IntegerResult(const Location: TPoint2D): integer; override;
Public function RealResult(const Location: TPoint2D): real; override;
Public function StringResult(const Location: TPoint2D): string; override;
Public class function ValidReturnTypes: TRbwDataTypes; override;

Description

Fields

Private FStoredLocations: TList;
 
Private FExpression: TExpression;

FExpression is the TExpression used to assign the result of the interpolation.

Private FQuadTree: TRbwQuadTree;

FQuadTree is used to find the closest node on an object to the location of interest.

Private FListOfTScreenObjects: TList;

FListOfTScreenObjects stores all the TScreenObjects that set the TDataArrays for this TNearest2DInterpolator by interpolation.

Methods

Private function GetExpression(const Location: TPoint2D): TExpression;

GetExpression gets the TExpression for the nearest TScreenObject that sets TCustom2DInterpolater.DataSet by interpolation, sets the variable for it and evaluates it. If there is no closest TScreenObject, GetExpression returns nil.

Protected procedure StoreData(Sender: TObject; const DataSet: TDataArray);

StoreData adds all the TScreenObjects that set DataSet by interpolation to FQuadTree at each of the TScreenObjects nodes and then adds all the TScreenObject that set DataSet by interpolation to FListOfTScreenObjects.

Protected function GetNearestScreenObject(const Location: TPoint2D; out ClosestLocation: TPoint2D; out SectionIndex: integer): TScreenObject;

GetNearestScreenObject returns the TScreenObject that is closest to Location. ClosestLocation is set to the location on the TScreenObject that is closest to Location.

ClosestLocation may be either at a node or along an edge of the TNearest2DInterpolator.

Public procedure Finalize(const DataSet: TDataArray); override;
 
Public constructor Create(AOwner: TComponent); override;

Create creates an instance of TNearest2DInterpolator and assigns OnInitialize.

Public class function InterpolatorName: string; override;

InterpolatorName is the name of the interpolator displayed to the user.

Public destructor Destroy; override;

Destroy destroys an instance of TNearest2DInterpolator.

Public function BooleanResult(const Location: TPoint2D): boolean; override;

BooleanResult gets the boolean value at Location of the closest TScreenObject that sets TCustom2DInterpolater.DataSet by interpolation,

Public function IntegerResult(const Location: TPoint2D): integer; override;

IntegerResult gets the integer value at Location of the closest TScreenObject that sets TCustom2DInterpolater.DataSet by interpolation,

Public function RealResult(const Location: TPoint2D): real; override;

RealResult gets the real-number value at Location of the closest TScreenObject that sets TCustom2DInterpolater.DataSet by interpolation,

Public function StringResult(const Location: TPoint2D): string; override;

StringResult gets the string value at Location of the closest TScreenObject that sets TCustom2DInterpolater.DataSet by interpolation,

Public class function ValidReturnTypes: TRbwDataTypes; override;

ValidReturnTypes tells what types of data with which this interpolator can be used. (integer, real-number, boolean, and string)


Generated by PasDoc 0.12.1 on 2013-05-13 15:41:43