Class TCustomGrid

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomGrid = class(TPersistent)

Description

TCustomGrid is an abstract class that defines the interface for a grid. It implements storage for columns and rows but not for layers.

It also implements display of the top view of the grid but not the front or side views. The columns and rows boundaries are stored in one-dimensional arrays. For some finite-difference models such as PHAST, the layers can also be stored in a one-dimensional arrays. Others, such as MODFLOW, would require a more complex access method. The interface defined in TCustomGrid defines the more complex access method required by a MODFLOW-type grid. However, because no MODFLOW-type grid has actually been implemented, there may prove to be bugs in TCustomGrid when used as an ancestor of a MODFLOW-type grid. )

Hierarchy

Overview

Fields

Private FColumnCount: integer;
Private FColumnDirection: TColumnDirection;
Private FColumnPositions: TOneDRealArray;
Private FFrontCellColors: array of array of TColor;
Private FFrontDataSet: TDataArray;
Private FGridAngle: real;
Private FLayerCount: integer;
Private FLayerDirection: TLayerDirection;
Private FNeedToRecalculate3DCellColors: boolean;
Private FRowCount: integer;
Private FRowDirection: TRowDirection;
Private FRowPositions: TOneDRealArray;
Private FSelectedColumn: integer;
Private FSelectedLayer: integer;
Private FSelectedRow: integer;
Private FSideCellColors: array of array of TColor;
Private FSideDataSet: TDataArray;
Private FThreeDDataSet: TDataArray;
Private FTopCellColors: array of array of TColor;
Private FTopDataSet: TDataArray;
Private FOnSelectedColumnChange: TNotifyEvent;
Private FOnSelectedLayerChange: TNotifyEvent;
Private FOnSelectedRowChange: TNotifyEvent;
Protected FCellsGLIndex: GLuint;
Protected FFrontGridGLIndex: GLuint;
Protected FGridShellGLIndex: GLuint;
Protected FListsCreated: boolean;
Protected FNeedToRecalculateFrontCellColors: boolean;
Protected FNeedToRecalculateSideCellColors: boolean;
Protected FNeedToRecalculateTopCellColors: boolean;
Protected FNeedToRedraw3d: boolean;
Protected FSideGridGLIndex: GLuint;
Protected FTopGridGLIndex: GLuint;

Methods

