Class TDataArray

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TDataArray = class(TObserver)

Description

TDataArray provides an interface to a 3D array of data.

All descendants of TDataArray that are instantiated must be registered with the system using RegisterClass in the initialization section of the unit in which they are declared.

Hierarchy

Overview

Fields

Private FAnnotation: T3DStringDataSet;
Private FCheckMax: boolean;
Private FCheckMin: boolean;
Private FColumnCount: integer;
Private FData: pointer;
Private FDataType: TRbwDataType;
Private FDimensionsChanged: boolean;
Private FEvaluatedAt: TEvaluatedAt;
Private FFormula: string;
Private FLayerCount: integer;
Private FLimits: TColoringLimits;
Private FLock: TDataLock;
Private FMax: double;
Private FMin: double;
Private FOrientation: TDataSetOrientation;
Private FRowCount: integer;
Private FTwoDInterpolator: TCustom2DInterpolater;
Private FUnits: string;
Private FUseList: TStringList;
Private FUseListUpToDate: boolean;
Private FVisible: boolean;
Private FOnDataSetUsed: TDataSetUsedEvent;

Methods

Private function GetThreeDBooleanData: T3DBooleanDataSet;
Private function GetThreeDIntegerData: T3DIntegerDataSet;
Private function GetThreeDRealData: T3DRealDataSet;
Private function GetThreeDStringData: T3DStringDataSet;
Private function GetTwoDInterpolatorClass: string;
Private procedure ResetFormula(const Compiler: TRbwParser; const ErrorMessage: string);
Private procedure SetEvaluatedAt(const Value: TEvaluatedAt);
Private procedure SetFormula(const Value: string);
Private procedure SetLimits(const Value: TColoringLimits);
Private procedure SetLock(const Value: TDataLock);
Private procedure SetOrientation(const Value: TDataSetOrientation);
Private procedure SetTwoDInterpolator(const Value: TCustom2DInterpolater);
Private procedure SetTwoDInterpolatorClass(const Value: string);
Private procedure SetUnits(const Value: string);
Private procedure SetVisible(const Value: boolean);
Private procedure UpdateUseList;
Protected function GetAnnotation(const Layer, Row, Col: integer): string; virtual;
Protected function GetBooleanData(const Layer, Row, Col: integer): boolean; virtual;
Protected function GetIntegerData(const Layer, Row, Col: integer): integer; virtual;
Protected function GetIsValue(const Layer, Row, Col: Integer): boolean; virtual;
Protected function GetOwner: TPersistent; override;
Protected function GetRealData(const Layer, Row, Col: integer): double; virtual;
Protected procedure GetRequiredDimensions(out NumberOfLayers, NumberOfRows, NumberOfColumns: integer);
Protected function GetStringData(const Layer, Row, Col: integer): string; virtual;
Protected function GetUseList: TStringList; virtual;
Protected procedure LimitsChanged(Sender: TObject);
Protected procedure SetAnnotation(const Layer, Row, Col: integer; const Value: string); virtual;
Protected procedure SetBooleanData(const Layer, Row, Col: integer; const Value: boolean); virtual;
Protected procedure SetDataType(const Value: TRbwDataType); virtual;
Protected procedure SetDimensions(const SetToZero: boolean = False); virtual;
Protected procedure SetIntegerData(const Layer, Row, Col, Value: integer); virtual;
Protected procedure SetIsValue(const Layer, Row, Col: Integer; const Value: boolean); virtual;
Protected procedure SetName(const Value: TComponentName); override;
Protected procedure SetRealData(const Layer, Row, Col: integer; const Value: double); virtual;
Protected procedure SetStringData(const Layer, Row, Col: integer; const Value: string); virtual;
Public constructor Create(AnOwner: TComponent); override;
Public destructor Destroy; override;
Public function DisplayRealValue: boolean; virtual;
Public procedure FullUseList(const AStringList: TStringList);
Public procedure Initialize; virtual;
Public procedure Invalidate; virtual;
Public procedure UpdateDimensions(NumberOfLayers, NumberOfRows, NumberOfColumns: integer);
Public function UsedByModel: boolean;

Properties

