Class TCustomScreenObjectDelegate

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomScreenObjectDelegate = class abstract(TPersistent)

Description

TCustomScreenObjectDelegate is an abstract base class. Descendants are used for assigning properties to TDataArrays from the front and side views.

Hierarchy

Overview

Fields

Strict Protected FSelectedCells: TSelectedCells;
Protected FModelSelection: TModelSelection;
Protected FModel: TBaseModel;
Protected FScreenObject: TScreenObject;

Methods

Protected procedure AssignValuesToFrontDataSet( const DataSet: TDataArray; OtherData: TObject; AModel: TBaseModel; UseLgrEdgeCells: TLgrCellTreatment; AssignmentLocation: TAssignmentLocation = alAll); virtual; abstract;
Protected procedure AssignValuesToSideDataSet( const DataSet: TDataArray; OtherData: TObject; AModel: TBaseModel; UseLgrEdgeCells: TLgrCellTreatment; AssignmentLocation: TAssignmentLocation = alAll); virtual; abstract;
Protected procedure AssignValuesToTopDataSet( const DataSet: TDataArray; OtherData: TObject; AModel: TBaseModel; UseLgrEdgeCells: TLgrCellTreatment; AssignmentLocation: TAssignmentLocation = alAll); virtual; abstract;
Protected procedure UpdateFrontSegments(AModel: TBaseModel; const EvaluatedAt: TEvaluatedAt); virtual; abstract;
Protected procedure UpdateSideSegments(AModel: TBaseModel; const EvaluatedAt: TEvaluatedAt); virtual; abstract;
Protected function GetCompiler(const Orientation: TDataSetOrientation): TRbwParser;
Protected procedure GetFrontCellsToAssign( const DataSetFunction: string; OtherData: TObject; const DataSet: TDataArray; CellList: TCellAssignmentList; AssignmentLocation: TAssignmentLocation; AModel: TBaseModel); virtual; abstract;
Protected procedure GetSideCellsToAssign( const DataSetFunction: string; OtherData: TObject; const DataSet: TDataArray; CellList: TCellAssignmentList; AssignmentLocation: TAssignmentLocation; AModel: TBaseModel); virtual; abstract;
Protected procedure GetTopCellsToAssign( const DataSetFunction: string; OtherData: TObject; const DataSet: TDataArray; CellList: TCellAssignmentList; AssignmentLocation: TAssignmentLocation; AModel: TBaseModel); virtual; abstract;
Protected procedure AssignCellValue(const UsedVariables: TStringList; const DataSet: TDataArray; LayerIndex, RowIndex, ColIndex: integer; const Compiler: TRbwParser; const Annotation: string; var Expression: TExpression; const OtherData: TObject; SectionIndex: integer; ShouldZero: boolean); virtual;
Protected function BoundaryType: integer; virtual;
Protected function DataSetUsed(const DataSet: TDataArray; var OtherData: TObject; AModel: TBaseModel): boolean; virtual;
Protected function EncloseAnnotation(const DataSetFormula: string; const OtherData: TObject): string; virtual;
Protected procedure InitializeExpression(out Compiler: TRbwParser; out DataSetFunction: string; out Expression: TExpression; const DataSet: TDataArray; const OtherData: TObject); virtual;
Protected procedure InitializeVariables(const UsedVariables: TStringList; const DataSet: TDataArray; const Expression: TExpression; const Compiler: TRbwParser);
Protected function IntersectAnnotation(const DataSetFormula: string; const OtherData: TObject): string; virtual;
Protected procedure OtherIndex(const LayerOrRow, RowOrColumn: integer; out First, Last: integer; const DataSet: TDataArray); virtual;
Protected procedure UpdateVariables(const UsedVariables: TStringList; const DataSet: TDataArray; Layer, Row, Column: integer; const Compiler: TRbwParser);
Protected Constructor Create(ScreenObject: TScreenObject); virtual;
Protected procedure AssignSelectedCells(AModel: TBaseModel); virtual; abstract;

Properties

Protected property ModelSelection: TModelSelection read FModelSelection;
Protected property SelectedCells: TSelectedCells read FSelectedCells;