Private procedure ReadColumnPositions(Reader: TReader);
Private procedure ReadRowPositions(Reader: TReader);
Private procedure RecordColoredGrid;
Private procedure RecordFront;
Private procedure RecordShell;
Private procedure RecordSide;
Private procedure RecordTop;
Private procedure SetFrontDataSet(const Value: TDataArray);
Private procedure SetNeedToRecalculate3DCellColors(const Value: boolean);
Private procedure SetNeedToRecalculateFrontCellColors(const Value: boolean);
Private procedure SetNeedToRecalculateSideCellColors(const Value: boolean);
Private procedure SetNeedToRecalculateTopCellColors(const Value: boolean);
Private procedure SetSelectedColumn(Value: integer);
Private procedure SetSelectedLayer(Value: integer);
Private procedure SetSelectedRow(Value: integer);
Private procedure SetSideDataSet(const Value: TDataArray);
Private procedure SetThreeDDataSet(const Value: TDataArray);
Private procedure SetTopDataSet(const Value: TDataArray);
Private procedure Update3DCellColors(var CellColors: TCellColors);
Private procedure WriteColumnPositions(Writer: TWriter);
Private procedure WriteRowPositions(Writer: TWriter);
Protected procedure DefineProperties(Filer: TFiler); override;
Protected procedure DrawFront(const Canvas: TCanvas); virtual; abstract;
Protected procedure DrawSide(const Canvas: TCanvas); virtual; abstract;
Protected procedure DrawTop(const Canvas: TCanvas); virtual;
Protected procedure GetCellCornerElevations(const EvalAt: TEvaluatedAt; out Elevations: TThreeDRealArray); virtual; abstract;
Protected function GetCellElevation(const Column, Row, Layer: integer): real; virtual; abstract;
Protected function GetCellThickness(const Column, Row, Layer: integer): real; virtual; abstract;
Protected function GetColumnPosition(const Column: integer): real; virtual;
Protected function GetColumnWidth(const Column: integer): real; virtual;
Protected function GetContainingColumnOrRow(const Positions: TOneDRealArray; const APosition: real): integer;
Protected function GetFrontCellColors(const Column, Layer: integer): TColor; virtual;
Protected function GetRowPosition(const Row: integer): real; virtual;
Protected function GetRowWidth(const Row: integer): real; virtual;
Protected function GetSideCellColors(const Row, Layer: integer): TColor; virtual;
Protected function GetTopCellColors(const Column, Row: integer): TColor; virtual;
Protected function NearestColumnOrRow(const Positions: TOneDRealArray; const APosition: real; const First: integer = -1; const Last: integer = -1): integer;
Protected procedure SetCellElevation(const Column, Row, Layer: integer; const Value: real); virtual; abstract;
Protected procedure SetCellThickness(const Column, Row, Layer: integer; const Value: real); virtual; abstract;
Protected procedure SetColumnCount(const Value: integer); virtual;
Protected procedure SetColumnDirection(const Value: TColumnDirection); virtual;
Protected procedure SetColumnPosition(const Column: integer; const Value: real); virtual;
Protected procedure SetColumnPositions(const Value: TOneDRealArray);
Protected procedure SetColumnWidth(const Column: integer; const Value: real);
Protected procedure SetFrontCellColors(const Column, Layer: integer; const Value: TColor); virtual;
Protected procedure SetGridAngle(Value: real); virtual;
Protected procedure SetLayerCount(const Value: integer); virtual;
Protected procedure SetLayerDirection(const Value: TLayerDirection); virtual;
Protected procedure SetRowCount(const Value: integer); virtual;
Protected procedure SetRowDirection(const Value: TRowDirection); virtual;
Protected procedure SetRowPosition(const Row: integer; const Value: real); virtual;
Protected procedure SetRowPositions(const Value: TOneDRealArray);
Protected procedure SetRowWidth(const Row: integer; const Value: real); virtual;
Protected procedure SetSideCellColors(const Row, Layer: integer; const Value: TColor); virtual;
Protected procedure SetTopCellColors(const Column, Row: integer; const Value: TColor); virtual;
Public procedure AddColumn(const Value: real);
Public procedure AddRow(const Value: real);
Public procedure Assign(Source: TPersistent); override;
Public function CanDraw3D: boolean;
Public function ColumnCenter(const Column: integer): real;
Public constructor Create;
Public procedure DeleteColumn(const AColumn: integer);
Public procedure DeleteRow(const ARow: integer);
Public destructor Destroy; override;
Public procedure Draw(const Canvas: TCanvas; const ViewDirection: TViewDirection);
Public procedure Draw3D;
Public function GetContainingColumn(const AnXPosition: real): integer;
Public function GetContainingRow(const AYPosition: real): integer;
Public procedure GridChanged;
Public procedure Initialize;
Public function NearestColumnCenter(const APosition: real; First: integer = -1; Last: integer = -1): integer;
Public function NearestColumnPosition(const APosition: real; const First: integer = -1; const Last: integer = -1): integer;
Public function NearestRowCenter(const APosition: real; First: integer = -1; Last: integer = -1): integer;
Public function NearestRowPosition(const APosition: real; const First: integer = -1; const Last: integer = -1): integer;
Public procedure NeedToRecalculateCellColors;
Public procedure ResetFrontCellColors;
Public procedure ResetSideCellColors;
Public procedure ResetTopCellColors;
Public function RotateFromGridCoordinatesToRealWorldCoordinates (const APoint: T2DRealPoint): T2DRealPoint;
Public function RotateFromRealWorldCoordinatesToGridCoordinates (const APoint: T2DRealPoint): T2DRealPoint;
Public function RowCenter(const Row: integer): real;
Public function ThreeDColumnEdgeCenter(const Column, Row, Layer: integer): T3DRealPoint;
Public function ThreeDElementCenter(const Column, Row, Layer: integer): T3DRealPoint; virtual;
Public function ThreeDElementCorner(const Column, Row, Layer: integer): T3DRealPoint; virtual;
Public function ThreeDLayerEdgeCenter(const Column, Row, Layer: integer): T3DRealPoint;
Public function ThreeDRowEdgeCenter(const Column, Row, Layer: integer): T3DRealPoint;
Public function TopContainingCell(APoint: T2DRealPoint; const EvaluatedAt: TEvaluatedAt; const NeedToRotatePointToGridCoordinates: boolean = True; const BelowCol: integer = -1; const AboveCol: integer = -1; const BelowRow: integer = -1; const AboveRow: integer = -1): T2DTopCell;
Public function TwoDColumnEdgeCenter(const Column, Row: integer): T2DRealPoint;
Public function TwoDElementCenter(const Column, Row: integer): T2DRealPoint;
Public function TwoDElementCorner(const Column, Row: integer): T2DRealPoint;
Public function TwoDRowEdgeCenter(const Column, Row: integer): T2DRealPoint;
Public procedure UpdateCellColors(const ViewDirection: TViewDirection);
Public procedure UpdateColumnPositions; virtual;
Public procedure UpdateRowPositions; virtual;
Public procedure ViewsChanged;

Properties