Protected property DimensionsChanged: boolean read FDimensionsChanged;
Protected property ThreeDBooleanData: T3DBooleanDataSet read GetThreeDBooleanData;
Protected property ThreeDIntegerData: T3DIntegerDataSet read GetThreeDIntegerData;
Protected property ThreeDRealData: T3DRealDataSet read GetThreeDRealData;
Protected property ThreeDStringData: T3DStringDataSet read GetThreeDStringData;
Public property Annotation[const Layer, Row, Col: integer]: string read GetAnnotation write SetAnnotation;
Public property BooleanData[const Layer, Row, Col: integer]: boolean read GetBooleanData write SetBooleanData;
Public property ColumnCount: integer read FColumnCount;
Public property Formula: string read FFormula write SetFormula;
Public property IntegerData[const Layer, Row, Col: integer]: integer read GetIntegerData write SetIntegerData;
Public property IsValue[const Layer, Row, Col: Integer]: boolean read GetIsValue write SetIsValue;
Public property LayerCount: integer read FLayerCount;
Public property Limits: TColoringLimits read FLimits write SetLimits;
Public property RealData[const Layer, Row, Col: integer]: double read GetRealData write SetRealData;
Public property RowCount: integer read FRowCount;
Public property StringData[const Layer, Row, Col: integer]: string read GetStringData write SetStringData;
Public property UseList: TStringList read GetUseList;
Public property OnDataSetUsed: TDataSetUsedEvent read FOnDataSetUsed write FOnDataSetUsed;
Published property CheckMax: boolean read FCheckMax write FCheckMax;
Published property CheckMin: boolean read FCheckMin write FCheckMin;
Published property DataType: TRbwDataType read FDataType write SetDataType;
Published property EvaluatedAt: TEvaluatedAt read FEvaluatedAt write SetEvaluatedAt;
Published property Lock: TDataLock read FLock write SetLock;
Published property Max: double read FMax write FMax;
Published property Min: double read FMin write FMin;
Published property Orientation: TDataSetOrientation read FOrientation write SetOrientation;
Published property TwoInterpolatorClass: string read GetTwoDInterpolatorClass write SetTwoDInterpolatorClass stored False;
Published property TwoDInterpolatorClass: string read GetTwoDInterpolatorClass write SetTwoDInterpolatorClass;
Published property TwoDInterpolator: TCustom2DInterpolater read FTwoDInterpolator write SetTwoDInterpolator;
Published property Units: string read FUnits write SetUnits;
Published property Visible: boolean read FVisible write SetVisible stored False;

Description

Fields

Private FAnnotation: T3DStringDataSet;

FAnnotation: T3DStringDataSet; See Annotation.

Private FCheckMax: boolean;

FCheckMax: boolean; See CheckMax.

Private FCheckMin: boolean;

FCheckMin: boolean; See CheckMin.

Private FColumnCount: integer;

FColumnCount: integer; See ColumnCount.

Private FData: pointer;

FData: pointer;

Depending on DataType, FData will be either a T3DRealDataSet, T3DIntegerDataSet, T3DBooleanDataSet, or T3DStringDataSet.

See RealData, IntegerData, BooleanData, StringData, ThreeDRealData, ThreeDIntegerData, ThreeDBooleanData, and ThreeDStringData.

Private FDataType: TRbwDataType;

FDataType: TRbwDataType; See DataType.

Private FDimensionsChanged: boolean;

FDimensionsChanged: boolean; See DimensionsChanged.

Private FEvaluatedAt: TEvaluatedAt;

FEvaluatedAt: TEvaluatedAt; See EvaluatedAt.

Private FFormula: string;

FFormula: string; See Formula.

Private FLayerCount: integer;

FLayerCount: integer; See LayerCount.

Private FLimits: TColoringLimits;

FLimits: TColoringLimits; See Limits.

Private FLock: TDataLock;

FLock: TDataLock; See Lock.

Private FMax: double;

FMax: double; See Max.

Private FMin: double;

FMin: double; See Min.

Private FOrientation: TDataSetOrientation;

FOrientation: TDataSetOrientation; See Orientation.

Private FRowCount: integer;

FRowCount: integer; See RowCount.

