Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/DEGLTF_ConfigurationNode.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 _DEGLTF_ConfigurationNode_HeaderFile
0015 #define _DEGLTF_ConfigurationNode_HeaderFile
0016 
0017 #include <DE_ConfigurationNode.hxx>
0018 #include <RWGltf_WriterTrsfFormat.hxx>
0019 #include <RWMesh_CoordinateSystem.hxx>
0020 #include <RWMesh_NameFormat.hxx>
0021 
0022 //! The purpose of this class is to configure the transfer process for glTF format
0023 //! Stores the necessary settings for DEGLTF_Provider.
0024 //! Configures and creates special provider to transfer glTF files.
0025 //!
0026 //! Nodes grouped by Vendor name and Format type.
0027 //! The Vendor name is "OCC"
0028 //! The Format type is "GLTF"
0029 //! The supported CAD extensions are ".gltf", ".glb"
0030 //! The import process is supported.
0031 //! The export process is supported.
0032 class DEGLTF_ConfigurationNode : public DE_ConfigurationNode
0033 {
0034   DEFINE_STANDARD_RTTIEXT(DEGLTF_ConfigurationNode, DE_ConfigurationNode)
0035 public:
0036   //! Initializes all field by default
0037   Standard_EXPORT DEGLTF_ConfigurationNode();
0038 
0039   //! Copies values of all fields
0040   //! @param[in] theNode object to copy
0041   Standard_EXPORT DEGLTF_ConfigurationNode(const Handle(DEGLTF_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)
0047     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   //! 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   //! Checks the import supporting
0063   //! @return true if import is supported
0064   Standard_EXPORT virtual bool IsImportSupported() const Standard_OVERRIDE;
0065 
0066   //! Checks the export supporting
0067   //! @return true if export is supported
0068   Standard_EXPORT virtual bool IsExportSupported() const Standard_OVERRIDE;
0069 
0070   //! Gets CAD format name of associated provider
0071   //! @return provider CAD format
0072   Standard_EXPORT virtual TCollection_AsciiString GetFormat() const Standard_OVERRIDE;
0073 
0074   //! Gets provider's vendor name of associated provider
0075   //! @return provider's vendor name
0076   Standard_EXPORT virtual TCollection_AsciiString GetVendor() const Standard_OVERRIDE;
0077 
0078   //! Gets list of supported file extensions
0079   //! @return list of extensions
0080   Standard_EXPORT virtual TColStd_ListOfAsciiString GetExtensions() const Standard_OVERRIDE;
0081 
0082 public:
0083   struct RWGltf_InternalSection
0084   {
0085     // Common
0086     // clang-format off
0087     double FileLengthUnit = 1.; //!< File length units to convert from while reading the file, defined as scale factor for m (meters)
0088     RWMesh_CoordinateSystem SystemCS = RWMesh_CoordinateSystem_Zup; //!< System origin coordinate system to perform conversion into during read
0089     RWMesh_CoordinateSystem FileCS = RWMesh_CoordinateSystem_Yup; //!< File origin coordinate system to perform conversion during read
0090     // Reading
0091     bool ReadSinglePrecision = true; //!< Flag for reading vertex data with single or double floating point precision
0092     bool ReadCreateShapes = false;  //!< Flag for create a single triangulation
0093     TCollection_AsciiString ReadRootPrefix; //!< Root folder for generating root labels names
0094     bool ReadFillDoc = true; //!< Flag for fill document from shape sequence
0095     bool ReadFillIncomplete = true; //!< Flag for fill the document with partially retrieved data even if reader has failed with error
0096     int ReadMemoryLimitMiB = -1; //!< Memory usage limit
0097     bool ReadParallel = false; //!< Flag to use multithreading
0098     bool ReadSkipEmptyNodes = true; //!< Flag to ignore nodes without Geometry
0099     bool ReadLoadAllScenes = false; //!< Flag to load all scenes in the document
0100     bool ReadUseMeshNameAsFallback = true; //!< Flag to use Mesh name in case if Node name is empty
0101     bool ReadSkipLateDataLoading = false; //!< Flag to skip triangulation loading
0102     bool ReadKeepLateData = true;//!< Flag to keep information about deferred storage to load/unload triangulation later
0103     bool ReadPrintDebugMessages = false; //!< Flag to print additional debug information
0104     // Writing
0105     TCollection_AsciiString WriteComment; //!< Export special comment
0106     TCollection_AsciiString WriteAuthor; //!< Author of exported file name
0107     RWGltf_WriterTrsfFormat WriteTrsfFormat = RWGltf_WriterTrsfFormat_Compact; //!< Transformation format to write into glTF file
0108     RWMesh_NameFormat WriteNodeNameFormat = RWMesh_NameFormat_InstanceOrProduct; //!< Name format for exporting Nodes
0109     RWMesh_NameFormat WriteMeshNameFormat = RWMesh_NameFormat_Product; //!< Name format for exporting Meshes
0110     bool WriteForcedUVExport = false; //!< Export UV coordinates even if there are no mapped texture
0111     bool WriteEmbedTexturesInGlb = true; //!< Flag to write image textures into GLB file
0112     bool WriteMergeFaces = false; //!< Flag to merge faces within a single part
0113     bool WriteSplitIndices16 = false; //!< Flag to prefer keeping 16-bit indexes while merging face
0114     // clang-format on
0115   } InternalParameters;
0116 };
0117 
0118 #endif // _DEGLTF_ConfigurationNode_HeaderFile