Public property CellElevation[const Column, Row, Layer: integer]: real read GetCellElevation write SetCellElevation;
Public property CellThickness[const Column, Row, Layer: integer]: real read GetCellThickness write SetCellThickness;
Public property ColumnPosition[const Column: integer]: real read GetColumnPosition write SetColumnPosition;
Public property ColumnPositions: TOneDRealArray read FColumnPositions write SetColumnPositions;
Public property ColumnWidth[const Column: integer]: real read GetColumnWidth write SetColumnWidth;
Public property FrontCellColors[const Column, Layer: integer]: TColor read GetFrontCellColors write SetFrontCellColors;
Public property FrontDataSet: TDataArray read FFrontDataSet write SetFrontDataSet;
Public property NeedToRecalculate3DCellColors: boolean read FNeedToRecalculate3DCellColors write SetNeedToRecalculate3DCellColors;
Public property NeedToRecalculateFrontCellColors: boolean read FNeedToRecalculateFrontCellColors write SetNeedToRecalculateFrontCellColors;
Public property NeedToRecalculateSideCellColors: boolean read FNeedToRecalculateSideCellColors write SetNeedToRecalculateSideCellColors;
Public property NeedToRecalculateTopCellColors: boolean read FNeedToRecalculateTopCellColors write SetNeedToRecalculateTopCellColors;
Public property RowPosition[const Row: integer]: real read GetRowPosition write SetRowPosition;
Public property RowPositions: TOneDRealArray read FRowPositions write SetRowPositions;
Public property RowWidth[const Row: integer]: real read GetRowWidth write SetRowWidth;
Public property SideCellColors[const Row, Layer: integer]: TColor read GetSideCellColors write SetSideCellColors;
Public property SideDataSet: TDataArray read FSideDataSet write SetSideDataSet;
Public property ThreeDDataSet: TDataArray read FThreeDDataSet write SetThreeDDataSet;
Public property TopCellColors[const Column, Row: integer]: TColor read GetTopCellColors write SetTopCellColors;
Public property TopDataSet: TDataArray read FTopDataSet write SetTopDataSet;
Public property OnSelectedColumnChange: TNotifyEvent read FOnSelectedColumnChange write FOnSelectedColumnChange;
Public property OnSelectedLayerChange: TNotifyEvent read FOnSelectedLayerChange write FOnSelectedLayerChange;
Public property OnSelectedRowChange: TNotifyEvent read FOnSelectedRowChange write FOnSelectedRowChange;
Published property ColumnCount: integer read FColumnCount write SetColumnCount;
Published property ColumnDirection: TColumnDirection read FColumnDirection write SetColumnDirection;
Published property GridAngle: real read FGridAngle write SetGridAngle;
Published property LayerCount: integer read FLayerCount write SetLayerCount;
Published property LayerDirection: TLayerDirection read FLayerDirection write SetLayerDirection;
Published property RowCount: integer read FRowCount write SetRowCount;
Published property RowDirection: TRowDirection read FRowDirection write SetRowDirection;
Published property SelectedColumn: integer read FSelectedColumn write SetSelectedColumn;
Published property SelectedLayer: integer read FSelectedLayer write SetSelectedLayer;
Published property SelectedRow: integer read FSelectedRow write SetSelectedRow;

Description

Fields

Private FColumnCount: integer;

FColumnCount: integer; See ColumnCount.

Private FColumnDirection: TColumnDirection;

FColumnDirection: TColumnDirection; See ColumnDirection.

Private FColumnPositions: TOneDRealArray;

FColumnPositions: TOneDRealArray; See ColumnPositions.

Private FFrontCellColors: array of array of TColor;

FFrontCellColors: array of array of TColor; See FrontCellColors.

Private FFrontDataSet: TDataArray;

FFrontDataSet: TDataArray; See FrontDataSet.

Private FGridAngle: real;

FGridAngle: real; See GridAngle.

Private FLayerCount: integer;

FLayerCount: integer; See LayerCount.

Private FLayerDirection: TLayerDirection;

FLayerDirection: TLayerDirection; See LayerDirection.

Private FNeedToRecalculate3DCellColors: boolean;

FNeedToRecalculate3DCellColors: boolean; See NeedToRecalculate3DCellColors.

Private FRowCount: integer;

FRowCount: integer; See RowCount.

Private FRowDirection: TRowDirection;

FRowDirection: TRowDirection; See RowDirection.

Private FRowPositions: TOneDRealArray;

FRowPositions: TOneDRealArray; See RowPositions.

Private FSelectedColumn: integer;

FSelectedColumn: integer; See SelectedColumn.

Private FSelectedLayer: integer;

FSelectedLayer: integer; See SelectedLayer.

Private FSelectedRow: integer;

FSelectedRow: integer; See SelectedRow.

Private FSideCellColors: array of array of TColor;

FSideCellColors: array of array of TColor; See SideCellColors.

Private FSideDataSet: TDataArray;

FSideDataSet: TDataArray; See SideDataSet.

Private FThreeDDataSet: TDataArray;

FThreeDDataSet: TDataArray; See ThreeDDataSet.

Private FTopCellColors: array of array of TColor;

FTopCellColors: array of array of TColor; See TopCellColors.

Private FTopDataSet: TDataArray;

FTopDataSet: TDataArray; See TopDataSet.

Private FOnSelectedColumnChange: TNotifyEvent;

FOnSelectedColumnChange: TNotifyEvent; See OnSelectedColumnChange.

Private FOnSelectedLayerChange: TNotifyEvent;

FOnSelectedLayerChange: TNotifyEvent; See OnSelectedLayerChange.

Private FOnSelectedRowChange: TNotifyEvent;

FOnSelectedRowChange: TNotifyEvent; See OnSelectedRowChange.

Protected FCellsGLIndex: GLuint;

FCellsGLIndex is used to store a OpenGL display list for the colored cells or elements of the grid.

Protected FFrontGridGLIndex: GLuint;

FFrontGridGLIndex is used to store a OpenGL display list for the front view of the grid.

Protected FGridShellGLIndex: GLuint;

FGridShellGLIndex is used to store a OpenGL display list for the grid shell.

Protected FListsCreated: boolean;