Description

Fields

Strict Protected FSelectedCells: TSelectedCells;
 
Protected FModelSelection: TModelSelection;

See ModelSelection.

Protected FModel: TBaseModel;

FModel is the TPhastModel that is being used.

Protected FScreenObject: TScreenObject;

FScreenObject is the TScreenObject for which this TCustomScreenObjectDelegate will be used.

Methods

Protected procedure AssignValuesToFrontDataSet( const DataSet: TDataArray; OtherData: TObject; AModel: TBaseModel; UseLgrEdgeCells: TLgrCellTreatment; AssignmentLocation: TAssignmentLocation = alAll); virtual; abstract;

AssignValuesToFrontDataSet initializes variables needed by the formula for the TDataArray and then assigns values to the data set based on that formula for intersected and enclosed cells or elements. AssignValuesToFrontDataSet is only used when FScreenObject.ViewDirection = vdFront.

Protected procedure AssignValuesToSideDataSet( const DataSet: TDataArray; OtherData: TObject; AModel: TBaseModel; UseLgrEdgeCells: TLgrCellTreatment; AssignmentLocation: TAssignmentLocation = alAll); virtual; abstract;

AssignValuesToSideDataSet initializes variables needed by the formula for the TDataArray and then assigns values to the data set based on that formula for intersected and enclosed cells or elements. AssignValuesToSideDataSet is only used when link(FScreenObject).ViewDirection = vdSide.

Protected procedure AssignValuesToTopDataSet( const DataSet: TDataArray; OtherData: TObject; AModel: TBaseModel; UseLgrEdgeCells: TLgrCellTreatment; AssignmentLocation: TAssignmentLocation = alAll); virtual; abstract;

AssignValuesToTopDataSet initializes variables needed by the formula for the TDataArray and then assigns values to the data set based on that formula for intersected and enclosed cells or elements. AssignValuesToTopDataSet is only used when FScreenObject.(TScreenObject.ViewDirection) = vdTop.

Protected procedure UpdateFrontSegments(AModel: TBaseModel; const EvaluatedAt: TEvaluatedAt); virtual; abstract;

UpdateFrontSegments updates the contents of FScreenObject.(TScreenObject.Segments) when FScreenObject.(TScreenObject.ViewDirection) = vdFront.

Protected procedure UpdateSideSegments(AModel: TBaseModel; const EvaluatedAt: TEvaluatedAt); virtual; abstract;

UpdateSideSegments updates the contents of FScreenObject.(TScreenObject.Segments) when when FScreenObject.(TScreenObject.ViewDirection) = vdSide.

Protected function GetCompiler(const Orientation: TDataSetOrientation): TRbwParser;
 
Protected procedure GetFrontCellsToAssign( const DataSetFunction: string; OtherData: TObject; const DataSet: TDataArray; CellList: TCellAssignmentList; AssignmentLocation: TAssignmentLocation; AModel: TBaseModel); virtual; abstract;

GetFrontCellsToAssign fills CellList with instances of TCellAssignment on the front view of the model.

Protected procedure GetSideCellsToAssign( const DataSetFunction: string; OtherData: TObject; const DataSet: TDataArray; CellList: TCellAssignmentList; AssignmentLocation: TAssignmentLocation; AModel: TBaseModel); virtual; abstract;

GetSideCellsToAssign fills CellList with instances of TCellAssignment on the side view of the model.

Protected procedure GetTopCellsToAssign( const DataSetFunction: string; OtherData: TObject; const DataSet: TDataArray; CellList: TCellAssignmentList; AssignmentLocation: TAssignmentLocation; AModel: TBaseModel); virtual; abstract;

GetTopCellsToAssign fills CellList with instances of TCellAssignment on the top view of the model.

Protected procedure AssignCellValue(const UsedVariables: TStringList; const DataSet: TDataArray; LayerIndex, RowIndex, ColIndex: integer; const Compiler: TRbwParser; const Annotation: string; var Expression: TExpression; const OtherData: TObject; SectionIndex: integer; ShouldZero: boolean); virtual;

AssignCellValue assigns a value to a particular cell in DataSet.

