1
unit LUX.GPU.OpenGL.Atom.Buffer.PixBuf.D3;
3
interface //#################################################################### ■
6
Winapi.OpenGL, Winapi.OpenGLext,
9
LUX.GPU.OpenGL.Atom.Buffer,
10
LUX.GPU.OpenGL.Atom.Textur,
11
LUX.GPU.OpenGL.Atom.Buffer.PixBuf,
12
LUX.GPU.OpenGL.Atom.Buffer.PixBuf.D2;
14
type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】
16
IGLPixBuf3D = interface;
17
IGLPoiPix3D = interface;
18
IGLCelPix3D = interface;
20
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】
22
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】
24
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPixBufIter3D<_TItem_>
26
TGLPixBufIter3D<_TItem_:record> = class( TGLPixBufIter2D<_TItem_> )
28
_PItem_ = TGLPixBufIter2D<_TItem_>._PItem_;
31
function GetParen :IGLPixBuf3D;
32
function GetElemsZ :Integer;
33
function GetItemsZ :Integer;
34
function GetMargsZ :Integer;
35
function GetPoinsZ :Integer;
36
function GetCellsZ :Integer;
38
function ItemsI( const X_,Y_,Z_:Integer ) :Integer;
41
property Paren :IGLPixBuf3D read GetParen ;
42
property ElemsZ :Integer read GetElemsZ;
43
property ItemsZ :Integer read GetItemsZ;
44
property MargsZ :Integer read GetMargsZ;
45
property PoinsZ :Integer read GetPoinsZ;
46
property CellsZ :Integer read GetCellsZ;
49
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPixBuf3D<_TItem_,_TIter_>
51
IGLPixBuf3D = interface( IGLPixBuf2D )
52
['{68D24B25-0598-466A-BD4D-BBAFC369B5CD}']
55
function GetElemsZ :Integer;
56
function GetItemsZ :Integer;
57
procedure SetItemsZ( const ItemsZ_:Integer );
58
function GetMargsZ :Integer;
59
procedure SetMargsZ( const MargsZ_:Integer );
60
function GetPoinsZ :Integer;
61
procedure SetPoinsZ( const PoinsZ_:Integer );
62
function GetCellsZ :Integer;
63
procedure SetCellsZ( const CellsZ_:Integer );
66
property ElemsZ :Integer read GetElemsZ ;
67
property ItemsZ :Integer read GetItemsZ write SetItemsZ;
68
property MargsZ :Integer read GetMargsZ write SetMargsZ;
69
property PoinsZ :Integer read GetPoinsZ write SetPoinsZ;
70
property CellsZ :Integer read GetCellsZ write SetCellsZ;
73
//-------------------------------------------------------------------------
75
TGLPixBuf3D<_TItem_:record;
76
_TIter_:TGLPixBufIter3D<_TItem_>,constructor> = class( TGLPixBuf2D<_TItem_,_TIter_>, IGLPixBuf3D )
82
function GetElemsN :Integer; override;
83
function GetPoinsN :Integer; override;
84
function GetCellsN :Integer; override;
85
function GetElemsZ :Integer;
86
function GetItemsZ :Integer;
87
procedure SetItemsZ( const ItemsZ_:Integer );
88
function GetMargsZ :Integer;
89
procedure SetMargsZ( const MargsZ_:Integer );
90
function GetPoinsZ :Integer; virtual; abstract;
91
procedure SetPoinsZ( const PoinsZ_:Integer ); virtual; abstract;
92
function GetCellsZ :Integer; virtual; abstract;
93
procedure SetCellsZ( const CellsZ_:Integer ); virtual; abstract;
95
constructor Create( const Usage_:GLenum ); override;
97
property ElemsZ :Integer read GetElemsZ ;
98
property ItemsZ :Integer read GetItemsZ write SetItemsZ;
99
property MargsZ :Integer read GetMargsZ write SetMargsZ;
100
property PoinsZ :Integer read GetPoinsZ write SetPoinsZ;
101
property CellsZ :Integer read GetCellsZ write SetCellsZ;
103
procedure Read( const Stream_:TStream );
104
procedure Write( const Stream_:TStream );
107
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPoiPixIter3D<_TItem_>
109
TGLPoiPixIter3D<_TItem_:record> = class( TGLPixBufIter3D<_TItem_> )
111
_PItem_ = TGLPixBufIter3D<_TItem_>._PItem_;
114
function GetPoins( const X_,Y_,Z_:Integer ) :_TItem_;
115
procedure SetPoins( const X_,Y_,Z_:Integer; const Item_:_TItem_ );
116
function GetPoinsP( const X_,Y_,Z_:Integer ) :_PItem_;
119
property Poins [ const X_,Y_,Z_:Integer ] :_TItem_ read GetPoins write SetPoins; default;
120
property PoinsP[ const X_,Y_,Z_:Integer ] :_PItem_ read GetPoinsP ;
123
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPoiPix3D<_TItem_>
125
IGLPoiPix3D = interface( IGLPixBuf3D )
126
['{97C18089-90B8-4E43-9C6D-59737D6D555E}']
131
//-------------------------------------------------------------------------
133
TGLPoiPix3D<_TItem_:record> = class( TGLPixBuf3D<_TItem_,TGLPoiPixIter3D<_TItem_>>, IGLPoiPix3D )
137
function GetPoinsX :Integer; override;
138
procedure SetPoinsX( const PoinsX_:Integer ); override;
139
function GetPoinsY :Integer; override;
140
procedure SetPoinsY( const PoinsY_:Integer ); override;
141
function GetPoinsZ :Integer; override;
142
procedure SetPoinsZ( const PoinsZ_:Integer ); override;
143
function GetCellsX :Integer; override;
144
procedure SetCellsX( const CellsX_:Integer ); override;
145
function GetCellsY :Integer; override;
146
procedure SetCellsY( const CellsY_:Integer ); override;
147
function GetCellsZ :Integer; override;
148
procedure SetCellsZ( const CellsZ_:Integer ); override;
152
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLCelPixIter3D<_TItem_>
154
TGLCelPixIter3D<_TItem_:record> = class( TGLPixBufIter3D<_TItem_> )
156
_PItem_ = TGLPixBufIter3D<_TItem_>._PItem_;
159
function GetCells( const X_,Y_,Z_:Integer ) :_TItem_;
160
procedure SetCells( const X_,Y_,Z_:Integer; const Item_:_TItem_ );
161
function GetCellsP( const X_,Y_,Z_:Integer ) :_PItem_;
164
property Cells [ const X_,Y_,Z_:Integer ] :_TItem_ read GetCells write SetCells; default;
165
property CellsP[ const X_,Y_,Z_:Integer ] :_PItem_ read GetCellsP ;
168
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLCelPix3D<_TItem_>
170
IGLCelPix3D = interface( IGLPixBuf3D )
171
['{4ED06E66-A90B-4FE4-B8D9-742FAF6025FB}']
176
//-------------------------------------------------------------------------
178
TGLCelPix3D<_TItem_:record> = class( TGLPixBuf3D<_TItem_,TGLCelPixIter3D<_TItem_>>, IGLCelPix3D )
182
function GetPoinsX :Integer; override;
183
procedure SetPoinsX( const PoinsX_:Integer ); override;
184
function GetPoinsY :Integer; override;
185
procedure SetPoinsY( const PoinsY_:Integer ); override;
186
function GetPoinsZ :Integer; override;
187
procedure SetPoinsZ( const PoinsZ_:Integer ); override;
188
function GetCellsX :Integer; override;
189
procedure SetCellsX( const CellsX_:Integer ); override;
190
function GetCellsY :Integer; override;
191
procedure SetCellsY( const CellsY_:Integer ); override;
192
function GetCellsZ :Integer; override;
193
procedure SetCellsZ( const CellsZ_:Integer ); override;
197
//const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】
199
//var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】
201
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】
203
implementation //############################################################### ■
205
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】
207
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】
209
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPixBufIter3D<_TItem_>
211
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
213
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
215
/////////////////////////////////////////////////////////////////////// アクセス
217
function TGLPixBufIter3D<_TItem_>.GetParen :IGLPixBuf3D;
219
Result := _Paren as IGLPixBuf3D;
222
function TGLPixBufIter3D<_TItem_>.GetElemsZ :Integer;
224
Result := Paren.ElemsZ;
227
function TGLPixBufIter3D<_TItem_>.GetItemsZ :Integer;
229
Result := Paren.ItemsZ;
232
function TGLPixBufIter3D<_TItem_>.GetMargsZ :Integer;
234
Result := Paren.MargsZ;
237
function TGLPixBufIter3D<_TItem_>.GetPoinsZ :Integer;
239
Result := Paren.PoinsZ;
242
function TGLPixBufIter3D<_TItem_>.GetCellsZ :Integer;
244
Result := Paren.CellsZ;
247
/////////////////////////////////////////////////////////////////////// メソッド
249
function TGLPixBufIter3D<_TItem_>.ItemsI( const X_,Y_,Z_:Integer ) :Integer;
251
Result := ( ( MargsZ + Z_ ) * ElemsY + ( MargsY + Y_ ) ) * ElemsX + ( MargsX + X_ );
254
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
256
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPixBuf3D<_TItem_,_TIter_>
258
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
260
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
262
/////////////////////////////////////////////////////////////////////// アクセス
264
function TGLPixBuf3D<_TItem_,_TIter_>.GetElemsN :Integer;
266
Result := ElemsZ * ElemsY * ElemsX;
269
function TGLPixBuf3D<_TItem_,_TIter_>.GetPoinsN :Integer;
271
Result := PoinsZ * PoinsY * PoinsX;
274
function TGLPixBuf3D<_TItem_,_TIter_>.GetCellsN :Integer;
276
Result := CellsZ * CellsY * CellsX;
279
function TGLPixBuf3D<_TItem_,_TIter_>.GetElemsZ :Integer;
281
Result := _MargsZ + _ItemsZ + _MargsZ;
284
//------------------------------------------------------------------------------
286
function TGLPixBuf3D<_TItem_,_TIter_>.GetItemsZ :Integer;
291
procedure TGLPixBuf3D<_TItem_,_TIter_>.SetItemsZ( const ItemsZ_:Integer );
293
_ItemsZ := ItemsZ_; MakeBuffer;
296
//------------------------------------------------------------------------------
298
function TGLPixBuf3D<_TItem_,_TIter_>.GetMargsZ :Integer;
303
procedure TGLPixBuf3D<_TItem_,_TIter_>.SetMargsZ( const MargsZ_:Integer );
305
_MargsZ := MargsZ_; MakeBuffer;
308
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
310
constructor TGLPixBuf3D<_TItem_,_TIter_>.Create( const Usage_:GLenum );
318
/////////////////////////////////////////////////////////////////////// メソッド
320
procedure TGLPixBuf3D<_TItem_,_TIter_>.Read( const Stream_:TStream );
326
Read( C, SizeOf( TCardinal3D ) );
327
Read( M, SizeOf( TCardinal3D ) );
341
procedure TGLPixBuf3D<_TItem_,_TIter_>.Write( const Stream_:TStream );
361
Write( C, SizeOf( TCardinal3D ) );
362
Write( M, SizeOf( TCardinal3D ) );
368
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPoiPixIter3D<_TItem_>
370
/////////////////////////////////////////////////////////////////////// アクセス
372
function TGLPoiPixIter3D<_TItem_>.GetPoins( const X_,Y_,Z_:Integer ) :_TItem_;
374
Result := inherited Items[ ItemsI( X_, Y_, Z_ ) ];
377
procedure TGLPoiPixIter3D<_TItem_>.SetPoins( const X_,Y_,Z_:Integer; const Item_:_TItem_ );
379
inherited Items[ ItemsI( X_, Y_, Z_ ) ] := Item_;
382
//------------------------------------------------------------------------------
384
function TGLPoiPixIter3D<_TItem_>.GetPoinsP( const X_,Y_,Z_:Integer ) :_PItem_;
386
Result := inherited ItemsP[ ItemsI( X_, Y_, Z_ ) ];
389
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLPoiPix3D<_TItem_>
391
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
393
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
395
/////////////////////////////////////////////////////////////////////// アクセス
397
function TGLPoiPix3D<_TItem_>.GetPoinsX :Integer;
402
procedure TGLPoiPix3D<_TItem_>.SetPoinsX( const PoinsX_:Integer );
407
function TGLPoiPix3D<_TItem_>.GetPoinsY :Integer;
412
procedure TGLPoiPix3D<_TItem_>.SetPoinsY( const PoinsY_:Integer );
417
function TGLPoiPix3D<_TItem_>.GetPoinsZ :Integer;
422
procedure TGLPoiPix3D<_TItem_>.SetPoinsZ( const PoinsZ_:Integer );
427
//------------------------------------------------------------------------------
429
function TGLPoiPix3D<_TItem_>.GetCellsX :Integer;
431
Result := ItemsX - 1;
434
procedure TGLPoiPix3D<_TItem_>.SetCellsX( const CellsX_:Integer );
436
ItemsX := CellsX_ + 1;
439
function TGLPoiPix3D<_TItem_>.GetCellsY :Integer;
441
Result := ItemsY - 1;
444
procedure TGLPoiPix3D<_TItem_>.SetCellsY( const CellsY_:Integer );
446
ItemsY := CellsY_ + 1;
449
function TGLPoiPix3D<_TItem_>.GetCellsZ :Integer;
451
Result := ItemsZ - 1;
454
procedure TGLPoiPix3D<_TItem_>.SetCellsZ( const CellsZ_:Integer );
456
ItemsZ := CellsZ_ + 1;
459
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
461
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLCelPixIter3D<_TItem_>
463
/////////////////////////////////////////////////////////////////////// アクセス
465
function TGLCelPixIter3D<_TItem_>.GetCells( const X_,Y_,Z_:Integer ) :_TItem_;
467
Result := inherited Items[ ItemsI( X_, Y_, Z_ ) ];
470
procedure TGLCelPixIter3D<_TItem_>.SetCells( const X_,Y_,Z_:Integer; const Item_:_TItem_ );
472
inherited Items[ ItemsI( X_, Y_, Z_ ) ] := Item_;
475
//------------------------------------------------------------------------------
477
function TGLCelPixIter3D<_TItem_>.GetCellsP( const X_,Y_,Z_:Integer ) :_PItem_;
479
Result := inherited ItemsP[ ItemsI( X_, Y_, Z_ ) ];
482
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TGLCelPix3D<_TItem_>
484
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
486
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
488
/////////////////////////////////////////////////////////////////////// アクセス
490
function TGLCelPix3D<_TItem_>.GetPoinsX :Integer;
492
Result := ItemsX + 1;
495
procedure TGLCelPix3D<_TItem_>.SetPoinsX( const PoinsX_:Integer );
497
ItemsX := PoinsX_ - 1;
500
function TGLCelPix3D<_TItem_>.GetPoinsY :Integer;
502
Result := ItemsY + 1;
505
procedure TGLCelPix3D<_TItem_>.SetPoinsY( const PoinsY_:Integer );
507
ItemsY := PoinsY_ - 1;
510
function TGLCelPix3D<_TItem_>.GetPoinsZ :Integer;
512
Result := ItemsZ + 1;
515
procedure TGLCelPix3D<_TItem_>.SetPoinsZ( const PoinsZ_:Integer );
517
ItemsZ := PoinsZ_ - 1;
520
//------------------------------------------------------------------------------
522
function TGLCelPix3D<_TItem_>.GetCellsX :Integer;
527
procedure TGLCelPix3D<_TItem_>.SetCellsX( const CellsX_:Integer );
532
function TGLCelPix3D<_TItem_>.GetCellsY :Integer;
537
procedure TGLCelPix3D<_TItem_>.SetCellsY( const CellsY_:Integer );
542
function TGLCelPix3D<_TItem_>.GetCellsZ :Integer;
547
procedure TGLCelPix3D<_TItem_>.SetCellsZ( const CellsZ_:Integer );
552
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
554
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】
556
//############################################################################## □
558
initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化
560
finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化
562
end. //######################################################################### ■