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