Private FTwoDInterpolator: TCustom2DInterpolater;

FTwoDInterpolator: TCustom2DInterpolater; See TwoDInterpolator.

Private FUnits: string;

FUnits: string; See Units.

Private FUseList: TStringList;

FUseList: TStringList; See UseList.

Private FUseListUpToDate: boolean;

FUseListUpToDate: boolean; FUseListUpToDate is used to indicate whether the values in UseList need to be regenerated. Changing Formula causes FUseListUpToDate to be set to False. Calling UpdateUseList causes FUseListUpToDate to be set to True.

Private FVisible: boolean;

FVisible: boolean; See Visible.

Private FOnDataSetUsed: TDataSetUsedEvent;

FOnDataSetUsed: TDataSetUsedEvent; See OnDataSetUsed.

Methods

Private function GetThreeDBooleanData: T3DBooleanDataSet;

See ThreeDBooleanData.

Private function GetThreeDIntegerData: T3DIntegerDataSet;

See ThreeDIntegerData.

Private function GetThreeDRealData: T3DRealDataSet;

See ThreeDRealData.

Private function GetThreeDStringData: T3DStringDataSet;

See ThreeDStringData.

Private function GetTwoDInterpolatorClass: string;

See TwoDInterpolatorClass.

Private procedure ResetFormula(const Compiler: TRbwParser; const ErrorMessage: string);

ResetFormula is called if an invalid formula has been specified. ResetFormula changes the formula to something that is sure to work.

Private procedure SetEvaluatedAt(const Value: TEvaluatedAt);

See EvaluatedAt.

Private procedure SetFormula(const Value: string);

See Formula.

Private procedure SetLimits(const Value: TColoringLimits);

See Limits.

Private procedure SetLock(const Value: TDataLock);

See Lock.

Private procedure SetOrientation(const Value: TDataSetOrientation);

See Orientation.

Private procedure SetTwoDInterpolator(const Value: TCustom2DInterpolater);

See TwoDInterpolator.

Private procedure SetTwoDInterpolatorClass(const Value: string);

See TwoDInterpolatorClass.

Private procedure SetUnits(const Value: string);

See Units.

Private procedure SetVisible(const Value: boolean);

See Visible.

Private procedure UpdateUseList;

UpdateUseList updates UseList with the variables used by Formula.

Protected function GetAnnotation(const Layer, Row, Col: integer): string; virtual;

See Annotation.

Protected function GetBooleanData(const Layer, Row, Col: integer): boolean; virtual;

See BooleanData.

Protected function GetIntegerData(const Layer, Row, Col: integer): integer; virtual;

See IntegerData.

Protected function GetIsValue(const Layer, Row, Col: Integer): boolean; virtual;

See IsValue.

Protected function GetOwner: TPersistent; override;

GetOwner returns frmGoPhast.Model.

Protected function GetRealData(const Layer, Row, Col: integer): double; virtual;

See RealData.

Protected procedure GetRequiredDimensions(out NumberOfLayers, NumberOfRows, NumberOfColumns: integer);

GetRequiredDimensions gets the number of dimensions that TDataArray needs to have.

Protected function GetStringData(const Layer, Row, Col: integer): string; virtual;

See StringData.

Protected function GetUseList: TStringList; virtual;

See UseList.

Protected procedure LimitsChanged(Sender: TObject);

LimitsChanged is the event handler for TColoringLimit.OnChange. If this TDataArray is being used to color the grid, LimitsChanged causes the colors displayed on the grid to be recalculated and the display to be updated.

Protected procedure SetAnnotation(const Layer, Row, Col: integer; const Value: string); virtual;

See Annotation.

Protected procedure SetBooleanData(const Layer, Row, Col: integer; const Value: boolean); virtual;

See BooleanData.

Protected procedure SetDataType(const Value: TRbwDataType); virtual;

See DataType.

Protected procedure SetDimensions(const SetToZero: boolean = False); virtual;

SetDimensions sets the size of the array of data stored by TDataArray to be set to the correct size. If SetToZero is true, the dimensions are all set to zero.

Protected procedure SetIntegerData(const Layer, Row, Col, Value: integer); virtual;

See IntegerData.

