Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2022 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 _DEBRepCascade_ConfigurationNode_HeaderFile
0015 #define _DEBRepCascade_ConfigurationNode_HeaderFile
0016 
0017 #include <DE_ConfigurationNode.hxx>
0018 
0019 #include <BinTools_FormatVersion.hxx>
0020 #include <TopTools_FormatVersion.hxx>
0021 
0022 //! The purpose of this class is to configure the transfer process for BRep format
0023 //! Stores the necessary settings for DEBRepCascade_Provider.
0024 //! Configures and creates special provider to transfer BRep files.
0025 //!
0026 //! Nodes grouped by Vendor name and Format type.
0027 //! The Vendor name is "OCC"
0028 //! The Format type is "BREP"
0029 //! The supported CAD extension is ".brep"
0030 //! The import process is supported.
0031 //! The export process is supported.
0032 class DEBRepCascade_ConfigurationNode : public DE_ConfigurationNode
0033 {
0034   DEFINE_STANDARD_RTTIEXT(DEBRepCascade_ConfigurationNode, DE_ConfigurationNode)
0035 public:
0036 
0037   //! Initializes all field by default
0038   Standard_EXPORT DEBRepCascade_ConfigurationNode();
0039 
0040   //! Copies values of all fields
0041   //! @param[in] theNode object to copy
0042   Standard_EXPORT DEBRepCascade_ConfigurationNode(const Handle(DEBRepCascade_ConfigurationNode)& theNode);
0043 
0044   //! Updates values according the resource
0045   //! @param[in] theResource input resource to use
0046   //! @return true if theResource loading has ended correctly
0047   Standard_EXPORT virtual bool Load(const Handle(DE_ConfigurationContext)& theResource) Standard_OVERRIDE;
0048 
0049   //! Writes configuration to the string
0050   //! @return result resource string
0051   Standard_EXPORT virtual TCollection_AsciiString Save() const Standard_OVERRIDE;
0052 
0053   //! Copies values of all fields
0054   //! @return new object with the same field values
0055   Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const Standard_OVERRIDE;
0056 
0057 
0058   //! Creates new provider for the own format
0059   //! @return new created provider
0060   Standard_EXPORT virtual Handle(DE_Provider) BuildProvider() Standard_OVERRIDE;
0061 
0062 public:
0063 
0064   //! Checks the import supporting
0065   //! @return true if import is supported
0066   Standard_EXPORT virtual bool IsImportSupported() const Standard_OVERRIDE;
0067 
0068   //! Checks the export supporting
0069   //! @return true if export is supported
0070   Standard_EXPORT virtual bool IsExportSupported() const Standard_OVERRIDE;
0071 
0072   //! Gets CAD format name of associated provider
0073   //! @return provider CAD format
0074   Standard_EXPORT virtual TCollection_AsciiString GetFormat() const Standard_OVERRIDE;
0075 
0076   //! Gets provider's vendor name of associated provider
0077   //! @return provider's vendor name
0078   Standard_EXPORT virtual TCollection_AsciiString GetVendor() const Standard_OVERRIDE;
0079 
0080   //! Gets list of supported file extensions
0081   //! @return list of extensions
0082   Standard_EXPORT virtual TColStd_ListOfAsciiString GetExtensions() const Standard_OVERRIDE;
0083 
0084   //! Checks the file content to verify a format
0085   //! @param[in] theBuffer read stream buffer to check content
0086   //! @return Standard_True if file is supported by a current provider
0087   Standard_EXPORT virtual bool CheckContent(const Handle(NCollection_Buffer)& theBuffer) const Standard_OVERRIDE;
0088 
0089 public:
0090   struct DEBRep_InternalSection
0091   {
0092     // Write
0093     bool WriteBinary = true; //!< Defines the binary file format
0094     BinTools_FormatVersion WriteVersionBin = BinTools_FormatVersion_CURRENT; //!< Defines the writer version for the binary format
0095     TopTools_FormatVersion WriteVersionAscii = TopTools_FormatVersion_CURRENT; //!< Defines the writer version for the ASCII format
0096     bool WriteTriangles = true; //!< Defines the flag for storing shape with(without) triangles
0097     bool WriteNormals = true; //!< Defines the flag for storing shape with(without) normals
0098 
0099   } InternalParameters;
0100 };
0101 
0102 #endif // _DEBRepCascade_ConfigurationNode_HeaderFile