In AssignCellValue:

(1) If OtherData = nil or not TInterpValuesItem(OtherData).Values.UsePHAST_Interpolation, the inherited AssignCellValue is called.

(2) Otherwise, values are assigned to DataSet at the location LayerIndex, RowIndex, ColIndex using PHAST-style interpolation. (See TPhastInterpolationValues.) Expression and Compiler are not used in this case and the variables listed in UsedVariables are not updated.

OtherData is set in IsBoundaryTimeDataSetUsed.

Protected function BoundaryType: integer; virtual;

BoundaryType returns an integer that indicates what type of boundary condition, if any, are specified by this TCustomScreenObjectDelegate.

Protected function DataSetUsed(const DataSet: TDataArray; var OtherData: TObject; AModel: TBaseModel): boolean; virtual;

DataSetUsed returns True if DataSet is a TSparseArrayPhastInterpolationDataSet DataSetUsed also returns True if DataSet is a TCustomPhastDataSet and DataSet is specified by this TCustomScreenObjectDelegate. OtherData may be changed DataSet is a TCustomPhastDataSet.

Protected function EncloseAnnotation(const DataSetFormula: string; const OtherData: TObject): string; virtual;

EncloseAnnotation returns a string that indicates that a location was specified by being enclosed in this TCustomScreenObjectDelegate and how the value at that location was determined.

Protected procedure InitializeExpression(out Compiler: TRbwParser; out DataSetFunction: string; out Expression: TExpression; const DataSet: TDataArray; const OtherData: TObject); virtual;

{InitializeExpression (1) gets the proper DataSetFormula to apply to DataSet, (2) gets the proper TRbwParser for DataSet, and (3) compiles DataSetFormula to get Expression. However, it doesn't need to do any of that is PHAST-style interpolation is used. See TPhastInterpolationValues.}

Protected procedure InitializeVariables(const UsedVariables: TStringList; const DataSet: TDataArray; const Expression: TExpression; const Compiler: TRbwParser);

InitializeVariables gets all the TDataArrays listed in UsedVariables and calls Initialize for each of them.

Protected function IntersectAnnotation(const DataSetFormula: string; const OtherData: TObject): string; virtual;

IntersectAnnotation returns a string that indicates that a location was specified by being intersected by this TCustomScreenObjectDelegate and how the value at that location was determined.

Protected procedure OtherIndex(const LayerOrRow, RowOrColumn: integer; out First, Last: integer; const DataSet: TDataArray); virtual;

The purpose of OtherIndex is to get First and Last. They are the indices of the first and last layer, row, or column perpendicular to the plain of TViewDirection that are enclosed or intersected by the TCustomScreenObjectDelegate.

In commented-out code, First and Last and changed to frmGoPhast.PhastGrid.LayerCount for river data sets. It has been commented-out because it messes up the display of the river data on the status bar.

It would be good to find a way around this problem. As it is, all OtherIndex really does is call the inherited OtherIndex.

Protected procedure UpdateVariables(const UsedVariables: TStringList; const DataSet: TDataArray; Layer, Row, Column: integer; const Compiler: TRbwParser);

In preparation for evaluating a formula, UpdateVariables updates the TCustomValues whose names are listed in UsedVariables with their values at locations specifed by Layer, Row and Column. DataSet is the TDataArray for which the TCustomValues will be used. Compiler is the TRbwParser which will be used to evaluate a formula.

Protected Constructor Create(ScreenObject: TScreenObject); virtual;

Create creates an instance of TCustomScreenObjectDelegate.

Protected procedure AssignSelectedCells(AModel: TBaseModel); virtual; abstract;

AssignSelectedCells sets SelectedCells to True for each cells that is enclosed or intersected by the TScreenObject.

Properties

Protected property ModelSelection: TModelSelection read FModelSelection;

ModelSelection indicates the model for which this delegate will be used.

Protected property SelectedCells: TSelectedCells read FSelectedCells;

SelectedCells is used to record the cells that are enclosed or intersected by the TScreenObject.


Generated by PasDoc 0.12.1 on 2013-05-13 15:42:01