Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:05

0001 // Copyright (c) 2023 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 _StepData_ConfParameters_HeaderFile
0015 #define _StepData_ConfParameters_HeaderFile
0016 
0017 #include <Resource_FormatType.hxx>
0018 #include <STEPControl_StepModelType.hxx>
0019 #include <TCollection_AsciiString.hxx>
0020 #include <UnitsMethods_LengthUnit.hxx>
0021 
0022 class StepData_ConfParameters
0023 {
0024 
0025 public:
0026 
0027   enum ReadMode_BSplineContinuity
0028   {
0029     ReadMode_BSplineContinuity_C0 = 0,
0030     ReadMode_BSplineContinuity_C1,
0031     ReadMode_BSplineContinuity_C2
0032   };
0033   enum ReadMode_Precision
0034   {
0035     ReadMode_Precision_File = 0,
0036     ReadMode_Precision_User
0037   };
0038   enum ReadMode_MaxPrecision
0039   {
0040     ReadMode_MaxPrecision_Preferred = 0,
0041     ReadMode_MaxPrecision_Forced
0042   };
0043   enum ReadMode_SurfaceCurve
0044   {
0045     ReadMode_SurfaceCurve_Default = 0,
0046     ReadMode_SurfaceCurve_2DUse_Preferred = 2,
0047     ReadMode_SurfaceCurve_2DUse_Forced = -2,
0048     ReadMode_SurfaceCurve_3DUse_Preferred = 3,
0049     ReadMode_SurfaceCurve_3DUse_Forced = -3
0050   };
0051   enum AngleUnitMode
0052   {
0053     AngleUnitMode_File = 0,
0054     AngleUnitMode_Rad,
0055     AngleUnitMode_Deg
0056   };
0057   enum ReadMode_ProductContext
0058   {
0059     ReadMode_ProductContext_All = 1,
0060     ReadMode_ProductContext_Design,
0061     ReadMode_ProductContext_Analysis
0062   };
0063   enum ReadMode_ShapeRepr
0064   {
0065     ReadMode_ShapeRepr_All = 1,
0066     ReadMode_ShapeRepr_ABSR,
0067     ReadMode_ShapeRepr_MSSR,
0068     ReadMode_ShapeRepr_GBSSR,
0069     ReadMode_ShapeRepr_FBSR,
0070     ReadMode_ShapeRepr_EBWSR,
0071     ReadMode_ShapeRepr_GBWSR
0072   };
0073   enum ReadMode_AssemblyLevel
0074   {
0075     ReadMode_AssemblyLevel_All = 1,
0076     ReadMode_AssemblyLevel_Assembly,
0077     ReadMode_AssemblyLevel_Structure,
0078     ReadMode_AssemblyLevel_Shape
0079   };
0080   enum RWMode_Tessellated
0081   {
0082     RWMode_Tessellated_Off = 0,
0083     RWMode_Tessellated_On,
0084     RWMode_Tessellated_OnNoBRep
0085   };
0086   enum WriteMode_PrecisionMode
0087   {
0088     WriteMode_PrecisionMode_Least = -1,
0089     WriteMode_PrecisionMode_Average = 0,
0090     WriteMode_PrecisionMode_Greatest = 1,
0091     WriteMode_PrecisionMode_Session = 2
0092   };
0093   enum WriteMode_Assembly
0094   {
0095     WriteMode_Assembly_Off = 0,
0096     WriteMode_Assembly_On,
0097     WriteMode_Assembly_Auto
0098   };
0099   enum WriteMode_StepSchema
0100   {
0101     WriteMode_StepSchema_AP214CD = 1,
0102     WriteMode_StepSchema_AP214DIS,
0103     WriteMode_StepSchema_AP203,
0104     WriteMode_StepSchema_AP214IS,
0105     WriteMode_StepSchema_AP242DIS
0106   };
0107   enum WriteMode_VertexMode
0108   {
0109     WriteMode_VertexMode_OneCompound = 0,
0110     WriteMode_VertexMode_SingleVertex
0111   };
0112 
0113   Standard_EXPORT StepData_ConfParameters();
0114 
0115   //! Initialize parameters
0116   Standard_EXPORT void InitFromStatic();
0117 
0118   //! Reset used parameters
0119   Standard_EXPORT void Reset();
0120 
0121   Standard_EXPORT TCollection_AsciiString GetString(const ReadMode_ProductContext theMode)
0122   {
0123     switch (theMode)
0124     {
0125     case ReadMode_ProductContext_All:
0126       return "all";
0127     case ReadMode_ProductContext_Design:
0128       return "design";
0129     case ReadMode_ProductContext_Analysis:
0130       return "analysis";
0131     default:
0132       return "";
0133     }
0134   }
0135 
0136 public:
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   AngleUnitMode AngleUnit = AngleUnitMode_File; //<! Indicates what angle units should be used when a STEP file is read
0147 
0148   // Read
0149   TCollection_AsciiString ReadResourceName = "STEP"; //<! Defines the name of the resource file to read
0150   TCollection_AsciiString ReadSequence = "FromSTEP"; //<! Defines the name of the sequence of operators to read
0151   bool ReadProductMode = true; //<! Defines the approach used for selection of top-level STEP entities for translation, and for recognition of assembly structures
0152   ReadMode_ProductContext ReadProductContext = ReadMode_ProductContext_All; //<! When reading AP 209 STEP files, allows selecting either only 'design' or 'analysis', or both types of products for translation
0153   ReadMode_ShapeRepr ReadShapeRepr = ReadMode_ShapeRepr_All; //<! Specifies preferred type of representation of the shape of the product
0154   RWMode_Tessellated ReadTessellated = RWMode_Tessellated_On; //!< Defines whether tessellated shapes should be translated
0155   ReadMode_AssemblyLevel ReadAssemblyLevel = ReadMode_AssemblyLevel_All; //<! Specifies which data should be read for the products found in the STEP file
0156   bool ReadRelationship = true; //<! Defines whether shapes associated with the main SHAPE_DEFINITION_REPRESENTATION entity of the product via SHAPE_REPRESENTATIONSHIP_RELATION should be translated
0157   bool ReadShapeAspect = true; //<! Defines whether shapes associated with the PRODUCT_DEFINITION_SHAPE entity of the product via SHAPE_ASPECT should be translated
0158   bool ReadConstrRelation = false; //<! Flag regulating translation of "CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP" entities
0159   bool ReadSubshapeNames = false; //<! Indicates whether to read sub-shape names from 'Name' attributes of STEP Representation Items
0160   Resource_FormatType ReadCodePage = Resource_FormatType_UTF8; //<! STEP file encoding for names translation
0161   bool ReadNonmanifold = false; //<! Defines non-manifold topology reading
0162   bool ReadIdeas = false; //<! Defines !I-Deas-like STEP processing
0163   bool ReadAllShapes = false; //<! Parameter to read all top level solids and shells
0164   bool ReadRootTransformation = true; ///<!/ Mode to variate apply or not transformation placed in the root shape representation
0165   bool ReadColor = true; //<! ColorMode is used to indicate read Colors or not
0166   bool ReadName = true; //<! NameMode is used to indicate read Name or not
0167   bool ReadLayer = true; //<! LayerMode is used to indicate read Layers or not
0168   bool ReadProps = true; //<! PropsMode is used to indicate read Validation properties or not
0169   
0170   // Write
0171   WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the STEP file
0172   double WritePrecisionVal = 0.0001; //<! Resolution value for an STEP file when WriteMode_PrecisionMode is Greatest
0173   WriteMode_Assembly WriteAssembly = WriteMode_Assembly_Off; //<! Writing assembly mode
0174   WriteMode_StepSchema WriteSchema = WriteMode_StepSchema_AP214CD; //<! Defines the version of schema used for the output STEP file
0175   RWMode_Tessellated WriteTessellated = RWMode_Tessellated_OnNoBRep; //!< Defines whether tessellated shapes should be translated
0176   TCollection_AsciiString WriteProductName; //<! Defines the text string that will be used for field 'name' of PRODUCT entities written to the STEP file
0177   bool WriteSurfaceCurMode = true; //<! Indicates whether parametric curves (curves in parametric space of surface) should be written into the STEP file
0178   UnitsMethods_LengthUnit WriteUnit = UnitsMethods_LengthUnit_Millimeter; //<! Defines a unit in which the STEP file should be written
0179   TCollection_AsciiString WriteResourceName = "STEP"; //<! Defines the name of the resource file to write
0180   TCollection_AsciiString WriteSequence = "ToSTEP"; //<! Defines the name of the sequence of operators to write
0181   WriteMode_VertexMode WriteVertexMode = WriteMode_VertexMode_OneCompound; //<! Indicates which of free vertices writing mode is switch on
0182   bool WriteSubshapeNames = false; //<! Indicates whether to write sub-shape names to 'Name' attributes of STEP Representation Items
0183   bool WriteColor = true; //<! ColorMode is used to indicate write Colors or not
0184   bool WriteNonmanifold = false; //<! Defines non-manifold topology writting
0185   bool WriteName = true; //<! NameMode is used to indicate write Name or not
0186   bool WriteLayer = true; //<! LayerMode is used to indicate write Layers or not
0187   bool WriteProps = true; //<! PropsMode is used to indicate write Validation properties or not
0188   STEPControl_StepModelType WriteModelType = STEPControl_AsIs; //<! Gives you the choice of translation mode for an Open CASCADE shape that is being translated to STEP
0189 };
0190 
0191 #endif // _StepData_ConfParameters_HeaderFile