1 -- Created on: 1992-12-17
2 -- Created by: Mireille MERCIEN
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
22 generic class HArray2 from TCollection
24 TheArray2 as Array2 from TCollection(ItemHArray2))
28 ---Purpose: The class HArray2 represents bi-dimensionnal arrays
29 -- of fixed size dynamically dimensioned at construction time.
30 -- As with a C array, the access time to an HArray2 indexed
31 -- item is constant and is independent of the array size.
32 -- Arrays are commonly used as elementary data structures for more complex objects.
33 -- HArray2 objects are handles to arrays.
34 -- - HArray2 arrays may be shared by several objects.
35 -- - You may use a TCollection_Array2 structure to get the actual array.
36 -- HArray2 is a generic class which depends on two parameters:
37 -- - Item, the type of element in the array,
38 -- - Array, the actual type of array handled by HArray2.
39 -- This is an instantiation with Item of the TCollection_Array2 generic class.
41 -- HArray2 indexes start and end at a user-defined position.
42 -- Thus, when accessing an item you must base the indexes
43 -- on the lower and upper bounds of the array.
46 RangeError from Standard,
47 OutOfRange from Standard,
48 OutOfMemory from Standard,
49 DimensionMismatch from Standard
53 Create (R1, R2, C1, C2: Integer from Standard)
54 returns mutable HArray2 from TCollection
55 ---Purpose: Creates an array of lower bound <R1><C1> and upper
56 -- bound <R2><C2>. Range from Standard error is
57 -- raised when <R2> is less than <R1> or <C2> is less than <C1>.
59 RangeError from Standard,
60 OutOfMemory from Standard;
63 Create (R1, R2, C1, C2: Integer from Standard; V : ItemHArray2)
64 returns mutable HArray2 from TCollection
65 ---Purpose: Creates an array of lower bound <R1><C1> and upper
66 -- bound <R2><C2>. Range from Standard error is
67 -- raised when <R2> is less than <R1> or <C2> is less than <C1>.
69 RangeError from Standard,
70 OutOfMemory from Standard;
71 Init(me : mutable; V : ItemHArray2) ;
72 ---Purpose: Initializes the array with the value <V>
74 ColLength (me) returns Integer from Standard
75 ---Purpose: Returns the number of rows of <me>.
79 RowLength (me) returns Integer from Standard
80 ---Purpose: Returns the number of columns of <me>.
84 LowerCol (me) returns Integer from Standard
85 ---Purpose: Returns the lower column number of the array.
89 LowerRow (me) returns Integer from Standard
90 ---Purpose: Returns the lower row number of the array.
94 UpperCol (me) returns Integer from Standard
95 ---Purpose: Returns the upper column number of the array.
99 UpperRow (me) returns Integer from Standard
100 ---Purpose: Returns the upper row number of the array.
104 SetValue (me : mutable; Row, Col: Integer from Standard;
106 ---Purpose: Assigns the value Value to the (Row,Col) item of this array.
108 raises OutOfRange from Standard
111 Value (me; Row,Col: Integer from Standard) returns any ItemHArray2
113 ---Purpose: Returns the value of the element of index <Row><Col>
114 ---C++: return const &
115 raises OutOfRange from Standard
118 ChangeValue (me : mutable; Row,Col: Integer from Standard)
119 returns any ItemHArray2
121 ---Purpose: Returns the value of the element of index <Row><Col>
123 raises OutOfRange from Standard
126 Array2(me) returns TheArray2
127 ---Purpose: Returns the Array array used as a field by this array;
128 -- the returned array is not modifiable.
129 ---C++: return const &
133 ChangeArray2(me : mutable) returns TheArray2
134 ---Purpose: - Returns a modifiable reference on the Array array
135 -- used as a field by this array, in order to modify it.