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 _DEXCAFCascade_ConfigurationNode_HeaderFile
0015 #define _DEXCAFCascade_ConfigurationNode_HeaderFile
0016 
0017 #include <DE_ConfigurationNode.hxx>
0018 #include <PCDM_ReaderFilter.hxx>
0019 #include <TColStd_ListOfAsciiString.hxx>
0020 
0021 //! The purpose of this class is to configure the transfer process for XDE Documents
0022 //! Stores the necessary settings for DEXCAFCascade_Provider.
0023 //! Configures and creates special provider to transfer XDE Documents.
0024 //!
0025 //! Nodes grouped by Vendor name and Format type.
0026 //! The Vendor name is "OCC"
0027 //! The Format type is "XCAF"
0028 //! The supported CAD extension is ".xbf"
0029 //! The import process is supported.
0030 //! The export process is supported.
0031 class DEXCAFCascade_ConfigurationNode : public DE_ConfigurationNode
0032 {
0033   DEFINE_STANDARD_RTTIEXT(DEXCAFCascade_ConfigurationNode, DE_ConfigurationNode)
0034 public:
0035 
0036   //! Initializes all field by default
0037   Standard_EXPORT DEXCAFCascade_ConfigurationNode();
0038 
0039   //! Copies values of all fields
0040   //! @param[in] theNode object to copy
0041   Standard_EXPORT DEXCAFCascade_ConfigurationNode(const Handle(DEXCAFCascade_ConfigurationNode)& theNode);
0042 
0043   //! Updates values according the resource
0044   //! @param[in] theResource input resource to use
0045   //! @return true if theResource loading has ended correctly
0046   Standard_EXPORT virtual bool Load(const Handle(DE_ConfigurationContext)& theResource) Standard_OVERRIDE;
0047 
0048   //! Writes configuration to the string
0049   //! @return result resource string
0050   Standard_EXPORT virtual TCollection_AsciiString Save() const Standard_OVERRIDE;
0051 
0052   //! Copies values of all fields
0053   //! @return new object with the same field values
0054   Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const Standard_OVERRIDE;
0055 
0056 
0057   //! Creates new provider for the own format
0058   //! @return new created provider
0059   Standard_EXPORT virtual Handle(DE_Provider) BuildProvider() Standard_OVERRIDE;
0060 
0061 public:
0062 
0063   //! Checks the import supporting
0064   //! @return true if import is supported
0065   Standard_EXPORT virtual bool IsImportSupported() const Standard_OVERRIDE;
0066 
0067   //! Checks the export supporting
0068   //! @return true if export is supported
0069   Standard_EXPORT virtual bool IsExportSupported() const Standard_OVERRIDE;
0070 
0071   //! Gets CAD format name of associated provider
0072   //! @return provider CAD format
0073   Standard_EXPORT virtual TCollection_AsciiString GetFormat() const Standard_OVERRIDE;
0074 
0075   //! Gets provider's vendor name of associated provider
0076   //! @return provider's vendor name
0077   Standard_EXPORT virtual TCollection_AsciiString GetVendor() const Standard_OVERRIDE;
0078 
0079   //! Gets list of supported file extensions
0080   //! @return list of extensions
0081   Standard_EXPORT virtual TColStd_ListOfAsciiString GetExtensions() const Standard_OVERRIDE;
0082 
0083   //! Checks the file content to verify a format
0084   //! @param[in] theBuffer read stream buffer to check content
0085   //! @return Standard_True if file is supported by a current provider
0086   Standard_EXPORT virtual bool CheckContent(const Handle(NCollection_Buffer)& theBuffer) const Standard_OVERRIDE;
0087 
0088 public:
0089   struct XCAFDoc_InternalSection
0090   {
0091     // Read
0092     PCDM_ReaderFilter::AppendMode ReadAppendMode = PCDM_ReaderFilter::AppendMode::AppendMode_Forbid; //!< Setting up the append mode
0093     TColStd_ListOfAsciiString ReadSkipValues; //!< Overwrites the existing attributes by the loaded ones
0094     TColStd_ListOfAsciiString ReadValues; //!< Adds sub-tree path or adds attribute to read by typename
0095 
0096   } InternalParameters;
0097 };
0098 
0099 #endif // _DEXCAFCascade_ConfigurationNode_HeaderFile