b311480e |
1 | -- Created on: 1993-01-13 |
2 | -- Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU ) |
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 AttributeDef from IGESDefs inherits IGESEntity |
18 | |
19 | ---Purpose: defines IGES Attribute Table Definition Entity, |
20 | -- Type <322> Form [0, 1, 2] in package IGESDefs. |
21 | -- This is class is used to support the concept of well |
22 | -- defined collection of attributes, whether it is a table |
23 | -- or a single row of attributes. |
24 | |
25 | uses |
26 | |
27 | HAsciiString from TCollection, |
28 | HArray1OfInteger from TColStd, |
29 | HArray1OfTransient from TColStd, |
30 | HArray1OfReal from TColStd, |
31 | HArray1OfHAsciiString from Interface, |
32 | HArray1OfIGESEntity from IGESData, |
33 | TextDisplayTemplate from IGESGraph, |
34 | HArray1OfTextDisplayTemplate from IGESGraph, |
35 | HArray1OfHArray1OfTextDisplayTemplate from IGESDefs |
36 | |
37 | raises DimensionMismatch, OutOfRange, NullObject |
38 | |
39 | is |
40 | |
6e33d3ce |
41 | Create returns AttributeDef; |
7fd59977 |
42 | |
43 | -- Specific methods for the entity |
44 | |
45 | Init(me : mutable; |
46 | aName : HAsciiString; |
47 | aListType : Integer; |
48 | attrTypes : HArray1OfInteger; |
49 | attrValueDataTypes : HArray1OfInteger; |
50 | attrValueCounts : HArray1OfInteger; |
51 | attrValues : HArray1OfTransient from TColStd; |
52 | attrValuePointers : HArray1OfHArray1OfTextDisplayTemplate) |
53 | raises DimensionMismatch; |
54 | -- This method is used to set the fields of the |
55 | -- class AttributeDef |
56 | -- - aName : Attribute Table Names |
57 | -- - aListType : Attribute List Types |
58 | -- - attrTypes : Attribute Types |
59 | -- - attrValueDataTypes : Attribute Value Data Types |
60 | -- - attrValueCounts : Attribute Value Counts |
61 | -- - attrValues : Attribute Values |
62 | -- - attrValuePointers : Attribute Value Pointers to |
63 | -- TextDisplayTemplate |
64 | -- raises exceptions if lengths of attrTypes, attrValueDataTypes, |
65 | -- and attrValueCounts are not same |
66 | |
67 | HasTableName (me) returns Boolean; |
68 | ---Purpose : Returns True if a Table Name is defined |
69 | |
70 | TableName(me) returns HAsciiString from TCollection; |
71 | ---Purpose : returns the Attribute Table name, or comment |
72 | -- (default = null, no name : seeHasTableName) |
73 | |
74 | ListType(me) returns Integer; |
75 | ---Purpose : returns the Attribute List Type |
76 | |
77 | NbAttributes(me) returns Integer; |
78 | ---Purpose : returns the Number of Attributes |
79 | |
80 | AttributeType(me ; num : Integer) returns Integer |
81 | raises OutOfRange; |
82 | ---Purpose : returns the num'th Attribute Type |
83 | -- raises exception if num <= 0 or num > NbAttributes() |
84 | |
85 | AttributeValueDataType(me ; num : Integer) returns Integer |
86 | raises OutOfRange; |
87 | ---Purpose : returns the num'th Attribute value data type |
88 | -- raises exception if num <= 0 or num > NbAttributes() |
89 | |
90 | AttributeValueCount(me; num : Integer) returns Integer |
91 | raises OutOfRange; |
92 | ---Purpose : returns the num'th Attribute value count |
93 | -- raises exception if num <= 0 or num > NbAttributes() |
94 | |
95 | HasValues(me) returns Boolean; |
96 | ---Purpose : returns false if Values are defined (i.e. for Form = 1 or 2) |
97 | |
98 | HasTextDisplay(me) returns Boolean; |
99 | ---Purpose : returns false if TextDisplays are defined (i.e. for Form = 2) |
100 | |
101 | AttributeTextDisplay(me ; AttrNum : Integer; PointerNum : Integer) |
102 | returns TextDisplayTemplate |
103 | raises OutOfRange; |
104 | -- returns Null handle if form is 0 or 1 |
105 | -- returns PointerNum'th TextDisplayTemplate of AttrNum'th attribute |
106 | -- raises exception if |
107 | -- AttrNum <= 0 or num > NbAttributes() |
108 | -- PointerNum <=0 or PointerNum > AttributeValueCount(AttrNum) |
109 | |
110 | |
111 | AttributeList (me ; AttrNum : Integer) returns Transient |
112 | ---Purpose : Returns the List of Attributes <AttrNum>, as a Transient. |
113 | ---Purpose : Its effective Type depends of the Type of Attribute : |
114 | -- HArray1OfInteger for Integer, Logical(0-1), |
115 | -- HArray1OfReal for Real, HArray1OfHSaciiString for String, |
116 | -- HArray1OfIGESEntity for Entity (Pointer) |
117 | -- See methods AttributeAs... for an accurate access |
118 | raises OutOfRange; |
119 | -- Error if AttrNum <= 0 or num > NbAttributes() |
120 | -- PointerNum <=0 or PointerNum > AttributeValueCount(AttrNum) |
121 | |
122 | AttributeAsInteger (me; AttrNum, ValueNum : Integer) returns Integer |
123 | ---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Integer |
124 | raises OutOfRange, NullObject; |
125 | ---Purpose : Error if Indices out of Range, or no Value defined, or not an Integer |
126 | |
127 | AttributeAsReal (me; AttrNum, ValueNum : Integer) returns Real |
128 | ---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as a Real |
129 | raises OutOfRange, NullObject; |
130 | ---Purpose : Error if Indices out of Range, or no Value defined, or not a Real |
131 | |
132 | AttributeAsString (me; AttrNum, ValueNum : Integer) |
133 | returns HAsciiString from TCollection |
134 | ---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Integer |
135 | raises OutOfRange, NullObject; |
136 | -- Error if Indices out of Range, or no Value defined, or not a String |
137 | |
138 | AttributeAsEntity (me; AttrNum, ValueNum : Integer) returns IGESEntity |
139 | ---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as an Entity |
140 | raises OutOfRange, NullObject; |
141 | ---Purpose : Error if Indices out of Range, or no Value defined, or not a Entity |
142 | |
143 | AttributeAsLogical (me; AttrNum, ValueNum : Integer) returns Boolean |
144 | ---Purpose : Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean |
145 | raises OutOfRange, NullObject; |
146 | ---Purpose : Error if Indices out of Range, or no Value defined, or not a Logical |
147 | |
148 | fields |
149 | |
150 | -- |
151 | -- Class : IGESDefs_AttributeDef |
152 | -- |
153 | -- Purpose : Declaration of variables specific to AttributeDef. |
154 | -- |
155 | -- Reminder : An AttributeDef Entity provides a template for the |
156 | -- instance of attribute tables. It includes a table |
157 | -- name and for each attribute, an attribute type, |
158 | -- data type, and a count. |
159 | |
160 | theName : HAsciiString; |
161 | theListType : Integer; |
162 | theAttrTypes : HArray1OfInteger; |
163 | theAttrValueDataTypes : HArray1OfInteger; |
164 | theAttrValueCounts : HArray1OfInteger; |
165 | theAttrValues : HArray1OfTransient from TColStd; |
166 | theAttrValuePointers : HArray1OfHArray1OfTextDisplayTemplate; |
167 | |
168 | end AttributeDef; |