1 -- Created on: 2004-01-09
2 -- Created by: Sergey KUUL
3 -- Copyright (c) 2004-2012 OPEN CASCADE SAS
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.
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.
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.
21 class DimTolTool from XCAFDoc inherits Attribute from TDF
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
31 LabelSequence from TDF,
32 Document from TDocStd,
33 ShapeTool from XCAFDoc,
34 RelocationTable from TDF,
35 HArray1OfReal from TColStd,
36 HAsciiString from TCollection
39 Create returns DimTolTool from XCAFDoc;
41 Set (myclass; L : Label from TDF) returns DimTolTool from XCAFDoc;
42 ---Purpose: Creates (if not exist) DimTolTool.
45 ---C++: return const &
46 returns GUID from Standard;
50 ---API: General structure
52 BaseLabel(me) returns Label from TDF;
53 ---Purpose: returns the label under which colors are stored
55 ShapeTool (me: mutable) returns ShapeTool from XCAFDoc;
56 ---Purpose: Returns internal XCAFDoc_ShapeTool tool
57 ---C++: return const &
60 -- Methods for DimTol:
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
66 GetDimTolLabels (me; Labels: out LabelSequence from TDF);
67 ---Purpose: Returns a sequence of D>s currently stored
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)
75 ---Purpose: Finds a dimtol definition in a DGTtable and returns
77 -- Returns False if dimtol is not found in DGTtable
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)
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
93 SetDimTol (me; L: Label from TDF;
94 DimTolL: Label from TDF);
95 ---Purpose: Sets a link with GUID
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
105 GetRefShapeLabel (me; DimTolL: Label from TDF; ShapeL: out Label from TDF)
107 ---Purpose: Returns ShapeL defined for label DimTolL
108 -- Returns False if the DimTolL is not in DGTtable
110 GetRefDGTLabels (me; ShapeL: Label from TDF; DimTols: out LabelSequence from TDF)
112 ---Purpose: Returns all DimTol labels defined for label ShapeL
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
122 -- Methods for Datum:
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
128 GetDatumLabels (me; Labels: out LabelSequence from TDF);
129 ---Purpose: Returns a sequence of Datumss currently stored
132 FindDatum (me; aName : HAsciiString from TCollection;
133 aDescription : HAsciiString from TCollection;
134 anIdentification : HAsciiString from TCollection;
135 lab: out Label from TDF)
137 ---Purpose: Finds a datum and returns its label if found
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
145 SetDatum (me; L: Label from TDF;
146 DatumL: Label from TDF);
147 ---Purpose: Sets a link with GUID
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
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
164 GetDatumTolerLabels (me; DimTolL: Label from TDF; Datums: out LabelSequence from TDF)
166 ---Purpose: Returns all Datum labels defined for label DimTolL
170 ---C++: return const &
171 returns GUID from Standard;
173 Restore (me: mutable; with : Attribute from TDF);
176 returns mutable Attribute from TDF;
178 Paste (me; into : mutable Attribute from TDF;
179 RT : mutable RelocationTable from TDF);
183 myShapeTool: ShapeTool from XCAFDoc;