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;
64 Create (R1, R2, C1, C2: Integer from Standard; V : ItemHArray2)
65 returns mutable HArray2 from TCollection
66 ---Purpose: Creates an array of lower bound <R1><C1> and upper
67 -- bound <R2><C2>. Range from Standard error is
68 -- raised when <R2> is less than <R1> or <C2> is less than <C1>.
70 RangeError from Standard,
71 OutOfMemory from Standard;
73 Init(me : mutable; V : ItemHArray2) ;
74 ---Purpose: Initializes the array with the value <V>
77 ColLength (me) returns Integer from Standard
78 ---Purpose: Returns the number of rows of <me>.
82 RowLength (me) returns Integer from Standard
83 ---Purpose: Returns the number of columns of <me>.
87 LowerCol (me) returns Integer from Standard
88 ---Purpose: Returns the lower column number of the array.
92 LowerRow (me) returns Integer from Standard
93 ---Purpose: Returns the lower row number of the array.
97 UpperCol (me) returns Integer from Standard
98 ---Purpose: Returns the upper column number of the array.
102 UpperRow (me) returns Integer from Standard
103 ---Purpose: Returns the upper row number of the array.
107 SetValue (me : mutable; Row, Col: Integer from Standard;
110 ---Purpose: Assigns the value Value to the (Row,Col) item of this array.
112 raises OutOfRange from Standard
115 Value (me; Row,Col: Integer from Standard) returns any ItemHArray2
117 ---Purpose: Returns the value of the element of index <Row><Col>
118 ---C++: return const &
120 raises OutOfRange from Standard
123 ChangeValue (me : mutable; Row,Col: Integer from Standard)
124 returns any ItemHArray2
126 ---Purpose: Returns the value of the element of index <Row><Col>
129 raises OutOfRange from Standard
132 Array2(me) returns TheArray2
133 ---Purpose: Returns the Array array used as a field by this array;
134 -- the returned array is not modifiable.
135 ---C++: return const &
139 ChangeArray2(me : mutable) returns TheArray2
140 ---Purpose: - Returns a modifiable reference on the Array array
141 -- used as a field by this array, in order to modify it.