Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:18:45

0001 // Created on: 1993-09-14
0002 // Created by: Frederic MAUPAS
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _STEPConstruct_ContextTool_HeaderFile
0018 #define _STEPConstruct_ContextTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <STEPConstruct_AP203Context.hxx>
0027 #include <StepData_Factors.hxx>
0028 #include <StepData_StepModel.hxx>
0029 #include <Standard_Transient.hxx>
0030 #include <NCollection_HSequence.hxx>
0031 class StepBasic_ApplicationProtocolDefinition;
0032 class StepGeom_Axis2Placement3d;
0033 class TCollection_HAsciiString;
0034 class STEPConstruct_Part;
0035 class STEPConstruct_Assembly;
0036 
0037 //! Maintains global context tool for writing.
0038 //! Gives access to Product Definition Context (one per Model)
0039 //! Maintains ApplicationProtocolDefinition entity (common for all
0040 //! products)
0041 //! Also maintains context specific for AP203 and provides set of
0042 //! methods to work with various STEP constructs as required
0043 //! by Actor
0044 class STEPConstruct_ContextTool
0045 {
0046 public:
0047   DEFINE_STANDARD_ALLOC
0048 
0049   Standard_EXPORT STEPConstruct_ContextTool();
0050 
0051   Standard_EXPORT STEPConstruct_ContextTool(const occ::handle<StepData_StepModel>& aStepModel);
0052 
0053   //! Initialize ApplicationProtocolDefinition by the first
0054   //! entity of that type found in the model
0055   Standard_EXPORT void SetModel(const occ::handle<StepData_StepModel>& aStepModel);
0056 
0057   Standard_EXPORT void SetGlobalFactor(const StepData_Factors& theGlobalFactor);
0058 
0059   Standard_EXPORT occ::handle<StepBasic_ApplicationProtocolDefinition> GetAPD();
0060 
0061   Standard_EXPORT void AddAPD(const bool enforce = false);
0062 
0063   //! Returns True if APD.schema_name is config_control_design
0064   Standard_EXPORT bool IsAP203() const;
0065 
0066   //! Returns True if APD.schema_name is automotive_design
0067   Standard_EXPORT bool IsAP214() const;
0068 
0069   //! Returns True if APD.schema_name is ap242_managed_model_based_3d_engineering
0070   Standard_EXPORT bool IsAP242() const;
0071 
0072   Standard_EXPORT occ::handle<TCollection_HAsciiString> GetACstatus();
0073 
0074   Standard_EXPORT occ::handle<TCollection_HAsciiString> GetACschemaName();
0075 
0076   Standard_EXPORT int GetACyear();
0077 
0078   Standard_EXPORT occ::handle<TCollection_HAsciiString> GetACname();
0079 
0080   Standard_EXPORT void SetACstatus(const occ::handle<TCollection_HAsciiString>& status);
0081 
0082   Standard_EXPORT void SetACschemaName(const occ::handle<TCollection_HAsciiString>& schemaName);
0083 
0084   Standard_EXPORT void SetACyear(const int year);
0085 
0086   Standard_EXPORT void SetACname(const occ::handle<TCollection_HAsciiString>& name);
0087 
0088   //! Returns a default axis placement
0089   Standard_EXPORT occ::handle<StepGeom_Axis2Placement3d> GetDefaultAxis();
0090 
0091   //! Returns tool which maintains context specific for AP203
0092   Standard_EXPORT STEPConstruct_AP203Context& AP203Context();
0093 
0094   //! Returns current assembly level
0095   Standard_EXPORT int Level() const;
0096 
0097   Standard_EXPORT void NextLevel();
0098 
0099   Standard_EXPORT void PrevLevel();
0100 
0101   //! Changes current assembly level
0102   Standard_EXPORT void SetLevel(const int lev);
0103 
0104   //! Returns current index of assembly component on current level
0105   Standard_EXPORT int Index() const;
0106 
0107   Standard_EXPORT void NextIndex();
0108 
0109   Standard_EXPORT void PrevIndex();
0110 
0111   //! Changes current index of assembly component on current level
0112   Standard_EXPORT void SetIndex(const int ind);
0113 
0114   //! Generates a product name basing on write.step.product.name
0115   //! parameter and current position in the assembly structure
0116   Standard_EXPORT occ::handle<TCollection_HAsciiString> GetProductName() const;
0117 
0118   //! Produces and returns a full list of root entities required
0119   //! for part identified by SDRTool (including SDR itself)
0120   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>
0121                   GetRootsForPart(const STEPConstruct_Part& SDRTool);
0122 
0123   //! Produces and returns a full list of root entities required
0124   //! for assembly link identified by assembly (including NAUO and CDSR)
0125   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>
0126                   GetRootsForAssemblyLink(const STEPConstruct_Assembly& assembly);
0127 
0128 private:
0129   NCollection_Sequence<int>                            myLevel;
0130   occ::handle<StepBasic_ApplicationProtocolDefinition> theAPD;
0131   STEPConstruct_AP203Context                           theAP203;
0132   occ::handle<StepGeom_Axis2Placement3d>               myAxis;
0133   StepData_Factors                                     myGlobalFactor;
0134   DESTEP_Parameters::WriteMode_StepSchema              mySchema;
0135   TCollection_AsciiString                              myProductName;
0136 };
0137 
0138 #endif // _STEPConstruct_ContextTool_HeaderFile