Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:00

0001 // Created on: 2004-04-08
0002 // Created by: Sergey ZARITCHNY <szy@opencascade.com>
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _BinMNaming_NamedShapeDriver_HeaderFile
0017 #define _BinMNaming_NamedShapeDriver_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <BinTools_ShapeSet.hxx>
0022 #include <Standard_Integer.hxx>
0023 #include <BinMDF_ADriver.hxx>
0024 #include <BinObjMgt_RRelocationTable.hxx>
0025 #include <BinObjMgt_SRelocationTable.hxx>
0026 #include <Standard_IStream.hxx>
0027 #include <Standard_OStream.hxx>
0028 class Message_Messenger;
0029 class TDF_Attribute;
0030 class BinObjMgt_Persistent;
0031 class BinTools_LocationSet;
0032 
0033 
0034 class BinMNaming_NamedShapeDriver;
0035 DEFINE_STANDARD_HANDLE(BinMNaming_NamedShapeDriver, BinMDF_ADriver)
0036 
0037 //! NamedShape  Attribute Driver.
0038 class BinMNaming_NamedShapeDriver : public BinMDF_ADriver
0039 {
0040 
0041 public:
0042 
0043   
0044   Standard_EXPORT BinMNaming_NamedShapeDriver(const Handle(Message_Messenger)& theMessageDriver);
0045   
0046   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0047   
0048   Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
0049   
0050   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
0051   
0052   //! Input the shapes from Bin Document file
0053   Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS,
0054                                          const Message_ProgressRange& therange = Message_ProgressRange());
0055   
0056   //! Output the shapes into Bin Document file
0057   Standard_EXPORT void WriteShapeSection(Standard_OStream& theOS,
0058                                          const Standard_Integer theDocVer,
0059                                          const Message_ProgressRange& therange = Message_ProgressRange());
0060   
0061   //! Clear myShapeSet
0062   Standard_EXPORT void Clear();
0063 
0064   //! Return true if shape should be stored with triangles.
0065   Standard_Boolean IsWithTriangles() const { return myWithTriangles; }
0066   //! Return true if shape should be stored with triangulation normals.
0067   Standard_Boolean IsWithNormals() const { return myWithNormals; }
0068   //! set whether to store triangulation
0069   void SetWithTriangles (const Standard_Boolean isWithTriangles);
0070   //! set whether to store triangulation with normals
0071   void SetWithNormals (const Standard_Boolean isWithNormals);
0072   //! get the shapes locations
0073   Standard_EXPORT BinTools_LocationSet& GetShapesLocations() const;
0074 
0075   //! Sets the flag for quick part of the document access: shapes are stored in the attribute.
0076   Standard_EXPORT void EnableQuickPart(const Standard_Boolean theValue) { myIsQuickPart = theValue; }
0077   //! Returns true if quick part of the document access is enabled: shapes are stored in the attribute.
0078   Standard_EXPORT Standard_Boolean IsQuickPart() { return myIsQuickPart; }
0079 
0080   //! Returns shape-set of the needed type
0081   Standard_EXPORT BinTools_ShapeSetBase* ShapeSet (const Standard_Boolean theReading);
0082 
0083   DEFINE_STANDARD_RTTIEXT(BinMNaming_NamedShapeDriver,BinMDF_ADriver)
0084 
0085 
0086 private:
0087 
0088 
0089   BinTools_ShapeSetBase *myShapeSet;
0090   Standard_Boolean myWithTriangles;
0091   Standard_Boolean myWithNormals;
0092   //! Enables storing of whole shape data just in the attribute, not in a separated shapes section
0093   Standard_Boolean myIsQuickPart;
0094 
0095 };
0096 
0097 
0098 #include <BinMNaming_NamedShapeDriver.lxx>
0099 
0100 
0101 
0102 
0103 
0104 #endif // _BinMNaming_NamedShapeDriver_HeaderFile