FListsCreated is used to indicate whether or not the display lists FGridShellGLIndex, FTopGridGLIndex, FFrontGridGLIndex, FSideGridGLIndex, and FCellsGLIndex have been created.

Protected FNeedToRecalculateFrontCellColors: boolean;

FNeedToRecalculateFrontCellColors indicates that the colors of the cells in the front view of the grid need to be recalculated.

Protected FNeedToRecalculateSideCellColors: boolean;

FNeedToRecalculateSideCellColors indicates that the colors of the cells in the side view of the grid need to be recalculated.

Protected FNeedToRecalculateTopCellColors: boolean;

FNeedToRecalculateTopCellColors indicates that the colors of the cells in the top view of the grid need to be recalculated.

Protected FNeedToRedraw3d: boolean;

FNeedToRedraw3d indicates that the 3D view of the grid need to be redrawn.

Protected FSideGridGLIndex: GLuint;

FSideGridGLIndex is used to store a OpenGL display list for the side view of the grid.

Protected FTopGridGLIndex: GLuint;

FTopGridGLIndex is used to store a OpenGL display list for the horizontal view of the grid.

Methods

Private procedure ReadColumnPositions(Reader: TReader);

ReadColumnPositions is used to read ColumnPositions from a stream. It calls ReadRealArray to do this.

Private procedure ReadRowPositions(Reader: TReader);

ReadRowPositions is used to read RowPositions from a stream. It calls ReadRealArray to do this.

Private procedure RecordColoredGrid;

RecordColoredGrid creates an OpenGL display list using FCellsGLIndex to show colored grid cells or elements.

Private procedure RecordFront;

RecordFront creates an OpenGL display list using FFrontGridGLIndex to show the grid on the front view of the model.

Private procedure RecordShell;

RecordShell creates an OpenGL display list using FGridShellGLIndex to show the grid shell.

Private procedure RecordSide;

RecordSide creates an OpenGL display list using FSideGridGLIndex to show the grid on the side view of the model.

Private procedure RecordTop;

RecordTop creates an OpenGL display list using FTopGridGLIndex to show the grid on the top view of the model.

Private procedure SetFrontDataSet(const Value: TDataArray);

See FrontDataSet.

Private procedure SetNeedToRecalculate3DCellColors(const Value: boolean);

See NeedToRecalculate3DCellColors.

Private procedure SetNeedToRecalculateFrontCellColors(const Value: boolean);

See NeedToRecalculateFrontCellColors.

Private procedure SetNeedToRecalculateSideCellColors(const Value: boolean);

See NeedToRecalculateSideCellColors.

Private procedure SetNeedToRecalculateTopCellColors(const Value: boolean);

See NeedToRecalculateTopCellColors.

Private procedure SetSelectedColumn(Value: integer);

See SelectedColumn.

Private procedure SetSelectedLayer(Value: integer);

See SelectedLayer.

Private procedure SetSelectedRow(Value: integer);

See SelectedRow.

Private procedure SetSideDataSet(const Value: TDataArray);

See SideDataSet.

Private procedure SetThreeDDataSet(const Value: TDataArray);

See ThreeDDataSet.

Private procedure SetTopDataSet(const Value: TDataArray);

See TopDataSet.

Private procedure Update3DCellColors(var CellColors: TCellColors);

Update3DCellColors modifies CellColors to reflect the values of ThreeDDataSet.

Private procedure WriteColumnPositions(Writer: TWriter);

WriteColumnPositions writes ColumnPositions to a stream using WriteRealArray.

Private procedure WriteRowPositions(Writer: TWriter);

WriteRowPositions writes RowPositions to a stream using WriteRealArray.

Protected procedure DefineProperties(Filer: TFiler); override;

DefineProperties is used to define how ColumnPositions and RowPositions are written to and read from a stream. This allows those properties to be saved to a file and read from a file.

See also
ReadRealArray
ReadRealArray is used to read a one-dimensional array of real numbers from a stream.
ReadColumnPositions
ReadColumnPositions is used to read ColumnPositions from a stream.
ReadRowPositions
ReadRowPositions is used to read RowPositions from a stream.
WriteRealArray
WriteRealArray is used to write a one-dimensional array of real numbers to a stream.
WriteColumnPositions
WriteColumnPositions writes ColumnPositions to a stream using WriteRealArray.
WriteRowPositions
WriteRowPositions writes RowPositions to a stream using WriteRealArray.
Protected procedure DrawFront(const Canvas: TCanvas); virtual; abstract;

DrawFront draws a front view of the grid on Canvas.

Protected procedure DrawSide(const Canvas: TCanvas); virtual; abstract;

DrawSide draws a side view of the grid on Canvas.

Protected procedure DrawTop(const Canvas: TCanvas); virtual;

DrawTop draws a top view of the grid on Canvas.

Protected procedure GetCellCornerElevations(const EvalAt: TEvaluatedAt; out Elevations: TThreeDRealArray); virtual; abstract;

GetCellCornerElevations sets Elevations to a 3D array of real numbers. Each number in the array is the elevation of one corner of a cell or element.

This procedure would probably have to be modified or replaced for grids such as that in MODFLOW that all elevations to vary within a layer.

Protected function GetCellElevation(const Column, Row, Layer: integer): real; virtual; abstract;

