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