0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / BinMNaming / BinMNaming_NamedShapeDriver.hxx
... / ...
CommitLineData
1// Created on: 2004-04-08
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
16#ifndef _BinMNaming_NamedShapeDriver_HeaderFile
17#define _BinMNaming_NamedShapeDriver_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
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>
30class Message_Messenger;
31class TDF_Attribute;
32class BinObjMgt_Persistent;
33class BinTools_LocationSet;
34
35
36class BinMNaming_NamedShapeDriver;
37DEFINE_STANDARD_HANDLE(BinMNaming_NamedShapeDriver, BinMDF_ADriver)
38
39//! NamedShape Attribute Driver.
40class BinMNaming_NamedShapeDriver : public BinMDF_ADriver
41{
42
43public:
44
45
46 Standard_EXPORT BinMNaming_NamedShapeDriver(const Handle(Message_Messenger)& theMessageDriver);
47
48 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
49
50 Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
51
52 Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
53
54 //! Input the shapes from Bin Document file
55 Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS);
56
57 //! Output the shapes into Bin Document file
58 Standard_EXPORT void WriteShapeSection (Standard_OStream& theOS);
59
60 //! Clear myShapeSet
61 Standard_EXPORT void Clear();
62
63 //! Return true if shape should be stored with triangles.
64 Standard_Boolean IsWithTriangles() const { return myShapeSet.IsWithTriangles(); }
65
66 //! set whether to store triangulation
67 void SetWithTriangles (const Standard_Boolean isWithTriangles);
68
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);
74
75 //! get the format of topology
76 Standard_Integer GetFormatNb() const;
77
78 //! get the format of topology
79 BinTools_LocationSet& GetShapesLocations();
80
81
82
83
84 DEFINE_STANDARD_RTTIEXT(BinMNaming_NamedShapeDriver,BinMDF_ADriver)
85
86protected:
87
88
89
90
91private:
92
93
94 BinTools_ShapeSet myShapeSet;
95 Standard_Integer myFormatNb;
96
97
98};
99
100
101#include <BinMNaming_NamedShapeDriver.lxx>
102
103
104
105
106
107#endif // _BinMNaming_NamedShapeDriver_HeaderFile