See CellElevation.

Protected function GetCellThickness(const Column, Row, Layer: integer): real; virtual; abstract;

See CellThickness.

Protected function GetColumnPosition(const Column: integer): real; virtual;

See ColumnPosition.

Protected function GetColumnWidth(const Column: integer): real; virtual;

See ColumnWidth.

Protected function GetContainingColumnOrRow(const Positions: TOneDRealArray; const APosition: real): integer;

Positions is an array of column or row boundaries. GetContainingColumnOrRow gets the column or row (not column boundary or row boundary) that contains APosition. If APosition < Positions[0] then result := -1. If APosition > Positions[Length(Positions)-1] then result := Length(Positions)-1.

Protected function GetFrontCellColors(const Column, Layer: integer): TColor; virtual;

See FrontCellColors.

Protected function GetRowPosition(const Row: integer): real; virtual;

See RowPosition.

Protected function GetRowWidth(const Row: integer): real; virtual;

See RowWidth.

Protected function GetSideCellColors(const Row, Layer: integer): TColor; virtual;

See SideCellColors.

Protected function GetTopCellColors(const Column, Row: integer): TColor; virtual;

See TopCellColors.

Protected function NearestColumnOrRow(const Positions: TOneDRealArray; const APosition: real; const First: integer = -1; const Last: integer = -1): integer;

NearestColumnOrRow finds the index of the element in Positions that is closest to APosition. If the index is known to be within a certain range, NearestColumnOrRow can be made faster by specifying First and Last. If APosition is less than the first member of Positions, NearestColumnOrRow returns -1. If APosition is greater than the last member of Positions, NearestColumnOrRow returns Length(Positions).

Parameters
Positions
is an array of real numbers sorted in ascending order.
APosition,
is the value that is being searched for.
First
is the first member of Positions to be included in the search. If First = -1, use the first member of Positions as the beginning of the search.
Last
is the last member of Positions to be included in the search. If Last = -1, use the last member of Positions as the beginning of the search.
Protected procedure SetCellElevation(const Column, Row, Layer: integer; const Value: real); virtual; abstract;

See CellElevation.

Protected procedure SetCellThickness(const Column, Row, Layer: integer; const Value: real); virtual; abstract;

See CellThickness.

Protected procedure SetColumnCount(const Value: integer); virtual;

See ColumnCount.

Protected procedure SetColumnDirection(const Value: TColumnDirection); virtual;

See ColumnDirection.

Protected procedure SetColumnPosition(const Column: integer; const Value: real); virtual;

See ColumnPosition.

Protected procedure SetColumnPositions(const Value: TOneDRealArray);

See ColumnPositions.

Protected procedure SetColumnWidth(const Column: integer; const Value: real);

See ColumnWidth.

Protected procedure SetFrontCellColors(const Column, Layer: integer; const Value: TColor); virtual;

See FrontCellColors.

Protected procedure SetGridAngle(Value: real); virtual;

See GridAngle.

Protected procedure SetLayerCount(const Value: integer); virtual;

see LayerCount.

Protected procedure SetLayerDirection(const Value: TLayerDirection); virtual;

See LayerDirection.

Protected procedure SetRowCount(const Value: integer); virtual;

See RowCount.

Protected procedure SetRowDirection(const Value: TRowDirection); virtual;

See RowDirection.

Protected procedure SetRowPosition(const Row: integer; const Value: real); virtual;

See RowPosition.

Protected procedure SetRowPositions(const Value: TOneDRealArray);

See RowPositions.

Protected procedure SetRowWidth(const Row: integer; const Value: real); virtual;

See RowWidth.

Protected procedure SetSideCellColors(const Row, Layer: integer; const Value: TColor); virtual;

See SideCellColors.

Protected procedure SetTopCellColors(const Column, Row: integer; const Value: TColor); virtual;

See TopCellColors.

Public procedure AddColumn(const Value: real);

Add a new column boundary at position "Value".

Public procedure AddRow(const Value: real);

Add a new row boundary at position "Value".

Public procedure Assign(Source: TPersistent); override;

Copies the properties of Source into self. Only those properties that normally would be saved to file are copied.

Public function CanDraw3D: boolean;

CanDraw3D is used to determine whether or not a grid can be drawn in 3D.

Public function ColumnCenter(const Column: integer): real;

ColumnCenter returns the position of the center of a column

Public constructor Create;

Create creates a grid with 0 rows, columns and layers.

Public procedure DeleteColumn(const AColumn: integer);

DeleteColumn deletes the column boundary at the position AColumn.

Public procedure DeleteRow(const ARow: integer);

DeleteRow deletes the row boundary at the position ARow.

Public destructor Destroy; override;
 
Public procedure Draw(const Canvas: TCanvas; const ViewDirection: TViewDirection);

Draw draws a top, front or side view of the grid on Canvas. ViewDirection determines which one is drawn.

See also
DrawTop
DrawTop draws a top view of the grid on Canvas.
DrawFront
DrawFront draws a front view of the grid on Canvas.
DrawSide
DrawSide draws a side view of the grid on Canvas.
Public procedure Draw3D;

Draw3D draws the grid in the current OpenGL rendering context.

