1 -- Created on: 1993-07-01
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class ShapeSet from TopTools
19 ---Purpose: A ShapeSets contains a Shape and all its
20 -- sub-shapes and locations. It can be dump, write
23 -- Methods to handle the geometry can be redefined.
29 IndexedMapOfShape from TopTools,
30 LocationSet from TopTools,
31 ShapeEnum from TopAbs,
32 AsciiString from TCollection,
33 ProgressIndicator from Message
37 Create returns ShapeSet from TopTools;
38 ---Purpose: Builds an empty ShapeSet.
40 Delete(me:out) is virtual;
41 ---C++: alias "Standard_EXPORT virtual ~TopTools_ShapeSet(){Delete() ; }"
43 SetFormatNb(me : out; theFormatNb : Integer) is static;
44 FormatNb(me) returns Integer is static;
45 ---Purpose: two formats available for the moment:
46 -- First: does not write CurveOnSurface UV Points into the file
47 -- on reading calls Check() method.
48 -- Second: stores CurveOnSurface UV Points.
49 -- On reading format is recognized from Version string.
52 ---Purpose: Clears the content of the set. This method can be
56 Add(me : in out; S : Shape from TopoDS) returns Integer
57 ---Purpose: Stores <S> and its sub-shape. Returns the index of <S>.
58 -- The method AddGeometry is called on each sub-shape.
61 Shape(me; I : Integer) returns Shape from TopoDS
62 ---Purpose: Returns the sub-shape of index <I>.
64 ---C++: return const &
67 Index(me; S : Shape from TopoDS) returns Integer
68 ---Purpose: Returns the index of <S>.
71 Locations(me) returns LocationSet from TopTools
72 ---C++: return const &
75 ChangeLocations(me : in out) returns LocationSet from TopTools
79 DumpExtent(me; OS : in out OStream) returns OStream
80 ---Purpose: Dumps the number of objects in me on the stream <OS>.
81 -- (Number of shapes of each type)
85 DumpExtent(me; S : in out AsciiString from TCollection)
86 ---Purpose: Dumps the number of objects in me in the string S
87 -- (Number of shapes of each type)
91 Dump(me; OS : in out OStream)
92 ---Purpose: Dumps the content of me on the stream <OS>.
94 -- Dumps the shapes from first to last.
96 -- Dump the type, the flags, the subshapes
97 -- calls DumpGeometry(S)
100 -- Dumps the geometry calling DumpGeometry.
102 -- Dumps the locations.
105 Write(me: in out; OS : in out OStream)
106 ---Purpose: Writes the content of me on the stream <OS> in a
107 -- format that can be read back by Read.
109 -- Writes the locations.
111 -- Writes the geometry calling WriteGeometry.
113 -- Dumps the shapes from last to first.
116 -- calls WriteGeometry(S).
117 -- Write the flags, the subshapes.
120 Read(me : in out; IS : in out IStream)
121 ---Purpose: Reads the content of me from the stream <IS>. me
124 -- Reads the locations.
126 -- Reads the geometry calling ReadGeometry.
131 -- calls ReadGeometry(T,S).
132 -- Reads the flag, the subshapes.
135 Dump(me; S : Shape from TopoDS; OS : in out OStream)
136 ---Purpose: Dumps on <OS> the shape <S>. Dumps the
137 -- orientation, the index of the TShape and the index
141 Write(me; S : Shape from TopoDS; OS : in out OStream)
142 ---Purpose: Writes on <OS> the shape <S>. Writes the
143 -- orientation, the index of the TShape and the index
147 Read(me; S : in out Shape from TopoDS; IS : in out IStream)
148 ---Purpose: Reads from <IS> a shape and returns it in S.
151 Read(me; S : in out Shape from TopoDS; IS : in out IStream;
153 ---Purpose: Reads from <IS> a shape and returns it in S.
154 -- <NbShapes> is the number of tshapes in the set.
158 -- Auxliary methods for the geometry. They can be redefined. In
159 -- this class the perform nothing.
162 AddGeometry(me : in out; S : Shape from TopoDS)
163 ---Purpose: Stores the geometry of <S>.
166 DumpGeometry(me; OS : in out OStream)
167 ---Purpose: Dumps the geometry of me on the stream <OS>.
170 WriteGeometry(me : in out; OS : in out OStream)
171 ---Purpose: Writes the geometry of me on the stream <OS> in a
172 -- format that can be read back by Read.
175 ReadGeometry(me : in out; IS : in out IStream)
176 ---Purpose: Reads the geometry of me from the stream <IS>.
179 DumpGeometry(me; S : Shape from TopoDS; OS : in out OStream)
180 ---Purpose: Dumps the geometry of <S> on the stream <OS>.
183 WriteGeometry(me; S : Shape from TopoDS; OS : in out OStream)
184 ---Purpose: Writes the geometry of <S> on the stream <OS> in a
185 -- format that can be read back by Read.
188 ReadGeometry(me : in out; T : ShapeEnum from TopAbs;
190 S : out Shape from TopoDS)
191 ---Purpose: Reads the geometry of a shape of type <T> from the
192 -- stream <IS> and returns it in <S>.
196 AddShapes(me : in out; S1 : in out Shape from TopoDS;
197 S2 : Shape from TopoDS)
198 ---Purpose: Inserts the shape <S2> in the shape <S1>. This
199 -- method must be redefined to use the correct
204 Check(me : in out; T : ShapeEnum from TopAbs;
205 S : in out Shape from TopoDS)
206 ---Purpose: This method is called after each new completed
207 -- shape. <T> is the type. <S> is the shape. In this
208 -- class it does nothing, but it gives the opportunity
209 -- in derived classes to perform extra treatment on
213 NbShapes(me) returns Integer;
214 ---Purpose:Returns number of shapes read from file.
216 SetProgress(me : in out; PR : ProgressIndicator from Message);
218 GetProgress(me) returns ProgressIndicator from Message;
221 myShapes : IndexedMapOfShape from TopTools;
222 myLocations : LocationSet from TopTools;
223 myFormatNb : Integer from Standard; -- jfa 26.09.2001
224 myProgress : ProgressIndicator from Message;