1 // Created on: 2004-04-08
2 // Created by: Sergey ZARITCHNY <szy@opencascade.com>
3 // Copyright (c) 2004-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BinMNaming_NamedShapeDriver_HeaderFile
17 #define _BinMNaming_NamedShapeDriver_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <BinTools_ShapeSet.hxx>
23 #include <Standard_Integer.hxx>
24 #include <BinMDF_ADriver.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <BinObjMgt_RRelocationTable.hxx>
27 #include <BinObjMgt_SRelocationTable.hxx>
28 #include <Standard_IStream.hxx>
29 #include <Standard_OStream.hxx>
30 class Message_Messenger;
32 class BinObjMgt_Persistent;
33 class BinTools_LocationSet;
36 class BinMNaming_NamedShapeDriver;
37 DEFINE_STANDARD_HANDLE(BinMNaming_NamedShapeDriver, BinMDF_ADriver)
39 //! NamedShape Attribute Driver.
40 class BinMNaming_NamedShapeDriver : public BinMDF_ADriver
46 Standard_EXPORT BinMNaming_NamedShapeDriver(const Handle(Message_Messenger)& theMessageDriver);
48 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
50 Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
52 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
54 //! Input the shapes from Bin Document file
55 Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS);
57 //! Output the shapes into Bin Document file
58 Standard_EXPORT void WriteShapeSection (Standard_OStream& theOS);
61 Standard_EXPORT void Clear();
63 //! Return true if shape should be stored with triangles.
64 Standard_Boolean IsWithTriangles() const { return myShapeSet.IsWithTriangles(); }
66 //! set whether to store triangulation
67 void SetWithTriangles (const Standard_Boolean isWithTriangles);
69 //! set the format of topology
70 //! First : does not write CurveOnSurface UV Points into the file
71 //! on reading calls Check() method.
72 //! Second: stores CurveOnSurface UV Points.
73 void SetFormatNb (const Standard_Integer theFormat);
75 //! get the format of topology
76 Standard_Integer GetFormatNb() const;
78 //! get the format of topology
79 BinTools_LocationSet& GetShapesLocations();
84 DEFINE_STANDARD_RTTIEXT(BinMNaming_NamedShapeDriver,BinMDF_ADriver)
94 BinTools_ShapeSet myShapeSet;
95 Standard_Integer myFormatNb;
101 #include <BinMNaming_NamedShapeDriver.lxx>
107 #endif // _BinMNaming_NamedShapeDriver_HeaderFile