0025255: API to control storage with triangulation in BinTools
[occt.git] / src / BinTools / BinTools_ShapeSet.cdl
... / ...
CommitLineData
1-- Created on: 2004-05-11
2-- Created by: Sergey ZARITCHNY <szy@opencascade.com>
3-- Copyright (c) 2004-2014 OPEN CASCADE SAS
4--
5-- This file is part of Open CASCADE Technology software library.
6--
7-- This library is free software; you can redistribute it and/or modify it under
8-- the terms of the GNU Lesser General Public License version 2.1 as published
9-- by the Free Software Foundation, with special exception defined in the file
10-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11-- distribution for complete text of the license and disclaimer of any warranty.
12--
13-- Alternatively, this file may be used under the terms of Open CASCADE
14-- commercial license or contractual agreement.
15
16class ShapeSet from BinTools
17
18 ---Purpose: Writes topology in OStream in binary format
19
20uses
21 Shape from TopoDS,
22 IndexedMapOfShape from TopTools,
23 ShapeEnum from TopAbs,
24 Builder from BRep,
25 ShapeEnum from TopAbs,
26 LocationSet from BinTools,
27 SurfaceSet from BinTools,
28 CurveSet from BinTools,
29 Curve2dSet from BinTools,
30 IndexedMapOfTransient from TColStd
31
32
33is
34
35
36 Create(isWithTriangles: Boolean from Standard = Standard_False)
37 returns ShapeSet from BinTools;
38 ---Purpose: Builds an empty ShapeSet.
39 -- Parameter <isWithTriangles> is added for XML Persistence
40
41 Delete(me:out) is virtual;
42 ---C++: alias "Standard_EXPORT virtual ~BinTools_ShapeSet(){Delete() ; }"
43
44 SetWithTriangles(me : out; isWithTriangles : Boolean) is static;
45 ---Purpose: Define if shape will be stored with triangles
46
47 SetFormatNb(me : out; theFormatNb : Integer) is static;
48
49 FormatNb(me) returns Integer is static;
50 ---Purpose: two formats available for the moment:
51 -- First: does not write CurveOnSurface UV Points into the file
52 -- on reading calls Check() method.
53 -- Second: stores CurveOnSurface UV Points.
54 -- On reading format is recognized from Version string.
55
56 Clear(me : in out)
57 ---Purpose: Clears the content of the set.
58 is virtual;
59
60 Add(me : in out; S : Shape from TopoDS) returns Integer
61 ---Purpose: Stores <S> and its sub-shape. Returns the index of <S>.
62 -- The method AddGeometry is called on each sub-shape.
63 is static;
64
65 Shape(me; I : Integer) returns Shape from TopoDS
66 ---Purpose: Returns the sub-shape of index <I>.
67 --
68 ---C++: return const &
69 is static;
70
71 Index(me; S : Shape from TopoDS) returns Integer
72 ---Purpose: Returns the index of <S>.
73 is static;
74
75 Locations(me) returns LocationSet from BinTools
76 ---C++: return const &
77 is static;
78
79 ChangeLocations(me : in out) returns LocationSet from BinTools
80 ---C++: return &
81 is static;
82
83 NbShapes(me) returns Integer;
84 ---Purpose:Returns number of shapes read from file.
85
86 Write(me; OS : in out OStream)
87 ---Purpose: Writes the content of me on the stream <OS> in binary
88 -- format that can be read back by Read.
89 --
90 -- Writes the locations.
91 --
92 -- Writes the geometry calling WriteGeometry.
93 --
94 -- Dumps the shapes from last to first.
95 -- For each shape :
96 -- Write the type.
97 -- calls WriteGeometry(S).
98 -- Write the flags, the subshapes.
99 is virtual;
100
101 Read(me : in out; IS : in out IStream)
102 ---Purpose: Reads the content of me from the binary stream <IS>. me
103 -- is first cleared.
104 --
105 -- Reads the locations.
106 --
107 -- Reads the geometry calling ReadGeometry.
108 --
109 -- Reads the shapes.
110 -- For each shape
111 -- Reads the type.
112 -- calls ReadGeometry(T,S).
113 -- Reads the flag, the subshapes.
114 is virtual;
115
116 Write(me; S : Shape from TopoDS; OS : in out OStream)
117 ---Purpose: Writes on <OS> the shape <S>. Writes the
118 -- orientation, the index of the TShape and the index
119 -- of the Location.
120 is virtual;
121
122 WriteGeometry(me; OS : in out OStream)
123 ---Purpose: Writes the geometry of me on the stream <OS> in a
124 -- binary format that can be read back by Read.
125 is virtual;
126
127 ReadGeometry(me : in out; IS : in out IStream)
128 ---Purpose: Reads the geometry of me from the stream <IS>.
129 is virtual;
130
131 Read(me; S : in out Shape from TopoDS; IS : in out IStream;
132 NbShapes : Integer)
133 ---Purpose: Reads from <IS> a shape and returns it in S.
134 -- <NbShapes> is the number of tshapes in the set.
135 is virtual;
136
137 WriteGeometry(me; S : Shape from TopoDS; OS : in out OStream)
138 ---Purpose: Writes the geometry of <S> on the stream <OS> in a
139 -- binary format that can be read back by Read.
140 is virtual;
141
142 ReadGeometry(me : in out; T : ShapeEnum from TopAbs;
143 IS : in out IStream;
144 S : out Shape from TopoDS)
145 ---Purpose: Reads the geometry of a shape of type <T> from the
146 -- stream <IS> and returns it in <S>.
147 is virtual;
148
149 AddGeometry(me : in out; S : Shape from TopoDS)
150 ---Purpose: Stores the goemetry of <S>.
151 is virtual;
152
153-- WriteLocations(me; OS: in out OStream from Standard) is static;
154
155-- ReadLocations(me: in out; OS: in out IStream from Standard) is static;
156
157 AddShapes(me : in out; S1 : in out Shape from TopoDS;
158 S2 : Shape from TopoDS)
159 ---Purpose: Inserts the shape <S2> in the shape <S1>.
160 is virtual;
161
162 ReadPolygon3D(me: in out; IS: in out IStream)
163 ---Purpose: Reads the 3d polygons of me
164 -- from the stream <IS>.
165 is static;
166
167 WritePolygon3D(me; OS: in out OStream)
168 ---Purpose: Writes the 3d polygons
169 -- on the stream <OS> in a format that can
170 -- be read back by Read.
171 is static;
172
173 ReadTriangulation(me: in out; IS: in out IStream)
174 ---Purpose: Reads the triangulation of me
175 -- from the stream <IS>.
176 is static;
177
178 WriteTriangulation(me; OS: in out OStream)
179 ---Purpose: Writes the triangulation
180 -- on the stream <OS> in a format that can
181 -- be read back by Read.
182 is static;
183
184 ReadPolygonOnTriangulation(me: in out; IS: in out IStream)
185 ---Purpose: Reads the polygons on triangulation of me
186 -- from the stream <IS>.
187 is static;
188
189 WritePolygonOnTriangulation(me; OS: in out OStream)
190 ---Purpose: Writes the polygons on triangulation
191 -- on the stream <OS> in a format that can
192 -- be read back by Read.
193 is static;
194
195 fields
196 myShapes : IndexedMapOfShape from TopTools;
197 myLocations : LocationSet from BinTools;
198 myFormatNb : Integer from Standard; -- jfa 26.09.2001
199 myBuilder : Builder from BRep;
200 mySurfaces : SurfaceSet from BinTools;
201 myCurves : CurveSet from BinTools;
202 myCurves2d : Curve2dSet from BinTools;
203 myPolygons2D: IndexedMapOfTransient from TColStd;
204 myPolygons3D: IndexedMapOfTransient from TColStd;
205 myTriangulations: IndexedMapOfTransient from TColStd;
206 myNodes : IndexedMapOfTransient from TColStd;
207 myWithTriangles: Boolean from Standard;
208end ShapeSet;