Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:16:56

0001 // Copyright (c) 2019 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _BinMXCAFDoc_VisMaterialDriver_HeaderFile
0015 #define _BinMXCAFDoc_VisMaterialDriver_HeaderFile
0016 
0017 #include <BinMDF_ADriver.hxx>
0018 #include <Standard_Boolean.hxx>
0019 #include <BinObjMgt_RRelocationTable.hxx>
0020 #include <Standard_Transient.hxx>
0021 #include <NCollection_IndexedMap.hxx>
0022 
0023 //! Binary persistence driver for XCAFDoc_VisMaterial attribute.
0024 class BinMXCAFDoc_VisMaterialDriver : public BinMDF_ADriver
0025 {
0026   DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_VisMaterialDriver, BinMDF_ADriver)
0027 
0028   //! Persistence version (major for breaking changes, minor for adding new fields at end).
0029   enum
0030   {
0031     MaterialVersionMajor_1 = 1,
0032     MaterialVersionMinor_0 = 0,
0033     MaterialVersionMinor_1 = 1, //!< added IOR
0034 
0035     MaterialVersionMajor = MaterialVersionMajor_1,
0036     MaterialVersionMinor = MaterialVersionMinor_1
0037   };
0038 
0039 public:
0040   //! Main constructor.
0041   Standard_EXPORT BinMXCAFDoc_VisMaterialDriver(const occ::handle<Message_Messenger>& theMsgDriver);
0042 
0043   //! Create new instance of XCAFDoc_VisMaterial.
0044   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0045 
0046   //! Paste attribute from persistence into document.
0047   Standard_EXPORT bool Paste(const BinObjMgt_Persistent&       theSource,
0048                              const occ::handle<TDF_Attribute>& theTarget,
0049                              BinObjMgt_RRelocationTable&       theRelocTable) const override;
0050 
0051   //! Paste attribute from document into persistence.
0052   Standard_EXPORT void Paste(
0053     const occ::handle<TDF_Attribute>&                        theSource,
0054     BinObjMgt_Persistent&                                    theTarget,
0055     NCollection_IndexedMap<occ::handle<Standard_Transient>>& theRelocTable) const override;
0056 };
0057 
0058 #endif // _BinMXCAFDoc_VisMaterialDriver_HeaderFile