Public function GetContainingColumn(const AnXPosition: real): integer;

See GetContainingColumnOrRow.

Public function GetContainingRow(const AYPosition: real): integer;

See GetContainingColumnOrRow.

Public procedure GridChanged;

GridChanged is called when the grid has changed in a way that means it needs to be redrawn. It notifies the appropriate controls to redraw themselves.

Public procedure Initialize;

Initialize sets TopDataSet, FrontDataSet, SideDataSet and ThreeDDataSet to nil.

Public function NearestColumnCenter(const APosition: real; First: integer = -1; Last: integer = -1): integer;

NearestColumnCenter returns the index of the column center closest to APosition. If the index is known to be within a certain range, the function can be speeded up by specifying First and Last.

Public function NearestColumnPosition(const APosition: real; const First: integer = -1; const Last: integer = -1): integer;

NearestColumnPosition returns the index of the column boundary closest to APosition. If the index is known to be within a certain range, the function can be speeded up by specifying First and Last.

Public function NearestRowCenter(const APosition: real; First: integer = -1; Last: integer = -1): integer;

NearestRowCenter returns the index of the row center closest to APosition. If the index is known to be within a certain range, the function can be speeded up by specifying First and Last.

Public function NearestRowPosition(const APosition: real; const First: integer = -1; const Last: integer = -1): integer;

NearestRowPosition returns the index of the row boundary closest to APosition. If the index is known to be within a certain range, the function can be speeded up by specifying First and Last.

Public procedure NeedToRecalculateCellColors;

NeedToRecalculateCellColors sets NeedToRecalculateFrontCellColors, NeedToRecalculateSideCellColors, NeedToRecalculateTopCellColors, and NeedToRecalculate3DCellColors to false.

Public procedure ResetFrontCellColors;

ResetFrontCellColors sets the colors of the cells in a front view of the grid to white. See UpdateCellColors.

Public procedure ResetSideCellColors;

Sets the colors of the cells in a side view of the grid to white. See UpdateCellColors.

Public procedure ResetTopCellColors;

Sets the colors of the cells in a top view of the grid to white. See UpdateCellColors.

Public function RotateFromGridCoordinatesToRealWorldCoordinates (const APoint: T2DRealPoint): T2DRealPoint;

RotateFromGridCoordinatesToRealWorldCoordinates converts coordinates expressed in terms of Column and Row coordinates to ones based on real world coordinates.

Public function RotateFromRealWorldCoordinatesToGridCoordinates (const APoint: T2DRealPoint): T2DRealPoint;

RotateFromRealWorldCoordinatesToGridCoordinates is the inverse of RotateFromGridCoordinatesToRealWorldCoordinates.

Public function RowCenter(const Row: integer): real;

RowCenter returns the position of the center of a row

Public function ThreeDColumnEdgeCenter(const Column, Row, Layer: integer): T3DRealPoint;

ThreeDColumnEdgeCenter returns the X, Y, and Z coordinates of the center of a column boundary in the coordinate system of the grid.

See also
ThreeDRowEdgeCenter
ThreeDRowEdgeCenter returns the X, Y, and Z coordinates of the center of a row boundary in the coordinate system of the grid.
ThreeDLayerEdgeCenter
ThreeDLayerEdgeCenter returns the X, Y, and Z coordinates of the center of a layer boundary in the coordinate system of the grid.
Public function ThreeDElementCenter(const Column, Row, Layer: integer): T3DRealPoint; virtual;

ThreeDElementCenter returns the X, Y, and Z coordinates of the center of a grid element in the coordinate system of the grid.

Public function ThreeDElementCorner(const Column, Row, Layer: integer): T3DRealPoint; virtual;

ThreeDElementCorner returns the X, Y, and Z coordinates of a corner of a grid element in the coordinate system of the grid.

Public function ThreeDLayerEdgeCenter(const Column, Row, Layer: integer): T3DRealPoint;

ThreeDLayerEdgeCenter returns the X, Y, and Z coordinates of the center of a layer boundary in the coordinate system of the grid.

See also
ThreeDColumnEdgeCenter
ThreeDColumnEdgeCenter returns the X, Y, and Z coordinates of the center of a column boundary in the coordinate system of the grid.
ThreeDRowEdgeCenter
ThreeDRowEdgeCenter returns the X, Y, and Z coordinates of the center of a row boundary in the coordinate system of the grid.
Public function ThreeDRowEdgeCenter(const Column, Row, Layer: integer): T3DRealPoint;

ThreeDRowEdgeCenter returns the X, Y, and Z coordinates of the center of a row boundary in the coordinate system of the grid.

See also
ThreeDColumnEdgeCenter
ThreeDColumnEdgeCenter returns the X, Y, and Z coordinates of the center of a column boundary in the coordinate system of the grid.
ThreeDLayerEdgeCenter
ThreeDLayerEdgeCenter returns the X, Y, and Z coordinates of the center of a layer boundary in the coordinate system of the grid.
Public function TopContainingCell(APoint: T2DRealPoint; const EvaluatedAt: TEvaluatedAt; const NeedToRotatePointToGridCoordinates: boolean = True; const BelowCol: integer = -1; const AboveCol: integer = -1; const BelowRow: integer = -1; const AboveRow: integer = -1): T2DTopCell;

