Back to home page

EIC code displayed by LXR

 
 

    


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

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 _IGESCAFControl_ConfigurationNode_HeaderFile
0015 #define _IGESCAFControl_ConfigurationNode_HeaderFile
0016 
0017 #include <DE_ConfigurationNode.hxx>
0018 #include <UnitsMethods_LengthUnit.hxx>
0019 
0020 //! The purpose of this class is to configure the transfer process for IGES format
0021 //! Stores the necessary settings for IGESCAFControl_Provider.
0022 //! Configures and creates special provider to transfer IGES files.
0023 //!
0024 //! Nodes grouped by Vendor name and Format type.
0025 //! The Vendor name is "OCC"
0026 //! The Format type is "IGES"
0027 //! The supported CAD extensions are ".igs", ".iges"
0028 //! The import process is supported.
0029 //! The export process is supported.
0030 class IGESCAFControl_ConfigurationNode : public DE_ConfigurationNode
0031 {
0032   DEFINE_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ConfigurationNode)
0033 public:
0034 
0035   //! Initializes all fields by default
0036   Standard_EXPORT IGESCAFControl_ConfigurationNode();
0037 
0038   //! Copies values of all fields
0039   //! @param[in] theNode object to copy
0040   Standard_EXPORT IGESCAFControl_ConfigurationNode(const Handle(IGESCAFControl_ConfigurationNode)& theNode);
0041 
0042   //! Updates values according the resource
0043   //! @param[in] theResource input resource to use
0044   //! @return true if theResource loading has ended correctly
0045   Standard_EXPORT virtual bool Load(const Handle(DE_ConfigurationContext)& theResource) Standard_OVERRIDE;
0046 
0047   //! Writes configuration to the string
0048   //! @return result resource string
0049   Standard_EXPORT virtual TCollection_AsciiString Save() const Standard_OVERRIDE;
0050 
0051   //! Copies values of all fields
0052   //! @return new object with the same field values
0053   Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const Standard_OVERRIDE;
0054 
0055 
0056   //! Creates new provider for the own format
0057   //! @return new created provider
0058   Standard_EXPORT virtual Handle(DE_Provider) BuildProvider() Standard_OVERRIDE;
0059 
0060 public:
0061 
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   //! Checks the file content to verify a format
0083   //! @param[in] theBuffer read stream buffer to check content
0084   //! @return Standard_True if file is supported by a current provider
0085   Standard_EXPORT virtual bool CheckContent(const Handle(NCollection_Buffer)& theBuffer) const Standard_OVERRIDE;
0086 
0087 public:
0088 
0089   enum ReadMode_BSplineContinuity
0090   {
0091     ReadMode_BSplineContinuity_C0 = 0,
0092     ReadMode_BSplineContinuity_C1,
0093     ReadMode_BSplineContinuity_C2
0094   };
0095   enum ReadMode_Precision
0096   {
0097     ReadMode_Precision_File = 0,
0098     ReadMode_Precision_User
0099   };
0100   enum ReadMode_MaxPrecision
0101   {
0102     ReadMode_MaxPrecision_Preferred = 0,
0103     ReadMode_MaxPrecision_Forced
0104   };
0105   enum ReadMode_SurfaceCurve
0106   {
0107     ReadMode_SurfaceCurve_Default = 0,
0108     ReadMode_SurfaceCurve_2DUse_Preferred = 2,
0109     ReadMode_SurfaceCurve_2DUse_Forced = -2,
0110     ReadMode_SurfaceCurve_3DUse_Preferred = 3,
0111     ReadMode_SurfaceCurve_3DUse_Forced = -3
0112   };
0113   enum WriteMode_BRep
0114   {
0115     WriteMode_BRep_Faces = 0,
0116     WriteMode_BRep_BRep
0117   };
0118   enum WriteMode_ConvertSurface
0119   {
0120     WriteMode_ConvertSurface_Off = 0,
0121     WriteMode_ConvertSurface_On
0122   };
0123   enum WriteMode_PrecisionMode
0124   {
0125     WriteMode_PrecisionMode_Least = -1,
0126     WriteMode_PrecisionMode_Average = 0,
0127     WriteMode_PrecisionMode_Greatest = 1,
0128     WriteMode_PrecisionMode_Session = 2
0129   };
0130   enum WriteMode_PlaneMode
0131   {
0132     WriteMode_PlaneMode_Plane = 0,
0133     WriteMode_PlaneMode_BSpline
0134   };
0135   struct IGESCAFControl_InternalSection
0136   {
0137     // Common
0138     ReadMode_BSplineContinuity ReadBSplineContinuity = ReadMode_BSplineContinuity_C1; //<! Manages the continuity of BSpline curves
0139     ReadMode_Precision ReadPrecisionMode = ReadMode_Precision_File; //<! Reads the precision mode value
0140     double ReadPrecisionVal = 0.0001; //<! ReadMode_Precision for shape construction (if enabled user mode)
0141     ReadMode_MaxPrecision ReadMaxPrecisionMode = ReadMode_MaxPrecision_Preferred; //<! Defines the mode of applying the maximum allowed tolerance
0142     double ReadMaxPrecisionVal = 1; //<! Defines the maximum allowable tolerance
0143     bool ReadSameParamMode = false; //<! Defines the using of BRepLib::SameParameter
0144     ReadMode_SurfaceCurve ReadSurfaceCurveMode = ReadMode_SurfaceCurve_Default; //<! reference for the computation of curves in case of 2D/3D
0145     double EncodeRegAngle = 0.57295779513; //<! Continuity which these two faces are connected with at that edge
0146 
0147     //Read
0148     bool ReadApproxd1 = false; //<! Flag to split bspline curves of degree 1
0149     TCollection_AsciiString ReadResourceName = "IGES"; //<! Defines the name of the resource file to read
0150     TCollection_AsciiString ReadSequence = "FromIGES"; //<! Defines the name of the sequence of operators to read
0151     bool ReadFaultyEntities = false; //<! Parameter for reading failed entities
0152     bool ReadOnlyVisible = false; //<! Parameter for reading invisible entities
0153     bool ReadColor = true; //<! ColorMode is used to indicate read Colors or not
0154     bool ReadName = true; //<! NameMode is used to indicate read Name or not
0155     bool ReadLayer = true; //<! LayerMode is used to indicate read Layers or not
0156 
0157     // Write
0158     WriteMode_BRep WriteBRepMode = WriteMode_BRep_Faces; //<! Flag to define entities type to write
0159     WriteMode_ConvertSurface WriteConvertSurfaceMode = WriteMode_ConvertSurface_Off; //<! Flag to convert surface to elementary
0160     UnitsMethods_LengthUnit WriteUnit = UnitsMethods_LengthUnit_Millimeter; //<! Define unit to write IGES file
0161     TCollection_AsciiString WriteHeaderAuthor; //<! Name of the author of the file
0162     TCollection_AsciiString WriteHeaderCompany; //<! Name of the sending company
0163     TCollection_AsciiString WriteHeaderProduct; //<! Name of the sending product
0164     TCollection_AsciiString WriteHeaderReciever; //<! Name of the receiving company
0165     TCollection_AsciiString WriteResourceName = "IGES"; //<! Defines the name of the resource file to write
0166     TCollection_AsciiString WriteSequence = "ToIGES"; //<! Defines the name of the sequence of operators to write
0167     WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the IGES file
0168     double WritePrecisionVal = 0.0001; //<! Resolution value for an IGES file when WriteMode_PrecisionMode is Greatest
0169     WriteMode_PlaneMode WritePlaneMode = WriteMode_PlaneMode_Plane; //<! Flag to convert plane to the BSline
0170     bool WriteOffsetMode = false; //<! Writing offset curves like BSplines
0171     bool WriteColor = true; //<! ColorMode is used to indicate write Colors or not
0172     bool WriteName = true; //<! NameMode is used to indicate write Name or not
0173     bool WriteLayer = true; //<! LayerMode is used to indicate write Layers or not
0174   } InternalParameters;
0175 
0176 };
0177 
0178 #endif // _IGESCAFControl_ConfigurationNode_HeaderFile