1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
-- File: TDataStd_Name.cdl
-- Created: Thu Jul 31 10:29:12 1997
-- Author: Denis PASCAL
---Copyright: Matra Datavision 1997
class Name from TDataStd inherits Attribute from TDF
---Purpose: Used to define a name attribute containing a string which specifies the name.
uses Attribute from TDF,
Label from TDF,
GUID from Standard,
ExtendedString from TCollection,
ListOfExtendedString from TDataStd,
DataSet from TDF,
RelocationTable from TDF,
AttributeSequence from TDF,
AttributeList from TDF,
Data from TDF,
AttributeDelta from TDF
raises
DomainError from Standard
is
---Purpose: class methods working on the name itself
-- ========================================
GetID (myclass)
---C++: return const &
---Purpose: Returns the GUID for name attributes.
returns GUID from Standard;
Set (myclass; label: Label from TDF; string : ExtendedString from TCollection)
---Purpose: Creates (if does not exist) and sets the name in the name attribute.
-- myEmpty becomes False
returns Name from TDataStd;
---Warning: ======================================================
-- As already announced next methods will be moved soon in 2 tools
--
-- * one to search label from name following the framework
-- label hierarchy.
--
-- * one to search label from name following the treenode hierachy.
-- ===============================================================
--Find (myclass; L : Label from TDF; father : in out Name from TDataStd)
---Purpose: from any label <L> search in father labels (L is not
-- concerned) the first name attribute.if found set it in
-- <father>.
--returns Boolean from Standard;
---Purpose: class methods working on the name tree
-- ======================================
--Find (myclass; framework : Data from TDF;
-- fullPath : ListOfExtendedString from TDataStd;
-- name : in out Name from TDataStd)
--returns Boolean from Standard;
---Purpose: Search in the whole TDF_Data the Name attribute which
-- fit with <fullPath>. Returns True if found.
--Find (myclass; current : Label from TDF;
-- string : ExtendedString from TCollection;
-- name : in out Name from TDataStd)
--returns Boolean from Standard;
---Purpose: Search under <currentLabel> a label which fit with
-- <name>. Returns True if found. Shortcut which avoids
-- building a ListOfExtendedStrin.
--Find (myclass; framework : Data from TDF;
-- string : ExtendedString from TCollection;
-- name : in out Name from TDataStd)
--returns Boolean from Standard;
---Purpose: Search in the whole TDF_Data the label which fit with name
-- Returns True if found.
---Purpose: tools methods to translate path <-> pathlist
-- ===========================================
--MakePath (myclass; path : ExtendedString from TCollection;
-- pathlist : in out ListOfExtendedString from TDataStd;
-- Separator: ExtCharacter from Standard = ':')
--returns Boolean from Standard;
---Purpose: move to draw For Draw test we may provide this tool method which convert a path in a
-- sequence of string to call after the FindLabel methods.
-- Example: if it's given "Assembly:Part_1:Sketch_5" it will return in <pathlist>
-- the list of 3 strings: "Assembly","Part_1","Sketch_5".
--MakePath (myclass; pathlist : AttributeList from TDF;
-- path : in out ExtendedString from TCollection;
-- Separator: ExtCharacter from Standard = ':')
---Purpose: move to draw from <pathlist> build the string path
--returns Boolean from Standard;
---Purpose: Name methods
-- ============
Create
returns mutable Name from TDataStd;
--Father (me; father : in out Name from TDataStd)
-- Purpose: Returns the Father Name. The search is done in <me>
-- fathers labels. If noone father is found returns
-- False.
--returns Boolean from Standard;
--FullPath (me; path : in out AttributeList from TDF)
--returns Boolean from Standard;
--ChildNames (me; list : in out AttributeList from TDF)
-- Purpose: puts in list the childs names of me. returns TRUE if
-- found
--returns Boolean from Standard;
--Find (me; relativePath : ListOfExtendedString from TDataStd;
-- name : in out Name from TDataStd)
--returns Boolean from Standard;
Set (me : mutable; S : ExtendedString from TCollection)
raises DomainError from Standard;
---Purpose: Sets <S> as name. Raises if <S> is not a valid name.
Get (me)
returns ExtendedString from TCollection;
---Purpose:
-- Returns the name contained in this name attribute.
---C++: return const &
--SetEmpty(me: mutable);
---Purpose: Set myEmpty field
--IsEmpty(me) returns Boolean from Standard;
---Category: TDF_Attribute methods
-- =====================
ID (me)
---C++: return const &
returns GUID from Standard;
Restore (me: mutable; with : Attribute from TDF);
NewEmpty (me)
returns mutable Attribute from TDF;
Paste (me; into : mutable Attribute from TDF;
RT : mutable RelocationTable from TDF);
Dump(me; anOS : in out OStream from Standard)
returns OStream from Standard
is redefined;
---C++: return &
fields
myString : ExtendedString from TCollection; --To store name
myEmpty : Boolean from Standard; --Is set to True if name isn't set
end Name;
|