TopContainingCell retrieves the indices of the element or node that contains APoint. Whether the indices of an element or node are retrieved depends on EvaluatedAt. If APoint is in grid coordinates, NeedToRotatePointToGridCoordinates should be set to true. If the result is known to be within a certain range, the function can be speeded up by specifying BelowCol, AboveCol, BelowRow, and AboveRow. The T2DTopCell that is returned should never have values outside the valid range as long as there are at least one column and row in the grid.

Public function TwoDColumnEdgeCenter(const Column, Row: integer): T2DRealPoint;

TwoDCellCorner returns the X ,and Y coordinates of a corner of a grid cell in the real-world coordinates.

Public function TwoDElementCenter(const Column, Row: integer): T2DRealPoint;

TwoDElementCenter returns the X, and Y coordinates of the center of a grid element in the real-world coordinates.

Public function TwoDElementCorner(const Column, Row: integer): T2DRealPoint;

TwoDCellCorner returns the X ,and Y coordinates of a corner of a grid element in the real-world coordinates.

Public function TwoDRowEdgeCenter(const Column, Row: integer): T2DRealPoint;

TwoDRowEdgeCenter returns the X ,and Y coordinates of the center of the edge of a row in the real-world coordinates.

Public procedure UpdateCellColors(const ViewDirection: TViewDirection);

When the values in the displayed TopDataSet, FrontDataSet, or SideDataSet are up-to-date, call UpdateCellColors to update colors of the grid cells.

Public procedure UpdateColumnPositions; virtual;

After editing ColumnPositions, call UpdateColumnPositions to update the number of columns and to make sure the columns are sorted in ascending order.

Public procedure UpdateRowPositions; virtual;

After editing RowPositions, call UpdateRowPositions to update the number of rows and to make sure the rows are sorted in ascending order.

Public procedure ViewsChanged;

notify the views that the need to redraw;

Properties

Public property CellElevation[const Column, Row, Layer: integer]: real read GetCellElevation write SetCellElevation;

CellElevation is an abstract property that represents the elevation of the boundary between the cell at Row, Column between Layer and Layer-1. There are LayerCount + 1 layers of elevations in the grid.

Public property CellThickness[const Column, Row, Layer: integer]: real read GetCellThickness write SetCellThickness;

CellThickness is an abstract property that represents the thickness of a cell. Thicknesses must be greater than or equal to 0.

Public property ColumnPosition[const Column: integer]: real read GetColumnPosition write SetColumnPosition;

ColumnPosition defines either the boundary between one column and its neighbor or the position of one edge of the grid. There are ColumnCount+1 members in ColumnPosition. For direct access to the array use ColumnPositions instead. The origin of the grid is at (ColumnPosition[0], RowPosition[0]).

Public property ColumnPositions: TOneDRealArray read FColumnPositions write SetColumnPositions;

ColumnPositions is the array of boundaries between adjacent columns. After editing ColumnPositions, call UpdateColumnPositions to update the number of columns and to make sure the columns are sorted in ascending order.

Public property ColumnWidth[const Column: integer]: real read GetColumnWidth write SetColumnWidth;

ColumnWidth is the width of a column. ColumnWidth must be greater than or equal to 0.

Public property FrontCellColors[const Column, Layer: integer]: TColor read GetFrontCellColors write SetFrontCellColors;

FrontCellColors is used to retrieve or set the color of a element or node in a front view of the grid. Whether the color is the color of a cell or a node depends on whether the FrontDataSet is evaluated at elements or nodes.

Public property FrontDataSet: TDataArray read FFrontDataSet write SetFrontDataSet;

FrontDataSet is the TDataArray whose values are used to determine the colors of the cells in a front view of the grid. See: FrontCellColors, TPhastModel.FrontDisplayTime, and TPhastModel.FrontTimeList.

Public property NeedToRecalculate3DCellColors: boolean read FNeedToRecalculate3DCellColors write SetNeedToRecalculate3DCellColors;

NeedToRecalculate3DCellColors indicates that the colors of the cells in the 3D view of the grid need to be recalculated. FNeedToRecalculate3DCellColors is a protected field.

Public property NeedToRecalculateFrontCellColors: boolean read FNeedToRecalculateFrontCellColors write SetNeedToRecalculateFrontCellColors;

NeedToRecalculateFrontCellColors indicates that the colors of the cells in the front view of the grid need to be recalculated. NeedToRecalculateFrontCellColors can be used to set FNeedToRecalculateFrontCellColors to false but not to true. FNeedToRecalculateFrontCellColors is a protected field.

Public property NeedToRecalculateSideCellColors: boolean read FNeedToRecalculateSideCellColors write SetNeedToRecalculateSideCellColors;

NeedToRecalculateSideCellColors indicates that the colors of the cells in the side view of the grid need to be recalculated. NeedToRecalculateSideCellColors can be used to set FNeedToRecalculateSideCellColors to false but not to true. FNeedToRecalculateSideCellColors is a protected field.

Public property NeedToRecalculateTopCellColors: boolean read FNeedToRecalculateTopCellColors write SetNeedToRecalculateTopCellColors;

