b311480e |
1 | -- Created on: 1993-01-09 |
2 | -- Created by: CKY / Contract Toubro-Larsen ( Arun MENON ) |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
7fd59977 |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
7fd59977 |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class AttributeTable from IGESDefs inherits IGESEntity |
18 | |
19 | ---Purpose: defines IGES Attribute Table, Type <422> Form <0, 1> |
20 | -- in package IGESDefs |
21 | -- This class is used to represent an occurence of |
22 | -- Attribute Table. This Class may be independent |
23 | -- or dependent or pointed at by other Entities. |
24 | |
25 | uses |
26 | |
27 | HAsciiString from TCollection, |
28 | AttributeDef from IGESDefs, |
29 | HArray1OfReal from TColStd, |
30 | HArray2OfTransient from TColStd, |
31 | HArray1OfInteger from TColStd, |
32 | HArray1OfHAsciiString from Interface, |
33 | HArray1OfIGESEntity from IGESData |
34 | |
35 | raises OutOfRange, NullObject |
36 | |
37 | is |
38 | |
6e33d3ce |
39 | Create returns AttributeTable; |
7fd59977 |
40 | |
41 | -- Specific methods for the entity |
42 | |
43 | Init (me : mutable; |
44 | attributes : HArray2OfTransient from TColStd); |
45 | ---Purpose : This method is used to set the fields of the class |
46 | -- AttributeTable |
47 | -- - attributes : Attribute instances, created as |
48 | -- (1,NbAttributes,1,NbRows) |
49 | -- - NbRows = 1 is a particular case (Form 0) |
50 | |
51 | SetDefinition (me : mutable; def : AttributeDef); |
52 | ---Purpose : Sets a Definition as Structure information |
53 | -- (works by calling InitMisc) |
54 | |
55 | Definition (me) returns AttributeDef; |
56 | ---Purpose : Return the Structure information in Directory Entry, |
57 | -- casted as an AttributeDef |
58 | |
59 | NbRows(me) returns Integer; |
60 | ---Purpose : returns Number of Rows. Remark that it is always 1 if Form = 0 |
61 | -- It means that the list of Attributes (by their number, and for each |
62 | -- one its type and ValueCount) is repeated <NbRows> times |
63 | |
64 | NbAttributes (me) returns Integer; |
65 | ---Purpose : returns Number of Attributes |
66 | |
67 | DataType (me; Atnum : Integer) returns Integer; |
68 | ---Purpose : returns the Type of an Attribute, given its No. : it is read in the |
69 | -- Definition. |
70 | -- (1 : Integer, 2 : Real, 3 : String, 4 : Entity, 6 : Logical) |
71 | |
72 | ValueCount (me; Atnum : Integer) returns Integer; |
73 | ---Purpose : returns the Count of Value for an Attribute, given its No. : |
74 | -- it is read in the Definition. |
75 | |
76 | AttributeList (me; Attribnum : Integer; Rownum : Integer) |
77 | returns Transient |
78 | -- returns the List of Values which correspond to an Attribute, |
79 | -- given its No. and the No. of the Row |
80 | -- Remark : for Form 0, Rownum must be given equal to 1. |
81 | -- the Transient returned is a HArray1 of appropriate Type |
82 | -- (OfInteger, OfReal, OfHAsciiString, OfIGESEntity) and Length |
83 | -- See methods AttributeAs... for accurate access |
84 | raises OutOfRange; |
85 | -- Error if Attribnum or RowNum OutofRange |
86 | |
87 | |
88 | AttributeAsInteger (me; AtNum, Rownum, ValNum : Integer) returns Integer |
89 | ---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer |
90 | raises OutOfRange, NullObject; |
91 | ---Purpose : Error if Indices out of Range, or no Value defined, or not an Integer |
92 | |
93 | AttributeAsReal (me; AtNum, Rownum, ValNum : Integer) returns Real |
94 | ---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Real |
95 | raises OutOfRange, NullObject; |
96 | ---Purpose : Error if Indices out of Range, or no Value defined, or not a Real |
97 | |
98 | AttributeAsString (me; AtNum, Rownum, ValNum : Integer) |
99 | returns HAsciiString from TCollection |
100 | ---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer |
101 | raises OutOfRange, NullObject; |
102 | -- Error if Indices out of Range, or no Value defined, or not a String |
103 | |
104 | AttributeAsEntity (me; AtNum, Rownum, ValNum : Integer) returns IGESEntity |
105 | ---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Entity |
106 | raises OutOfRange, NullObject; |
107 | ---Purpose : Error if Indices out of Range, or no Value defined, or not an Entity |
108 | |
109 | AttributeAsLogical (me; AtNum, Rownum, ValNum : Integer) returns Boolean |
110 | ---Purpose : Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Boolean |
111 | raises OutOfRange, NullObject; |
112 | ---Purpose : Error if Indices out of Range, or no Value defined, or not a Logical |
113 | |
114 | fields |
115 | |
116 | -- |
117 | -- Class : IGESDefs_AttributeTable |
118 | -- |
119 | -- Purpose : Declaration of variables specific to the definition |
120 | -- of the Class AttributeTable. |
121 | -- |
122 | -- Reminder : The attributes can be of type no value, integer, real, string, |
123 | -- pointer or Boolean. Accordingly each list is stored as HArray1 of |
124 | -- Integer, Real, HAsciiString, IGESEntity of appropriate Length |
125 | -- |
126 | |
127 | theAttributes : HArray2OfTransient from TColStd; |
128 | |
129 | -- if form number = 0 , only one Row |
130 | -- size = AVC(1) + AVC(2) + ... + AVC(NA) |
131 | -- where NA is Number of attributes obtained from AttributeDef |
132 | -- AVC(1), AVC(2),..., AVC(NA) is also obtained from the same |
133 | -- |
134 | -- if form number = 1 , NbRows > 1 possible |
135 | -- size = NR * (AVC(1) + AVC(2) + ... + AVC(NA)) |
136 | -- where NR is theNbRows |
137 | -- |
138 | -- Ref : IGES specs for Attribute Table Definition Entity (Type 322) |
139 | |
140 | end AttributeTable; |