File indexing completed on 2025-01-18 10:03:01
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
0035 DEFINE_STANDARD_ALLOC
0036
0037
0038
0039 Standard_EXPORT BinTools_ShapeWriter();
0040
0041 Standard_EXPORT virtual ~BinTools_ShapeWriter();
0042
0043
0044 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
0045
0046
0047 Standard_EXPORT virtual void Write (const TopoDS_Shape& theShape, Standard_OStream& theStream) Standard_OVERRIDE;
0048
0049
0050 Standard_EXPORT virtual void WriteLocation (BinTools_OStream& theStream, const TopLoc_Location& theLocation);
0051
0052 private:
0053
0054 virtual void WriteShape (BinTools_OStream& theStream, const TopoDS_Shape& theShape);
0055
0056 void WriteCurve (BinTools_OStream& theStream, const Handle(Geom_Curve)& theCurve);
0057
0058 void WriteCurve (BinTools_OStream& theStream, const Handle(Geom2d_Curve)& theCurve);
0059
0060 void WriteSurface (BinTools_OStream& theStream, const Handle(Geom_Surface)& theSurface);
0061
0062 void WritePolygon (BinTools_OStream& theStream, const Handle(Poly_Polygon3D)& thePolygon);
0063
0064 void WritePolygon (BinTools_OStream& theStream, const Handle(Poly_PolygonOnTriangulation)& thePolygon);
0065
0066 void WriteTriangulation (BinTools_OStream& theStream, const Handle(Poly_Triangulation)& theTriangulation,
0067 const Standard_Boolean theNeedToWriteNormals);
0068
0069
0070 NCollection_DataMap<TopoDS_Shape, uint64_t, TopTools_ShapeMapHasher> myShapePos;
0071 NCollection_DataMap<TopLoc_Location, uint64_t> myLocationPos;
0072 NCollection_DataMap<Handle(Geom_Curve), uint64_t> myCurvePos;
0073 NCollection_DataMap<Handle(Geom2d_Curve), uint64_t> myCurve2dPos;
0074 NCollection_DataMap<Handle(Geom_Surface), uint64_t> mySurfacePos;
0075 NCollection_DataMap<Handle(Poly_Polygon3D), uint64_t> myPolygon3dPos;
0076 NCollection_DataMap<Handle(Poly_PolygonOnTriangulation), uint64_t> myPolygonPos;
0077 NCollection_DataMap<Handle(Poly_Triangulation), uint64_t> myTriangulationPos;
0078 };
0079
0080 #endif