File indexing completed on 2026-11-28 10:19:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BinTools_ShapeWriter_HeaderFile
0015 #define _BinTools_ShapeWriter_HeaderFile
0016
0017 #include <BinTools_ShapeSetBase.hxx>
0018 #include <BinTools_OStream.hxx>
0019 #include <NCollection_DataMap.hxx>
0020 #include <TopTools_ShapeMapHasher.hxx>
0021
0022 class Geom_Curve;
0023 class Geom2d_Curve;
0024 class Geom_Surface;
0025 class Poly_Polygon3D;
0026 class Poly_PolygonOnTriangulation;
0027 class Poly_Triangulation;
0028
0029
0030
0031 class BinTools_ShapeWriter : public BinTools_ShapeSetBase
0032 {
0033 public:
0034 DEFINE_STANDARD_ALLOC
0035
0036
0037
0038 Standard_EXPORT BinTools_ShapeWriter();
0039
0040 Standard_EXPORT ~BinTools_ShapeWriter() override;
0041
0042
0043 Standard_EXPORT void Clear() override;
0044
0045
0046 Standard_EXPORT void Write(const TopoDS_Shape& theShape, Standard_OStream& theStream) override;
0047
0048
0049
0050 Standard_EXPORT virtual void WriteLocation(BinTools_OStream& theStream,
0051 const TopLoc_Location& theLocation);
0052
0053 private:
0054
0055
0056 virtual void WriteShape(BinTools_OStream& theStream, const TopoDS_Shape& theShape);
0057
0058
0059 void WriteCurve(BinTools_OStream& theStream, const occ::handle<Geom_Curve>& theCurve);
0060
0061
0062 void WriteCurve(BinTools_OStream& theStream, const occ::handle<Geom2d_Curve>& theCurve);
0063
0064 void WriteSurface(BinTools_OStream& theStream, const occ::handle<Geom_Surface>& theSurface);
0065
0066 void WritePolygon(BinTools_OStream& theStream, const occ::handle<Poly_Polygon3D>& thePolygon);
0067
0068 void WritePolygon(BinTools_OStream& theStream,
0069 const occ::handle<Poly_PolygonOnTriangulation>& thePolygon);
0070
0071 void WriteTriangulation(BinTools_OStream& theStream,
0072 const occ::handle<Poly_Triangulation>& theTriangulation,
0073 const bool theNeedToWriteNormals);
0074
0075
0076 NCollection_DataMap<TopoDS_Shape, uint64_t, TopTools_ShapeMapHasher> myShapePos;
0077 NCollection_DataMap<TopLoc_Location, uint64_t> myLocationPos;
0078 NCollection_DataMap<occ::handle<Geom_Curve>, uint64_t> myCurvePos;
0079 NCollection_DataMap<occ::handle<Geom2d_Curve>, uint64_t> myCurve2dPos;
0080 NCollection_DataMap<occ::handle<Geom_Surface>, uint64_t> mySurfacePos;
0081 NCollection_DataMap<occ::handle<Poly_Polygon3D>, uint64_t> myPolygon3dPos;
0082 NCollection_DataMap<occ::handle<Poly_PolygonOnTriangulation>, uint64_t> myPolygonPos;
0083 NCollection_DataMap<occ::handle<Poly_Triangulation>, uint64_t> myTriangulationPos;
0084 };
0085
0086 #endif