Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:43

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 _RWPly_ConfigurationNode_HeaderFile
0015 #define _RWPly_ConfigurationNode_HeaderFile
0016 
0017 #include <DE_ConfigurationNode.hxx>
0018 #include <Precision.hxx>
0019 #include <RWMesh_CoordinateSystem.hxx>
0020 
0021 class DE_ConfigurationContext;
0022 
0023 //! The purpose of this class is to configure the transfer process for PLY format
0024 //! Stores the necessary settings for RWPly_Provider.
0025 //! Configures and creates special provider to transfer PLY files.
0026 //!
0027 //! Nodes grouped by Vendor name and Format type.
0028 //! The Vendor name is "OCC"
0029 //! The Format type is "PLY"
0030 //! The supported CAD extension is ".ply"
0031 //! The import process isn't supported.
0032 //! The export process is supported.
0033 class RWPly_ConfigurationNode : public DE_ConfigurationNode
0034 {
0035   DEFINE_STANDARD_RTTIEXT(RWPly_ConfigurationNode, DE_ConfigurationNode)
0036 public:
0037 
0038   //! Initializes all field by default
0039   Standard_EXPORT RWPly_ConfigurationNode();
0040 
0041   //! Copies values of all fields
0042   //! @param[in] theNode object to copy
0043   Standard_EXPORT RWPly_ConfigurationNode(const Handle(RWPly_ConfigurationNode)& theNode);
0044 
0045   //! Updates values according the resource
0046   //! @param[in] theResource input resource to use
0047   //! @return true if theResource loading has ended correctly
0048   Standard_EXPORT virtual bool Load(const Handle(DE_ConfigurationContext)& theResource) Standard_OVERRIDE;
0049 
0050   //! Writes configuration to the string
0051   //! @return result resource string
0052   Standard_EXPORT virtual TCollection_AsciiString Save() const Standard_OVERRIDE;
0053 
0054   //! Copies values of all fields
0055   //! @return new object with the same field values
0056   Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const Standard_OVERRIDE;
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 RWPly_InternalSection
0091   {
0092     // Common
0093     double FileLengthUnit = 1.; //!< File length units to convert from while reading the file, defined as scale factor for m (meters)
0094     RWMesh_CoordinateSystem SystemCS = RWMesh_CoordinateSystem_Zup; //!< System origin coordinate system to perform conversion into during read
0095     RWMesh_CoordinateSystem FileCS = RWMesh_CoordinateSystem_Yup; //!< File origin coordinate system to perform conversion during read
0096     // Writing
0097     bool WriteNormals = true; //!< Flag for write normals
0098     bool WriteColors = true; //!< Flag for write colors
0099     bool WriteTexCoords = false; //!< Flag for write UV / texture coordinates
0100     bool WritePartId = true; //!< Flag for write part Id as element attribute
0101     bool WriteFaceId = false; //!< Flag for write face Id as element attribute. Cannot be combined with HasPartId
0102     TCollection_AsciiString WriteComment; //!< Export special comment
0103     TCollection_AsciiString WriteAuthor; //!< Author of exported file name
0104   } InternalParameters;
0105 };
0106 
0107 #endif // _RWPly_ConfigurationNode_HeaderFile