NeedToRecalculateTopCellColors indicates that the colors of the cells in the top view of the grid need to be recalculated. NeedToRecalculateTopCellColors can be used to set FNeedToRecalculateTopCellColors to false but not to true. FNeedToRecalculateTopCellColors is a protected field.

Public property RowPosition[const Row: integer]: real read GetRowPosition write SetRowPosition;

RowPosition defines either the boundary between one row and its neighbor or the position of one edge of the grid. There are RowCount+1 members in RowPosition. For direct access to the array use RowPositions instead. The origin of the grid is at (ColumnPosition[0], RowPosition[0]).

Public property RowPositions: TOneDRealArray read FRowPositions write SetRowPositions;

RowPositions is the array of boundaries between adjacent rows. After editing RowPositions, call UpdateRowPositions to update the number of rows and to make sure the rows are sorted in ascending order.

Public property RowWidth[const Row: integer]: real read GetRowWidth write SetRowWidth;

RowWidth is the width of a row. RowWidth must be greater than or equal to 0.

Public property SideCellColors[const Row, Layer: integer]: TColor read GetSideCellColors write SetSideCellColors;

SideCellColors is used to retrieve or set the color of a element or node in a side view of the grid. Whether the color is the color of a cell or a node depends on whether the SideDataSet is evaluated at elements or nodes.

Public property SideDataSet: TDataArray read FSideDataSet write SetSideDataSet;

SideDataSet is the TDataArray whose values are used to determine the colors of the cells in a side view of the grid. See: SideCellColors, TPhastModel.SideDisplayTime, and TPhastModel.SideTimeList.

Public property ThreeDDataSet: TDataArray read FThreeDDataSet write SetThreeDDataSet;

ThreeDDataSet is the TDataArray whose values are used to determine the colors of the cells in a 3D view of the grid. See: TCellColors, TPhastModel.ThreeDDisplayTime, and TPhastModel.ThreeDTimeList.

Public property TopCellColors[const Column, Row: integer]: TColor read GetTopCellColors write SetTopCellColors;

TopCellColors is used to retrieve or set the color of a element or node in a top view of the grid. Whether the color is the color of a cell or a node depends on whether the TopDataSet is evaluated at elements or nodes.

Public property TopDataSet: TDataArray read FTopDataSet write SetTopDataSet;

TopDataSet is the TDataArray whose values are used to determine the colors of the cells in a top view of the grid. See: TopCellColors, TPhastModel.TopDisplayTime, and TPhastModel.TopTimeList.

Public property OnSelectedColumnChange: TNotifyEvent read FOnSelectedColumnChange write FOnSelectedColumnChange;

OnSelectedColumnChange is an event that can be used to respond to changes in which column is selected.

Public property OnSelectedLayerChange: TNotifyEvent read FOnSelectedLayerChange write FOnSelectedLayerChange;

OnSelectedLayerChange is an event that can be used to respond to changes in which layer is selected.

Public property OnSelectedRowChange: TNotifyEvent read FOnSelectedRowChange write FOnSelectedRowChange;

OnSelectedRowChange is an event that can be used to respond to changes in which row is selected.

Published property ColumnCount: integer read FColumnCount write SetColumnCount;

ColumnCount is the number of columns in the grid. Each column has a width that is greater than or equal to 0.

Published property ColumnDirection: TColumnDirection read FColumnDirection write SetColumnDirection;

ColumnDirection determines whether columns are numbered from west to east or east to west.

Published property GridAngle: real read FGridAngle write SetGridAngle;

GridAngle is the angle made by the grid relative to the East direction. it is measured counterclockwise. If GridAngle is 0, columns run north/south and rows run east/west. GridAngle is measured in radians.

Published property LayerCount: integer read FLayerCount write SetLayerCount;

LayerCount is the number of layers in the grid. Each element in the grid has a thickness that is greater than or equal to 0.

Published property LayerDirection: TLayerDirection read FLayerDirection write SetLayerDirection;

LayerDirection determines whether layers are numbered from top to bottom or bottom to top.

Published property RowCount: integer read FRowCount write SetRowCount;

RowCount is the number of rows in the grid. Each row has a width that is greater than or equal to 0.

Published property RowDirection: TRowDirection read FRowDirection write SetRowDirection;

RowDirection determines whether rows are numbered from north to south or south to north.

Published property SelectedColumn: integer read FSelectedColumn write SetSelectedColumn;

SelectedColumn is the column that is displayed in the side view of the grid.

See also
SelectedRow
SelectedRow is the row that is displayed in the front view of the grid.
SelectedLayer
SelectedLayer is the layer that is displayed in the top view of the grid.
Published property SelectedLayer: integer read FSelectedLayer write SetSelectedLayer;

SelectedLayer is the layer that is displayed in the top view of the grid.

See also
SelectedColumn
SelectedColumn is the column that is displayed in the side view of the grid.
SelectedRow
SelectedRow is the row that is displayed in the front view of the grid.
Published property SelectedRow: integer read FSelectedRow write SetSelectedRow;

SelectedRow is the row that is displayed in the front view of the grid.

See also
SelectedColumn
SelectedColumn is the column that is displayed in the side view of the grid.
SelectedLayer
SelectedLayer is the layer that is displayed in the top view of the grid.

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