1 -- File: TDataStd_Name.cdl
2 -- Created: Thu Jul 31 10:29:12 1997
3 -- Author: Denis PASCAL
4 ---Copyright: Matra Datavision 1997
8 class Name from TDataStd inherits Attribute from TDF
10 ---Purpose: Used to define a name attribute containing a string which specifies the name.
12 uses Attribute from TDF,
15 ExtendedString from TCollection,
16 ListOfExtendedString from TDataStd,
18 RelocationTable from TDF,
19 AttributeSequence from TDF,
20 AttributeList from TDF,
22 AttributeDelta from TDF
27 DomainError from Standard
33 ---Purpose: class methods working on the name itself
34 -- ========================================
38 ---C++: return const &
39 ---Purpose: Returns the GUID for name attributes.
40 returns GUID from Standard;
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;
50 ---Warning: ======================================================
51 -- As already announced next methods will be moved soon in 2 tools
53 -- * one to search label from name following the framework
56 -- * one to search label from name following the treenode hierachy.
57 -- ===============================================================
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
63 --returns Boolean from Standard;
66 ---Purpose: class methods working on the name tree
67 -- ======================================
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.
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.
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.
91 ---Purpose: tools methods to translate path <-> pathlist
92 -- ===========================================
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".
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;
110 ---Purpose: Name methods
114 returns mutable Name from TDataStd;
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
121 --returns Boolean from Standard;
123 --FullPath (me; path : in out AttributeList from TDF)
124 --returns Boolean from Standard;
126 --ChildNames (me; list : in out AttributeList from TDF)
127 -- Purpose: puts in list the childs names of me. returns TRUE if
129 --returns Boolean from Standard;
131 --Find (me; relativePath : ListOfExtendedString from TDataStd;
132 -- name : in out Name from TDataStd)
133 --returns Boolean from Standard;
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.
140 returns ExtendedString from TCollection;
142 -- Returns the name contained in this name attribute.
143 ---C++: return const &
145 --SetEmpty(me: mutable);
146 ---Purpose: Set myEmpty field
148 --IsEmpty(me) returns Boolean from Standard;
150 ---Category: TDF_Attribute methods
151 -- =====================
154 ---C++: return const &
155 returns GUID from Standard;
157 Restore (me: mutable; with : Attribute from TDF);
160 returns mutable Attribute from TDF;
162 Paste (me; into : mutable Attribute from TDF;
163 RT : mutable RelocationTable from TDF);
165 Dump(me; anOS : in out OStream from Standard)
166 returns OStream from Standard
172 myString : ExtendedString from TCollection; --To store name
173 myEmpty : Boolean from Standard; --Is set to True if name isn't set