0023047: Behaviour of XDE sample is non-stable
[occt.git] / src / XCAFDoc / XCAFDoc_DimTolTool.cdl
1 -- Created on: 2004-01-09
2 -- Created by: Sergey KUUL
3 -- Copyright (c) 2004-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21 class DimTolTool from XCAFDoc inherits Attribute from TDF
22
23         ---Purpose: Provides tools to store and retrieve attributes (colors)
24         --          of TopoDS_Shape in and from TDocStd_Document
25         --          A Document is intended to hold different 
26         --          attributes of ONE shape and it's sub-shapes
27
28 uses
29     Shape from TopoDS,
30     Label from TDF,
31     LabelSequence from TDF,
32     Document from TDocStd,
33     ShapeTool from XCAFDoc,
34     RelocationTable from TDF,
35     HArray1OfReal from TColStd,
36     HAsciiString from TCollection
37
38 is
39     Create returns DimTolTool from XCAFDoc;
40
41     Set (myclass; L : Label from TDF) returns DimTolTool from XCAFDoc;
42         ---Purpose: Creates (if not exist) DimTolTool.
43     
44     GetID (myclass)   
45     ---C++: return const &  
46     returns GUID from Standard;
47
48     
49     
50     ---API: General structure
51     
52     BaseLabel(me) returns Label from TDF;
53         ---Purpose: returns the label under which colors are stored
54     
55     ShapeTool (me: mutable) returns ShapeTool from XCAFDoc;
56         ---Purpose: Returns internal XCAFDoc_ShapeTool tool
57         ---C++: return const &
58
59
60     -- Methods for DimTol:
61
62     IsDimTol (me; lab: Label from TDF) returns Boolean;
63         ---Purpose: Returns True if label belongs to a dimtoltable and
64         --          is a DimTol definition 
65     
66     GetDimTolLabels (me; Labels: out LabelSequence from TDF);
67         ---Purpose: Returns a sequence of D&GTs currently stored 
68         --          in the DGTtable
69     
70     FindDimTol (me; kind : Integer from Standard; aVal : HArray1OfReal from TColStd;
71                     aName : HAsciiString from TCollection;
72                     aDescription : HAsciiString from TCollection;
73                     lab: out Label from TDF)
74     returns Boolean;
75         ---Purpose: Finds a dimtol definition in a DGTtable and returns
76         --          its label if found
77         --          Returns False if dimtol is not found in DGTtable 
78     
79     FindDimTol (me; kind : Integer from Standard; aVal : HArray1OfReal from TColStd;
80                     aName : HAsciiString from TCollection;
81                     aDescription : HAsciiString from TCollection)
82     returns Label from TDF;
83         ---Purpose: Finds a dimtol definition in a DGTtable and returns
84         --          its label if found (or Null label else)
85     
86     AddDimTol (me; kind : Integer from Standard;
87                    aVal : HArray1OfReal from TColStd;
88                    aName : HAsciiString from TCollection;
89                    aDescription : HAsciiString from TCollection)
90     returns Label from TDF;
91         ---Purpose: Adds a dimtol definition to a DGTtable and returns its label
92
93     SetDimTol (me; L: Label from TDF;
94                    DimTolL: Label from TDF);
95         ---Purpose: Sets a link with GUID
96     
97     SetDimTol (me; L: Label from TDF; kind : Integer from Standard;
98                    aVal : HArray1OfReal from TColStd;
99                    aName : HAsciiString from TCollection;
100                    aDescription : HAsciiString from TCollection)
101     returns Label from TDF;
102         ---Purpose: Sets a link with GUID
103         --          Adds a DimTol as necessary
104     
105     GetRefShapeLabel (me; DimTolL: Label from TDF; ShapeL: out Label from TDF) 
106     returns Boolean;
107         ---Purpose: Returns ShapeL defined for label DimTolL
108         --          Returns False if the DimTolL is not in DGTtable
109
110     GetRefDGTLabels (me; ShapeL: Label from TDF; DimTols: out LabelSequence from TDF) 
111     returns Boolean;
112         ---Purpose: Returns all DimTol labels defined for label ShapeL
113
114     GetDimTol (me; DimTolL: Label from TDF; kind : out Integer from Standard;
115                    aVal : out HArray1OfReal from TColStd;
116                    aName : out HAsciiString from TCollection;
117                    aDescription : out HAsciiString from TCollection) returns Boolean;
118         ---Purpose: Returns dimtol assigned to <DimTolL>
119         --          Returns False if no such dimtol is assigned
120     
121
122     -- Methods for Datum:
123
124     IsDatum (me; lab: Label from TDF) returns Boolean;
125         ---Purpose: Returns True if label belongs to a dimtoltable and
126         --          is a Datum definition 
127     
128     GetDatumLabels (me; Labels: out LabelSequence from TDF);
129         ---Purpose: Returns a sequence of Datumss currently stored 
130         --          in the DGTtable
131     
132     FindDatum (me; aName : HAsciiString from TCollection;
133                    aDescription : HAsciiString from TCollection;
134                    anIdentification : HAsciiString from TCollection;
135                    lab: out Label from TDF)
136     returns Boolean;
137         ---Purpose: Finds a datum and returns its label if found
138     
139     AddDatum (me; aName : HAsciiString from TCollection;
140                   aDescription : HAsciiString from TCollection;
141                   anIdentification : HAsciiString from TCollection)
142     returns Label from TDF;
143         ---Purpose: Adds a datum definition to a DGTtable and returns its label
144
145     SetDatum (me; L: Label from TDF;
146                   DatumL: Label from TDF);
147         ---Purpose: Sets a link with GUID
148     
149     SetDatum (me; L: Label from TDF; TolerL: Label from TDF;
150                   aName : HAsciiString from TCollection;
151                   aDescription : HAsciiString from TCollection;
152                   anIdentification : HAsciiString from TCollection);
153         ---Purpose: Sets a link with GUID for Datum
154         --          Adds a Datum as necessary
155         --          Sets connection between Datum and Tolerance
156     
157     GetDatum (me; DatumL: Label from TDF;
158                   aName : out HAsciiString from TCollection;
159                   aDescription : out HAsciiString from TCollection;
160                   anIdentification : out HAsciiString from TCollection) returns Boolean;
161         ---Purpose: Returns datum assigned to <DatumL>
162         --          Returns False if no such datum is assigned
163     
164     GetDatumTolerLabels (me; DimTolL: Label from TDF; Datums: out LabelSequence from TDF) 
165     returns Boolean;
166         ---Purpose: Returns all Datum labels defined for label DimTolL
167
168
169     ID (me)
170         ---C++: return const & 
171     returns GUID from Standard;
172
173     Restore (me: mutable; with : Attribute from TDF);
174
175     NewEmpty (me)
176     returns mutable Attribute from TDF;
177
178     Paste (me; into : mutable Attribute from TDF;
179                RT   : mutable RelocationTable from TDF);    
180
181 fields
182
183     myShapeTool: ShapeTool from XCAFDoc;
184     
185 end DimTolTool;