Class TCustomModelGrid

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomModelGrid = class(TCustomDiscretization)

Description

TCustomModelGrid 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 the 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, require a more complex access method. The interface defined in TCustomModelGrid defines the more complex access method required by a MODFLOW-type grid. )

See also
TPhastGrid
TPhastGrid defines the grid used with PHAST.
TModflowGrid
included to allow inlining or "Point" function.

Hierarchy

Overview

Fields

Private FEdgesGLIndex: GLuint;
Private FCellsGLIndex: GLuint;
Private FColumnCount: integer;
Private FColumnDirection: TColumnDirection;
Private FColumnPositions: TOneDRealArray;
Private FFrontCellColors: array of array of TColor;
Private FFrontDataSet: TDataArray;
Private FFrontGridGLIndex: GLuint;
Private FGridAngle: real;
Private FGridShellGLIndex: GLuint;
Private FLayerCount: integer;
Private FLayerDirection: TLayerDirection;
Private FNeedToRecalculate3DCellColors: boolean;
Private FOnSelectedColumnChange: TNotifyEvent;
Private FOnSelectedLayerChange: TNotifyEvent;
Private FOnSelectedRowChange: TNotifyEvent;
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 FSideGridGLIndex: GLuint;
Private FThreeDDataSet: TDataArray;
Private FTopCellColors: array of array of TColor;
Private FTopDataSet: TDataArray;
Private FTopGridGLIndex: GLuint;
Private FTopGridObserver: TObserver;
Private FThreeDGridObserver: TObserver;
Private FDisplayColumn: integer;
Private FDisplayLayer: integer;
Private FDisplayRow: integer;
Private FLayerUpdate: Integer;
Private FColumnUpdate: Integer;
Private FGridUpdate: Integer;
Private FRowUpdate: Integer;
Private FNodeGlGrid: TGrid;
Private FBlockGlGrid: TGrid;
Private FTopNodeContourGrid: T2DGrid;
Private FFrontNodeContourGrid: T2DGrid;
Private FSideNodeContourGrid: T2DGrid;
Private FTopElementContourGrid: T2DGrid;
Private FFrontElementContourGrid: T2DGrid;
Private FSideElementContourGrid: T2DGrid;
Private FRecordedShell: Boolean;
Private FRecordedSideGrid: Boolean;
Private FRecordedFrontGrid: Boolean;
Private FRecordedTopGrid: Boolean;
Private FElementCount: integer;
Private FGridLineDrawingChoice: TGridLineDrawingChoice;
Private FTopContourDataSet: TDataArray;
Private FThreeDContourDataSet: TDataArray;
Private FFrontContourDataSet: TDataArray;
Private FSideContourDataSet: TDataArray;
Private FDrawing3DGrid: Boolean;
Private FCanDraw: boolean;
Private FDraw3DAllowed: boolean;
Private FBlockGridCache: TMemoryStream;
Private FNodeGridCache: TMemoryStream;
Private FDrawColoredGridLines: boolean;
Protected FListsCreated: boolean;
Protected FNeedToRecalculateFrontCellColors: boolean;
Protected FNeedToRecalculateSideCellColors: boolean;
Protected FNeedToRecalculateTopCellColors: boolean;
Protected FNeedToRedraw3d: boolean;

Methods