Protected procedure SetIsValue(const Layer, Row, Col: Integer; const Value: boolean); virtual;

See IsValue.

Protected procedure SetName(const Value: TComponentName); override;

SetName calls inherited SetName and then invalidates the model.

Protected procedure SetRealData(const Layer, Row, Col: integer; const Value: double); virtual;

See RealData.

Protected procedure SetStringData(const Layer, Row, Col: integer; const Value: string); virtual;

See StringData.

Public constructor Create(AnOwner: TComponent); override;

Create creates an instance of TDataArray.

Public destructor Destroy; override;

Destroy destroys the the current instance of TDataArray. Do not call Destroy directly. Call Free instead.

Public function DisplayRealValue: boolean; virtual;

DisplayRealValue is used when coloring the grid to specify that the real number value should be used when coloring the grid instead of the integer value. In TDataArray, DisplayRealValue always returns false. This is overridden in TIntegerPhastDataSet and TSparseIntegerPhastDataSet.

Public procedure FullUseList(const AStringList: TStringList);

FullUseList fills AStringList with the names of all the TDataArray that depend on the current TDataArray.

Public procedure Initialize; virtual;

Initialize assigns values to each location in RealData, IntegerData, BooleanData, or StringData in TDataArray. It first uses either Formula or TwoDInterpolator to assign values and then assigns values using TScreenObjects. See TCustomPhastDataSet.Initialize for a flow chart.

Public procedure Invalidate; virtual;

Invalidate is called when something has happened that would change the values assigned to the TDataArray.

Public procedure UpdateDimensions(NumberOfLayers, NumberOfRows, NumberOfColumns: integer);

UpdateDimensions updates the number of dimensions that need to be in the TDataArray. It does not actually change the dimensions of the array used to hold the data. See SetDimensions.

Public function UsedByModel: boolean;

UsedByModel returns true unless OnDataSetUsed is assigned. in which case it calls OnDataSetUsed and returns its result. See TPhastModel.ChemistryUsed. See TPhastModel.EquilibriumPhasesUsed. See TPhastModel.ExchangeUsed. See TPhastModel.GasPhaseUsed. See TPhastModel.InitialHeadUsed. See TPhastModel.KineticsUsed. See TPhastModel.SolidSolutionUsed. See TPhastModel.SurfacesUsed. See TPhastModel.InitialWaterTableUsed.

Properties

Protected property DimensionsChanged: boolean read FDimensionsChanged;

DimensionsChanged indicates that the dimensions of the data set have changed. This can happen either by the number of rows, columns, or layers in the grid has changed, because EvaluatedAt has changed, or because the Orientation has changed.

Protected property ThreeDBooleanData: T3DBooleanDataSet read GetThreeDBooleanData;

ThreeDBooleanData provides access to the entire 3D array of boolean data. first dimension = layers, second dimension = rows, third dimension = columns.

Protected property ThreeDIntegerData: T3DIntegerDataSet read GetThreeDIntegerData;

ThreeDIntegerData provides access to the entire 3D array of integer data. first dimension = layers, second dimension = rows, third dimension = columns.

Protected property ThreeDRealData: T3DRealDataSet read GetThreeDRealData;

ThreeDRealData provides access to the entire 3D array of real number data. first dimension = layers, second dimension = rows, third dimension = columns.

Protected property ThreeDStringData: T3DStringDataSet read GetThreeDStringData;

ThreeDStringData provides access to the entire 3D array of string data. first dimension = layers, second dimension = rows, third dimension = columns.

Public property Annotation[const Layer, Row, Col: integer]: string read GetAnnotation write SetAnnotation;

When a value is assigned to a location in a TDataArray, Annotation is used to specify how that value was assigned. This can help the user understand why the value is what it is.

Public property BooleanData[const Layer, Row, Col: integer]: boolean read GetBooleanData write SetBooleanData;

BooleanData gives the boolean value at the location specified by Layer, Row, and Col.

Public property ColumnCount: integer read FColumnCount;

ColumnCount gives the number of columns of data in the TDataArray.

Public property Formula: string read FFormula write SetFormula;

Formula is the formula used to assign values to the TDataArray.