Private function GetColWidths: TOneDRealArray;
Private function GetRowWidths: TOneDRealArray;
Private function GetWidths(const PositionArray: TOneDRealArray): TOneDRealArray;
Private procedure ReadColumnPositions(Reader: TReader);
Private procedure ReadRowPositions(Reader: TReader);
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 SetThreeDGridObserver(const Value: TObserver);
Private procedure SetTopGridObserver(const Value: TObserver);
Private procedure WriteColumnPositions(Writer: TWriter);
Private procedure WriteRowPositions(Writer: TWriter);
Private procedure SetDisplayColumn(Value: integer);
Private procedure SetDisplayLayer(Value: integer);
Private procedure SetDisplayRow(Value: integer);
Private procedure RecordColoredGridEdges;
Private procedure DrawLeftCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
Private procedure DrawRightCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
Private procedure DrawBackCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
Private procedure DrawFrontCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
Private procedure DrawBottomCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
Private procedure DrawTopCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
Private procedure CreateBlockGlGrid;
Private procedure CreateNodeGlGrid;
Private function PrivateGlGrid(EvaluatedAt: TEvaluatedAt; ModelSelection: TModelSelection):TGrid;
Private procedure SetGridLineDrawingChoice(const Value: TGridLineDrawingChoice);
Private procedure DrawTopContours(const ZoomBox: TQRbwZoomBox2; const BitMap: TBitmap32);
Private procedure SetCanDraw(const Value: boolean);
Private procedure SetOnSelectedLayerChange(const Value: TNotifyEvent);
Private procedure CacheBlockGlGrid;
Private procedure CacheGlGrid(GridCacheStream: TMemoryStream; var AGlGrid: TGrid);
Private procedure RestoreBlockGlGrid;
Private procedure RestoreGlGrid(var AGlGrid: TGrid; GridCacheStream: TMemoryStream);
Private procedure CacheNodeGlGrid;
Private procedure RestoreNodeGlGrid;
Private function IsActiveOk(const DataSet: TDataArray; const Layer, Row, Col: integer): boolean;
Private procedure DrawOrdinaryTopRows(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2);
Private procedure DrawOrdinaryTopColumns(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2);
Private procedure GetCounts(DataSet: TDataArray; var LayerCount, RowCount, ColCount: integer);
Private function GetCellCoordinates(Col, Row, Layer: integer): T3DCellCoordinates;
Private function GetElementCoordinates(Col, Row, Layer: integer): T3DElementCoordinates;
Private procedure InvalidateScreenObjects;
Private procedure SetOnSelectedColumnChange(const Value: TNotifyEvent);
Private procedure SetOnSelectedRowChange(const Value: TNotifyEvent);
Private function GetThreeDGridObserver: TObserver;
Private function GetCanDraw: boolean;
Protected procedure UpdateMinMax(const Layer, Row, Col: integer; DataSet: TDataArray; var MinMaxInitialized: boolean; var MinMax: TMinMax; StringValues: TStringList); override;
Protected procedure SetMinMax(DataSet: TDataArray; var MinMaxInitialized: boolean; var MinMax: TMinMax; StringValues: TStringList; LayerCount, RowCount, ColCount: integer); override;
Protected procedure CalculateMinMax(DataSet: TDataArray; var MinMaxInitialized: Boolean; var MinMax: TMinMax; StringValues: TStringList); override;
Protected procedure ColumnsChanged;
Protected procedure DefineProperties(Filer: TFiler); override;
Protected procedure DrawFront(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2); virtual; abstract;
Protected procedure DrawSide(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2); virtual; abstract;
Protected procedure DrawTop(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2); 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 GetTwoDCellElevations(const Col, Row: integer): TOneDRealArray; virtual; abstract;
Protected procedure LayersChanged;
Protected function NearestColumnOrRow(const Positions: TOneDRealArray; const APosition: real; const First: integer = -1; const Last: integer = -1): integer;
Protected procedure RecordColoredGrid; virtual;
Protected procedure RecordFront; virtual;
Protected procedure RecordShell; virtual;
Protected procedure RecordSide; virtual;
Protected procedure RecordTop; virtual;
Protected procedure RowsChanged;
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 SetColumnLineColor(ColIndex: Integer; LocalEvalAt: TEvaluatedAt; var LocalLineColor: TColor32; var LineWidth: single);
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 SetLayerLineColor(LayerIndex: Integer; LocalEvalAt: TEvaluatedAt; var LocalLineColor: TColor32; var LineWidth: single);
Protected procedure SetLocalEvalAt(ViewDirection: TViewDirection; var LocalEvalAt: TEvaluatedAt);
Protected procedure SetRowCount(const Value: integer); virtual;
Protected procedure SetRowDirection(const Value: TRowDirection); virtual;
Protected procedure SetRowLineColor(RowIndex: Integer; LocalEvalAt: TEvaluatedAt; var LocalLineColor: TColor32; var LineWidth: single);
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;
Protected procedure Update3DCellColors(var CellColors: TCellColors);
Protected procedure ElementCountChanged;
Protected procedure DrawFrontContours(const ZoomBox: TQRbwZoomBox2; const BitMap: TBitmap32);
Protected procedure DrawSideContours(const ZoomBox: TQRbwZoomBox2; const BitMap: TBitmap32);
Protected function IsElementActive(const Layer, Row, Col: integer): boolean;
Protected procedure SetFrontContourDataSet(const Value: TDataArray); virtual;
Protected procedure SetSideContourDataSet(const Value: TDataArray); virtual;
Protected procedure SetThreeDContourDataSet(const Value: TDataArray); virtual;
Protected procedure SetTopContourDataSet(const Value: TDataArray); virtual;
Protected procedure SetSideDataSet(const Value: TDataArray); virtual;
Protected procedure SetThreeDDataSet(const Value: TDataArray); virtual;
Protected procedure SetTopDataSet(const Value: TDataArray); virtual;
Protected procedure SetFrontDataSet(const Value: TDataArray); virtual;
Protected function GetChildDataArray(const Value: TDataArray; ChildModel: TBaseModel): TDataArray;
Public function OkLocation(const DataSet: TDataArray; const Layer, Row, Col: integer): boolean; override;
Public procedure GetRealMinMax(DataSet: TDataArray; var MinMax: TMinMax);
Public procedure GetIntegerMinMax(DataSet: TDataArray; var MinMax: TMinMax);
Public procedure GetBooleanMinMax(DataSet: TDataArray; var MinMax: TMinMax);
Public procedure GetStringMinMax(DataSet: TDataArray; var MinMax: TMinMax);
Public function ContourGrid(EvaluatedAt: TEvaluatedAt; ModelSelection: TModelSelection; ViewDirection: TViewDirection; ColRowOrLayer: integer): T2DGrid;
Public procedure BeginLayerChange;
Public procedure EndLayerChange;
Public procedure BeginGridChange;
Public procedure EndGridChange;
Public procedure BeginColumnChange;
Public procedure EndColumnChange;
Public procedure BeginRowChange;
Public procedure EndRowChange;
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(Model: TBaseModel);
Public procedure DeleteColumn(const AColumn: integer);
Public procedure DeleteRow(const ARow: integer);
Public destructor Destroy; override;
Public procedure Draw(const BitMap: TBitmap32; const ViewDirection: TViewDirection);
Public procedure Draw3D; virtual;
Public function GetContainingColumn(const AnXPosition: real): integer;
Public function GetContainingLayer(ACol, ARow: integer; const AZPosition: real): integer; virtual; abstract;
Public function GetContainingRow(const AYPosition: real): integer;
Public procedure GetLimits(const EvaluatedAt: TEvaluatedAt; const ViewDirection: TViewDirection; out Limit1, Limit2: integer);
Public procedure GridChanged;
Public function HighestElevation: real; virtual; abstract;
Public procedure Initialize;
Public function LowestElevation: real; virtual; abstract;
Public function Nearest2DCellElevation(const Col, Row: integer; const APosition: real; const First: integer = -1; const Last: integer = -1): integer;
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: TPoint2D): TPoint2D; overload;
Public procedure RotateFromGridCoordinatesToRealWorldCoordinates(var X, Y: TFloat); overload;
Public function RotateFromRealWorldCoordinatesToGridCoordinates (const APoint: TPoint2D): TPoint2D;
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 RotatedThreeDElementCenter(const Column, Row, Layer: integer): T3DRealPoint;
Public function ThreeDElementCorner(const Column, Row, Layer: integer): T3DRealPoint; virtual;
Public function RotatedThreeDElementCorner(const Column, Row, Layer: integer): T3DRealPoint;
Public function ThreeDCellCorner(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: TPoint2D; 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 TwoDCellCorner(const Column, Row: integer): TPoint2D;
Public function TwoDColumnEdgeCenter(const Column, Row: integer): TPoint2D;
Public function TwoDElementCenter(const Column, Row: integer): TPoint2D;
Public function UnrotatedTwoDElementCenter(const Column, Row: integer): TPoint2D;
Public function TwoDElementCorner(const Column, Row: integer): TPoint2D;
Public function UnrotatedTwoDElementCorner(const Column, Row: integer): TPoint2D;
Public function TwoDRowEdgeCenter(const Column, Row: integer): TPoint2D;
Public procedure UpdateCellColors(const ViewDirection: TViewDirection);
Public procedure UpdateColumnPositions; virtual;
Public procedure UpdateRowPositions; virtual;
Public procedure ViewsChanged;
Public function GlGrid(EvaluatedAt: TEvaluatedAt; ModelSelection: TModelSelection): TGrid;
Public function LayerCenter(Column, Row, Layer: integer): real;
Public function GridLimits(ViewDirection: TViewDirection): TGridLimit;
Public function GridOutline(ViewDirection: TViewDirection): TPolygon2D;
Public procedure GetMinMax(var MinMax: TMinMax; DataSet: TDataArray; StringValues: TStringList); override;

Properties

Protected property EdgesGLIndex: GLuint read FEdgesGLIndex;
Protected property CellsGLIndex: GLuint read FCellsGLIndex;
Protected property FrontGridGLIndex: GLuint read FFrontGridGLIndex;
Protected property GridShellGLIndex: GLuint read FGridShellGLIndex;
Protected property SideGridGLIndex: GLuint read FSideGridGLIndex;
Protected property TopGridGLIndex: GLuint read FTopGridGLIndex;
Public property Drawing3DGrid: boolean read FDrawing3DGrid;
Public property CanDraw: boolean read GetCanDraw write SetCanDraw;
Public property Draw3DAllowed: boolean read FDraw3DAllowed write FDraw3DAllowed;
Public property CellElevation[constColumn,Row,Layer:integer]: real read GetCellElevation write SetCellElevation;
Public property CellThickness[constColumn,Row,Layer:integer]: real read GetCellThickness write SetCellThickness;
Public property ColumnPosition[constColumn:integer]: real read GetColumnPosition write SetColumnPosition;
Public property ColumnPositions: TOneDRealArray read FColumnPositions write SetColumnPositions;
Public property ColumnWidth[constColumn:integer]: real read GetColumnWidth write SetColumnWidth;
Public property ColWidths: TOneDRealArray read GetColWidths;
Public property GridLineDrawingChoice: TGridLineDrawingChoice read FGridLineDrawingChoice write SetGridLineDrawingChoice;
Public property FrontCellColors[constColumn,Layer:integer]: TColor read GetFrontCellColors write SetFrontCellColors;
Public property FrontDataSet: TDataArray read FFrontDataSet write SetFrontDataSet;
Public property FrontContourDataSet: TDataArray read FFrontContourDataSet write SetFrontContourDataSet;
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 OnSelectedColumnChange: TNotifyEvent read FOnSelectedColumnChange write SetOnSelectedColumnChange;
Public property OnSelectedLayerChange: TNotifyEvent read FOnSelectedLayerChange write SetOnSelectedLayerChange;
Public property OnSelectedRowChange: TNotifyEvent read FOnSelectedRowChange write SetOnSelectedRowChange;
Public property RowPosition[constRow:integer]: real read GetRowPosition write SetRowPosition;
Public property RowPositions: TOneDRealArray read FRowPositions write SetRowPositions;
Public property RowWidth[constRow:integer]: real read GetRowWidth write SetRowWidth;
Public property RowWidths: TOneDRealArray read GetRowWidths;
Public property SideCellColors[constRow,Layer:integer]: TColor read GetSideCellColors write SetSideCellColors;
Public property SideDataSet: TDataArray read FSideDataSet write SetSideDataSet;
Public property SideContourDataSet: TDataArray read FSideContourDataSet write SetSideContourDataSet;
Public property ThreeDDataSet: TDataArray read FThreeDDataSet write SetThreeDDataSet;
Public property ThreeDContourDataSet: TDataArray read FThreeDContourDataSet write SetThreeDContourDataSet;
Public property ThreeDGridObserver: TObserver read GetThreeDGridObserver write SetThreeDGridObserver;
Public property TopCellColors[constColumn,Row:integer]: TColor read GetTopCellColors write SetTopCellColors;
Public property TwoDCellElevations[constCol,Row:integer]: TOneDRealArray read GetTwoDCellElevations;
Public property TopDataSet: TDataArray read FTopDataSet write SetTopDataSet;
Public property TopContourDataSet: TDataArray read FTopContourDataSet write SetTopContourDataSet;
Public property TopGridObserver: TObserver read FTopGridObserver write SetTopGridObserver;
Public property DrawColoredGridLines: boolean read FDrawColoredGridLines write FDrawColoredGridLines;
Public property CellCoordinates[Col,Row,Layer:integer]: T3DCellCoordinates read GetCellCoordinates;
Public property ElementCoordinates[Col,Row,Layer:integer]: T3DElementCoordinates read GetElementCoordinates;
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 stored True;
Published property SelectedLayer: integer read FSelectedLayer write SetSelectedLayer stored True;
Published property SelectedRow: integer read FSelectedRow write SetSelectedRow stored True;
Published property DisplayColumn: integer read FDisplayColumn write SetDisplayColumn stored True;
Published property DisplayRow: integer read FDisplayRow write SetDisplayRow stored True;
Published property DisplayLayer: integer read FDisplayLayer write SetDisplayLayer stored True;

Description

Fields

Private FEdgesGLIndex: GLuint;

See EdgesGLIndex.

Private FCellsGLIndex: GLuint;

See CellsGLIndex.

Private FColumnCount: integer;

See ColumnCount.

Private FColumnDirection: TColumnDirection;

See ColumnDirection.

Private FColumnPositions: TOneDRealArray;

See ColumnPositions.

Private FFrontCellColors: array of array of TColor;

See FrontCellColors.

Private FFrontDataSet: TDataArray;

See FrontDataSet.

Private FFrontGridGLIndex: GLuint;

See FrontGridGLIndex.

Private FGridAngle: real;

See GridAngle.

Private FGridShellGLIndex: GLuint;

See GridShellGLIndex.

Private FLayerCount: integer;

See LayerCount.

Private FLayerDirection: TLayerDirection;

See LayerDirection.

Private FNeedToRecalculate3DCellColors: boolean;

See NeedToRecalculate3DCellColors.

Private FOnSelectedColumnChange: TNotifyEvent;

See OnSelectedColumnChange.

Private FOnSelectedLayerChange: TNotifyEvent;

FOnSelectedLayerChange: TNotifyEvent; See OnSelectedLayerChange.

Private FOnSelectedRowChange: TNotifyEvent;

See OnSelectedRowChange.

Private FRowCount: integer;

See RowCount.

Private FRowDirection: TRowDirection;

See RowDirection.

Private FRowPositions: TOneDRealArray;

See RowPositions.

Private FSelectedColumn: integer;

See SelectedColumn.

Private FSelectedLayer: integer;

See SelectedLayer.

Private FSelectedRow: integer;

See SelectedRow.

Private FSideCellColors: array of array of TColor;

See SideCellColors.

Private FSideDataSet: TDataArray;

See SideDataSet.

Private FSideGridGLIndex: GLuint;

See SideGridGLIndex

Private FThreeDDataSet: TDataArray;

See ThreeDDataSet.

Private FTopCellColors: array of array of TColor;

See TopCellColors.

Private FTopDataSet: TDataArray;

See TopDataSet.

Private FTopGridGLIndex: GLuint;

See TopGridGLIndex.

Private FTopGridObserver: TObserver;

See TopGridObserver.

Private FThreeDGridObserver: TObserver;

See ThreeDGridObserver.

Private FDisplayColumn: integer;

See DisplayColumn.

Private FDisplayLayer: integer;

See DisplayLayer.

Private FDisplayRow: integer;

See DisplayRow.

Private FLayerUpdate: Integer;

FLayerUpdate is used in LayersChanged to delay redrawing the grid while there are still pending changes.

See also
BeginLayerChange
EndLayerChange
Private FColumnUpdate: Integer;

FColumnUpdate is used in ColumnsChanged to delay redrawing the grid while there are still pending changes.

See also
BeginColumnChange
EndColumnChange
Private FGridUpdate: Integer;

FGridUpdate is used in GridChanged to delay redrawing the grid while there are still pending changes.

See also
BeginGridChange
EndGridChange
Private FRowUpdate: Integer;

FRowUpdate is used in RowsChanged to delay redrawing the grid while there are still pending changes.

See also
BeginRowChange
EndRowChange
Private FNodeGlGrid: TGrid;

See CreateNodeGlGrid.

Private FBlockGlGrid: TGrid;

See CreateBlockGlGrid.

Private FTopNodeContourGrid: T2DGrid;

FTopNodeContourGrid is used for drawing contours on the top view of the model for data evaluated at nodes. See ContourGrid.

Private FFrontNodeContourGrid: T2DGrid;

FFrontNodeContourGrid is used for drawing contours on the front view of the model for data evaluated at nodes. See ContourGrid.

Private FSideNodeContourGrid: T2DGrid;

FSideNodeContourGrid is used for drawing contours on the side view of the model for data evaluated at nodes. See ContourGrid.

Private FTopElementContourGrid: T2DGrid;

FTopElementContourGrid is used for drawing contours on the top view of the model for data evaluated at elements. See ContourGrid.

Private FFrontElementContourGrid: T2DGrid;

FFrontElementContourGrid is used for drawing contours on the front view of the model for data evaluated at elements. See ContourGrid.

Private FSideElementContourGrid: T2DGrid;

FSideElementContourGrid is used for drawing contours on the side view of the model for data evaluated at elements. See ContourGrid.

Private FRecordedShell: Boolean;

FRecordedShell is used to store whether or not the grid shell display in 3D has been recorded or not.

Private FRecordedSideGrid: Boolean;

FRecordedSideGrid is used to store whether or not the grid in side view in 3D has been recorded or not.

Private FRecordedFrontGrid: Boolean;

FRecordedFrontGrid is used to store whether or not the grid in front view in 3D has been recorded or not.

Private FRecordedTopGrid: Boolean;

FRecordedTopGrid is used to store whether or not the grid in top view in 3D has been recorded or not.

Private FElementCount: integer;

FElementCount is the number of elements in a grid. (In MODFLOW, FElementCount is the number of cells in the grid.)

Private FGridLineDrawingChoice: TGridLineDrawingChoice;
 
Private FTopContourDataSet: TDataArray;
 
Private FThreeDContourDataSet: TDataArray;
 
Private FFrontContourDataSet: TDataArray;
 
Private FSideContourDataSet: TDataArray;
 
Private FDrawing3DGrid: Boolean;
 
Private FCanDraw: boolean;
 
Private FDraw3DAllowed: boolean;
 
Private FBlockGridCache: TMemoryStream;
 
Private FNodeGridCache: TMemoryStream;
 
Private FDrawColoredGridLines: boolean;
 
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 colored cells in the grid or the grid shell need to be redrawn.

Methods

Private function GetColWidths: TOneDRealArray;

See ColWidths.

Private function GetRowWidths: TOneDRealArray;

See RowWidths.

Private function GetWidths(const PositionArray: TOneDRealArray): TOneDRealArray;

GetWidths returns an array that has a length equal to Length(PositionArray)-1. The result has the difference between each adjacent member of PositionArray. GetWidths is used in GetColWidths and GetRowWidths.

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 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 SetThreeDGridObserver(const Value: TObserver);

See @1ink(ThreeDGridObserver).

Private procedure SetTopGridObserver(const Value: TObserver);

See @1ink(TopGridObserver).

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.

Private procedure SetDisplayColumn(Value: integer);

See DisplayColumn.

Private procedure SetDisplayLayer(Value: integer);

See DisplayLayer.

Private procedure SetDisplayRow(Value: integer);

See DisplayRow.

Private procedure RecordColoredGridEdges;
 
Private procedure DrawLeftCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
 
Private procedure DrawRightCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
 
Private procedure DrawBackCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
 
Private procedure DrawFrontCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
 
Private procedure DrawBottomCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
 
Private procedure DrawTopCellSide3D(ColIndex, RowIndex, LayerIndex: integer; const XPositions, YPositions: TOneDRealArray; const ZPositions: TThreeDRealArray);
 
Private procedure CreateBlockGlGrid;

CreateBlockGlGrid creates FBlockGlGrid which can be used for drawing isosurfaces of data at nodes. FBlockGlGrid has dimensions (ColumnCount + 2, RowCount + 2, LayerCount + 2. Thus there is an extra point in each direction outside the element centers. These points are used in drawing TScreenObjects in 3D.

CreateBlockGlGrid is called by PrivateGlGrid.

Private procedure CreateNodeGlGrid;

CreateNodeGlGrid creates FNodeGlGrid which can be used for drawing isosurfaces of data at nodes. FNodeGlGrid has dimensions (ColumnCount + 3, RowCount + 3, LayerCount + 3. Thus there is an extra point in each direction outside the grid. These points are used in drawing TScreenObjects in 3D.

CreateNodeGlGrid is called by PrivateGlGrid.

Private function PrivateGlGrid(EvaluatedAt: TEvaluatedAt; ModelSelection: TModelSelection):TGrid;

PrivateGlGrid creates and caches a TGrid which can then be used for drawing isosurfaces or contour lines. PrivateGlGrid is called from ContourGrid and GlGrid.

Private procedure SetGridLineDrawingChoice(const Value: TGridLineDrawingChoice);
 
Private procedure DrawTopContours(const ZoomBox: TQRbwZoomBox2; const BitMap: TBitmap32);
 
Private procedure SetCanDraw(const Value: boolean);
 
Private procedure SetOnSelectedLayerChange(const Value: TNotifyEvent);
 
Private procedure CacheBlockGlGrid;
 
Private procedure CacheGlGrid(GridCacheStream: TMemoryStream; var AGlGrid: TGrid);
 
Private procedure RestoreBlockGlGrid;
 
Private procedure RestoreGlGrid(var AGlGrid: TGrid; GridCacheStream: TMemoryStream);
 
Private procedure CacheNodeGlGrid;
 
Private procedure RestoreNodeGlGrid;
 
Private function IsActiveOk(const DataSet: TDataArray; const Layer, Row, Col: integer): boolean;
 
Private procedure DrawOrdinaryTopRows(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2);
 
Private procedure DrawOrdinaryTopColumns(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2);
 
Private procedure GetCounts(DataSet: TDataArray; var LayerCount, RowCount, ColCount: integer);
 
Private function GetCellCoordinates(Col, Row, Layer: integer): T3DCellCoordinates;
 
Private function GetElementCoordinates(Col, Row, Layer: integer): T3DElementCoordinates;
 
Private procedure InvalidateScreenObjects;
 
Private procedure SetOnSelectedColumnChange(const Value: TNotifyEvent);
 
Private procedure SetOnSelectedRowChange(const Value: TNotifyEvent);
 
Private function GetThreeDGridObserver: TObserver;
 
Private function GetCanDraw: boolean;
 
Protected procedure UpdateMinMax(const Layer, Row, Col: integer; DataSet: TDataArray; var MinMaxInitialized: boolean; var MinMax: TMinMax; StringValues: TStringList); override;
 
Protected procedure SetMinMax(DataSet: TDataArray; var MinMaxInitialized: boolean; var MinMax: TMinMax; StringValues: TStringList; LayerCount, RowCount, ColCount: integer); override;
 
Protected procedure CalculateMinMax(DataSet: TDataArray; var MinMaxInitialized: Boolean; var MinMax: TMinMax; StringValues: TStringList); override;
 
Protected procedure ColumnsChanged;

ColumnsChanged causes TopGridObserver to have UpToDate set to false and then to true. That will invalidate everything that depends on TopGridObserver.

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 BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2); virtual; abstract;

DrawFront draws a front view of the grid on BitMap.

Protected procedure DrawSide(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2); virtual; abstract;

DrawSide draws a side view of the grid on BitMap.

Protected procedure DrawTop(const BitMap: TBitmap32; const ZoomBox: TQRbwZoomBox2); virtual;

DrawTop draws a top view of the grid on BitMap.

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.

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 GetTwoDCellElevations(const Col, Row: integer): TOneDRealArray; virtual; abstract;

See TwoDCellElevations

Protected procedure LayersChanged;

LayersChanged causes ThreeDGridObserver to have UpToDate set to false and then to true. That will invalidate everything that depends on ThreeDGridObserver.

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 RecordColoredGrid; virtual;

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

Protected procedure RecordFront; virtual;

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

Protected procedure RecordShell; virtual;

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

Protected procedure RecordSide; virtual;

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

Protected procedure RecordTop; virtual;

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

Protected procedure RowsChanged;

RowsChanged causes TopGridObserver to have UpToDate set to false and then to true. That will invalidate everything that depends on TopGridObserver.

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 SetColumnLineColor(ColIndex: Integer; LocalEvalAt: TEvaluatedAt; var LocalLineColor: TColor32; var LineWidth: single);

SetColumnLineColor sets LocalLineColor to an appropriate value for the column indicated by ColIndex.

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 SetLayerLineColor(LayerIndex: Integer; LocalEvalAt: TEvaluatedAt; var LocalLineColor: TColor32; var LineWidth: single);

SetLayerLineColor sets LocalLineColor to an appropriate value for the layer indicated by LayerIndex.

Protected procedure SetLocalEvalAt(ViewDirection: TViewDirection; var LocalEvalAt: TEvaluatedAt);

SetLocalEvalAt sets LocalEvalAt to an appropriate value based on ViewDirection and the data set used to color the grid.

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

See RowCount.

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

See RowDirection.

Protected procedure SetRowLineColor(RowIndex: Integer; LocalEvalAt: TEvaluatedAt; var LocalLineColor: TColor32; var LineWidth: single);

SetRowLineColor sets LocalLineColor to an appropriate value for the row indicated by ColIndex.

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.

Protected procedure Update3DCellColors(var CellColors: TCellColors);

Update3DCellColors modifies CellColors to reflect the values of ThreeDDataSet.

Protected procedure ElementCountChanged;
 
Protected procedure DrawFrontContours(const ZoomBox: TQRbwZoomBox2; const BitMap: TBitmap32);
 
Protected procedure DrawSideContours(const ZoomBox: TQRbwZoomBox2; const BitMap: TBitmap32);
 
Protected function IsElementActive(const Layer, Row, Col: integer): boolean;
 
Protected procedure SetFrontContourDataSet(const Value: TDataArray); virtual;
 
Protected procedure SetSideContourDataSet(const Value: TDataArray); virtual;
 
Protected procedure SetThreeDContourDataSet(const Value: TDataArray); virtual;
 
Protected procedure SetTopContourDataSet(const Value: TDataArray); virtual;
 
Protected procedure SetSideDataSet(const Value: TDataArray); virtual;

See SideDataSet.

Protected procedure SetThreeDDataSet(const Value: TDataArray); virtual;

See ThreeDDataSet.

Protected procedure SetTopDataSet(const Value: TDataArray); virtual;

See TopDataSet.

Protected procedure SetFrontDataSet(const Value: TDataArray); virtual;

See FrontDataSet.

Protected function GetChildDataArray(const Value: TDataArray; ChildModel: TBaseModel): TDataArray;
 
Public function OkLocation(const DataSet: TDataArray; const Layer, Row, Col: integer): boolean; override;
 
Public procedure GetRealMinMax(DataSet: TDataArray; var MinMax: TMinMax);
 
Public procedure GetIntegerMinMax(DataSet: TDataArray; var MinMax: TMinMax);
 
Public procedure GetBooleanMinMax(DataSet: TDataArray; var MinMax: TMinMax);
 
Public procedure GetStringMinMax(DataSet: TDataArray; var MinMax: TMinMax);
 
Public function ContourGrid(EvaluatedAt: TEvaluatedAt; ModelSelection: TModelSelection; ViewDirection: TViewDirection; ColRowOrLayer: integer): T2DGrid;

ContourGrid creates and caches a T2DGrid which can then be used in drawing contour lines in DrawContour. The dimensions are based on the dimensions of GlGrid.

Public procedure BeginLayerChange;
 
Public procedure EndLayerChange;
 
Public procedure BeginGridChange;
 
Public procedure EndGridChange;
 
Public procedure BeginColumnChange;
 
Public procedure EndColumnChange;
 
Public procedure BeginRowChange;
 
Public procedure EndRowChange;
 
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(Model: TBaseModel);

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;

Destroy gets rid of OpenGL display lists.

Public procedure Draw(const BitMap: TBitmap32; const ViewDirection: TViewDirection);

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

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

Draw3D draws the grid in the current OpenGL rendering context.

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

GetContainingColumn returns the column that contains AnXPosition. See GetContainingColumnOrRow.

Public function GetContainingLayer(ACol, ARow: integer; const AZPosition: real): integer; virtual; abstract;

GetContainingLayer returns the layer at (ACol, ARow) that contains AZPosition.

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

GetContainingRow returns the row that contains AYPosition. See GetContainingColumnOrRow.

Public procedure GetLimits(const EvaluatedAt: TEvaluatedAt; const ViewDirection: TViewDirection; out Limit1, Limit2: integer);

GetLimits returns the limits of one of the sparse 2D elevation arrays in a TScreenObject in Limit1 and Limit2. Depending on ViewDirection. Limit1 and Limit2 will be

  • Column and Row limits for top view

  • Column and Layer limits for front view

  • Row and Layer limits for side view

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 function HighestElevation: real; virtual; abstract;

HighestElevation returns the highest elevation in the grid.

See also
LowestElevation
LowestElevation returns the lowest elevation in the grid.
Public procedure Initialize;

Initialize sets display TDataArrays such as TopDataSet, FrontDataSet to nil. Resets DisplayLayer DisplayRow and DisplayColumn to 0 if they are less than zero.

Public function LowestElevation: real; virtual; abstract;

LowestElevation returns the lowest elevation in the grid.

See also
HighestElevation
HighestElevation returns the highest elevation in the grid.
Public function Nearest2DCellElevation(const Col, Row: integer; const APosition: real; const First: integer = -1; const Last: integer = -1): integer;

Nearest2DCellElevation returns the index of the layer boundary in (Col, Row) that is closest to APosition.

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: TPoint2D): TPoint2D; overload;

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

Public procedure RotateFromGridCoordinatesToRealWorldCoordinates(var X, Y: TFloat); overload;
 
Public function RotateFromRealWorldCoordinatesToGridCoordinates (const APoint: TPoint2D): TPoint2D;

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 RotatedThreeDElementCenter(const Column, Row, Layer: integer): T3DRealPoint;
 
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 RotatedThreeDElementCorner(const Column, Row, Layer: integer): T3DRealPoint;
 
Public function ThreeDCellCorner(Column, Row, Layer: integer): T3DRealPoint; virtual;
 
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: TPoint2D; 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 TwoDCellCorner(const Column, Row: integer): TPoint2D;

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

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

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

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

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

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

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

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

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;

update this. notify the views that the need to redraw;

Public function GlGrid(EvaluatedAt: TEvaluatedAt; ModelSelection: TModelSelection): TGrid;

The result of GlGrid is used in drawing TScreenObjects in the 3D view. The dimensions are ColumnCount + 2, RowCount + 2, LayerCount + 2 if EvaluatedAt = eaBlocks and ColumnCount + 3, RowCount + 3, LayerCount + 3 if EvaluatedAt = eaNodes.

Public function LayerCenter(Column, Row, Layer: integer): real;

LayerCenter returns the elevation of the center of an element.

Public function GridLimits(ViewDirection: TViewDirection): TGridLimit;

GridLimits returns the extent of the grid in grid coordinates;

Public function GridOutline(ViewDirection: TViewDirection): TPolygon2D;
 
Public procedure GetMinMax(var MinMax: TMinMax; DataSet: TDataArray; StringValues: TStringList); override;
 

Properties

Protected property EdgesGLIndex: GLuint read FEdgesGLIndex;

EdgesGLIndex is used to store an OpenGL display list for display of properties of the edges of cells. EdgesGLIndex is used to display Horizontal Flow Barriers in MODFLOW.

Protected property CellsGLIndex: GLuint read FCellsGLIndex;

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

Protected property FrontGridGLIndex: GLuint read FFrontGridGLIndex;

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

Protected property GridShellGLIndex: GLuint read FGridShellGLIndex;

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

Protected property SideGridGLIndex: GLuint read FSideGridGLIndex;

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

Protected property TopGridGLIndex: GLuint read FTopGridGLIndex;

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

Public property Drawing3DGrid: boolean read FDrawing3DGrid;
 
Public property CanDraw: boolean read GetCanDraw write SetCanDraw;
 
Public property Draw3DAllowed: boolean read FDraw3DAllowed write FDraw3DAllowed;
 
Public property CellElevation[constColumn,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[constColumn,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[constColumn: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[constColumn:integer]: real read GetColumnWidth write SetColumnWidth;

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

Public property ColWidths: TOneDRealArray read GetColWidths;

ColWidths represents an array of column widths.

Public property GridLineDrawingChoice: TGridLineDrawingChoice read FGridLineDrawingChoice write SetGridLineDrawingChoice;

If GridLineDrawingChoice is True, the grid will be displayed with (1) all it's grid lines in 2D views of the model (2) only the first, last and selected grid lines, or (3) only grid lines next to active elements.

Public property FrontCellColors[constColumn,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 FrontContourDataSet: TDataArray read FFrontContourDataSet write SetFrontContourDataSet;
 
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 OnSelectedColumnChange: TNotifyEvent read FOnSelectedColumnChange write SetOnSelectedColumnChange;

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

Public property OnSelectedLayerChange: TNotifyEvent read FOnSelectedLayerChange write SetOnSelectedLayerChange;

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

Public property OnSelectedRowChange: TNotifyEvent read FOnSelectedRowChange write SetOnSelectedRowChange;

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

Public property RowPosition[constRow: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[constRow:integer]: real read GetRowWidth write SetRowWidth;

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

Public property RowWidths: TOneDRealArray read GetRowWidths;

RowWidths represents an array of rows widths.

Public property SideCellColors[constRow,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 SideContourDataSet: TDataArray read FSideContourDataSet write SetSideContourDataSet;
 
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 ThreeDContourDataSet: TDataArray read FThreeDContourDataSet write SetThreeDContourDataSet;
 
Public property ThreeDGridObserver: TObserver read GetThreeDGridObserver write SetThreeDGridObserver;

ThreeDGridObserver is used to notify TScreenObjects and TDataArrays That they need to redraw themselves due to a change in the columns, rows. or layers.

Public property TopCellColors[constColumn,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 TwoDCellElevations[constCol,Row:integer]: TOneDRealArray read GetTwoDCellElevations;

TwoDCellElevations represents a one-dimensional array of values representing the top and bottom elevations of the elements at (Col,Row).

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 TopContourDataSet: TDataArray read FTopContourDataSet write SetTopContourDataSet;
 
Public property TopGridObserver: TObserver read FTopGridObserver write SetTopGridObserver;

TopGridObserver is used to notify TScreenObjects and TDataArrays That they need to redraw themselves due to a change in the columns or rows.

Public property DrawColoredGridLines: boolean read FDrawColoredGridLines write FDrawColoredGridLines;
 
Public property CellCoordinates[Col,Row,Layer:integer]: T3DCellCoordinates read GetCellCoordinates;
 
Public property ElementCoordinates[Col,Row,Layer:integer]: T3DElementCoordinates read GetElementCoordinates;
 
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 stored True;

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 stored True;

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 stored True;

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.
Published property DisplayColumn: integer read FDisplayColumn write SetDisplayColumn stored True;

DisplayColumn is the grid column that should be displayed on the 3D view.

Published property DisplayRow: integer read FDisplayRow write SetDisplayRow stored True;

DisplayRow is the grid row that should be displayed on the 3D view.

Published property DisplayLayer: integer read FDisplayLayer write SetDisplayLayer stored True;

DisplayLayer is the grid layer that should be displayed on the 3D view.


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