Public property IntegerData[const Layer, Row, Col: integer]: integer read GetIntegerData write SetIntegerData;

IntegerData gives the integer value at the location specified by Layer, Row, and Col.

Public property IsValue[const Layer, Row, Col: Integer]: boolean read GetIsValue write SetIsValue;

IsValue indicates that a value is present at the location specified by Layer, Row, Col. In TDataArray, IsValue is always true. In some descendants of TDataArray, IsValue can be false.

Public property LayerCount: integer read FLayerCount;

LayerCount gives the number of layers of data in the TDataArray.

Public property Limits: TColoringLimits read FLimits write SetLimits;

Limits specifies how (or if) the values used to color the grid should be limited. See TColoringLimits.

Public property RealData[const Layer, Row, Col: integer]: double read GetRealData write SetRealData;

RealData gives the real number value at the location specified by Layer, Row, and Col.

Public property RowCount: integer read FRowCount;

RowCount gives the number of rows of data in the TDataArray.

Public property StringData[const Layer, Row, Col: integer]: string read GetStringData write SetStringData;

StringData gives the string value at the location specified by Layer, Row, and Col.

Public property UseList: TStringList read GetUseList;

UseList is a list of the variables used by the Formula.

Public property OnDataSetUsed: TDataSetUsedEvent read FOnDataSetUsed write FOnDataSetUsed;

See UsedByModel.

Published property CheckMax: boolean read FCheckMax write FCheckMax;

If CheckMax is True, attempting to set IntegerData or RealData to a value greater than Max will cause it to be set to Trunc(Max) or Max.

Published property CheckMin: boolean read FCheckMin write FCheckMin;

If CheckMin is True, attempting to set IntegerData or RealData to a value less than Min will cause it to be set to Trunc(Min) or Min.

Published property DataType: TRbwDataType read FDataType write SetDataType;

DataType indicates whether the data stored in TDataArray are real numbers, integers, booleans, or strings.

Published property EvaluatedAt: TEvaluatedAt read FEvaluatedAt write SetEvaluatedAt;

EvaluatedAt indicates whether the data in TDataArray are evaluated at element centers or nodes.

Published property Lock: TDataLock read FLock write SetLock;

Members of Lock are things the user ought not to be able to edit.

Published property Max: double read FMax write FMax;

See CheckMax.

Published property Min: double read FMin write FMin;

See CheckMin.

Published property Orientation: TDataSetOrientation read FOrientation write SetOrientation;

Orientation is used to indicate whether the TDataArray is a 2D or 3D data set and, if it is 2D, which face of the grid it is associated with.

dsoTop = 2D top face.

dsoFront = 2D front face.

dsoSide = 2D side face.

dso3D = 3D.

See TDataSetOrientation.

Published property TwoInterpolatorClass: string read GetTwoDInterpolatorClass write SetTwoDInterpolatorClass stored False;

TwoInterpolatorClass is used only for backwards compatibility. TwoInterpolatorClass must be before TwoDInterpolator. See TwoDInterpolatorClass.

Published property TwoDInterpolatorClass: string read GetTwoDInterpolatorClass write SetTwoDInterpolatorClass;

TwoDInterpolatorClass is the name of the Class of TCustom2DInterpolater used with this TDataArray. Assigning TwoDInterpolatorClass will cause an instance of TCustom2DInterpolater to be created and assigned to TwoDInterpolator.

Important: when reading a TDataArray from a stream TwoDInterpolatorClass must be assigned before TwoDInterpolator so that an instance of TCustom2DInterpolater of the correct type will be created. To achieve this, TwoDInterpolatorClass must appear before TwoDInterpolator in the list of published properties.

Published property TwoDInterpolator: TCustom2DInterpolater read FTwoDInterpolator write SetTwoDInterpolator;

TwoDInterpolator is the TCustom2DInterpolater that is used to interpolate among TScreenObjects when assigning values to TDataArray.

Published property Units: string read FUnits write SetUnits;

Units is used to indicate the units for the data in TDataArray. Units is only a label; it has no significance for the model.

Published property Visible: boolean read FVisible write SetVisible stored False;

Visible has no effect. It is maintained only for backwards compatibility.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:33