Back to home page

EIC code displayed by LXR

 
 

    


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

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 <TColStd_SequenceOfInteger.hxx>
0025 #include <STEPConstruct_AP203Context.hxx>
0026 #include <StepData_Factors.hxx>
0027 #include <StepData_StepModel.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <TColStd_HSequenceOfTransient.hxx>
0030 class StepBasic_ApplicationProtocolDefinition;
0031 class StepGeom_Axis2Placement3d;
0032 class TCollection_HAsciiString;
0033 class STEPConstruct_Part;
0034 class STEPConstruct_Assembly;
0035 
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 
0048   DEFINE_STANDARD_ALLOC
0049 
0050   
0051   Standard_EXPORT STEPConstruct_ContextTool();
0052   
0053   Standard_EXPORT STEPConstruct_ContextTool(const Handle(StepData_StepModel)& aStepModel);
0054   
0055   //! Initialize ApplicationProtocolDefinition by the first
0056   //! entity of that type found in the model
0057   Standard_EXPORT void SetModel (const Handle(StepData_StepModel)& aStepModel);
0058 
0059   Standard_EXPORT void SetGlobalFactor(const StepData_Factors& theGlobalFactor);
0060   
0061   Standard_EXPORT Handle(StepBasic_ApplicationProtocolDefinition) GetAPD();
0062   
0063   Standard_EXPORT void AddAPD (const Standard_Boolean enforce = Standard_False);
0064   
0065   //! Returns True if APD.schema_name is config_control_design
0066   Standard_EXPORT Standard_Boolean IsAP203() const;
0067   
0068   //! Returns True if APD.schema_name is automotive_design
0069   Standard_EXPORT Standard_Boolean IsAP214() const;
0070 
0071   //! Returns True if APD.schema_name is ap242_managed_model_based_3d_engineering
0072   Standard_EXPORT Standard_Boolean IsAP242() const;
0073   
0074   Standard_EXPORT Handle(TCollection_HAsciiString) GetACstatus();
0075   
0076   Standard_EXPORT Handle(TCollection_HAsciiString) GetACschemaName();
0077   
0078   Standard_EXPORT Standard_Integer GetACyear();
0079   
0080   Standard_EXPORT Handle(TCollection_HAsciiString) GetACname();
0081   
0082   Standard_EXPORT void SetACstatus (const Handle(TCollection_HAsciiString)& status);
0083   
0084   Standard_EXPORT void SetACschemaName (const Handle(TCollection_HAsciiString)& schemaName);
0085   
0086   Standard_EXPORT void SetACyear (const Standard_Integer year);
0087   
0088   Standard_EXPORT void SetACname (const Handle(TCollection_HAsciiString)& name);
0089   
0090   //! Returns a default axis placement
0091   Standard_EXPORT Handle(StepGeom_Axis2Placement3d) GetDefaultAxis();
0092   
0093   //! Returns tool which maintains context specific for AP203
0094   Standard_EXPORT STEPConstruct_AP203Context& AP203Context();
0095   
0096   //! Returns current assembly level
0097   Standard_EXPORT Standard_Integer Level() const;
0098   
0099   Standard_EXPORT void NextLevel();
0100   
0101   Standard_EXPORT void PrevLevel();
0102   
0103   //! Changes current assembly level
0104   Standard_EXPORT void SetLevel (const Standard_Integer lev);
0105   
0106   //! Returns current index of assembly component on current level
0107   Standard_EXPORT Standard_Integer Index() const;
0108   
0109   Standard_EXPORT void NextIndex();
0110   
0111   Standard_EXPORT void PrevIndex();
0112   
0113   //! Changes current index of assembly component on current level
0114   Standard_EXPORT void SetIndex (const Standard_Integer ind);
0115   
0116   //! Generates a product name basing on write.step.product.name
0117   //! parameter and current position in the assembly structure
0118   Standard_EXPORT Handle(TCollection_HAsciiString) GetProductName() const;
0119   
0120   //! Produces and returns a full list of root entities required
0121   //! for part identified by SDRTool (including SDR itself)
0122   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetRootsForPart (const STEPConstruct_Part& SDRTool);
0123   
0124   //! Produces and returns a full list of root entities required
0125   //! for assembly link identified by assembly (including NAUO and CDSR)
0126   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetRootsForAssemblyLink (const STEPConstruct_Assembly& assembly);
0127 
0128 
0129 
0130 
0131 protected:
0132 
0133 
0134 
0135 
0136 
0137 private:
0138 
0139 
0140 
0141   TColStd_SequenceOfInteger myLevel;
0142   Handle(StepBasic_ApplicationProtocolDefinition) theAPD;
0143   STEPConstruct_AP203Context theAP203;
0144   Handle(StepGeom_Axis2Placement3d) myAxis;
0145   StepData_Factors myGlobalFactor;
0146   StepData_ConfParameters::WriteMode_StepSchema mySchema;
0147   TCollection_AsciiString myProductName;
0148 
0149 };
0150 
0151 
0152 
0153 
0154 
0155 
0156 
0157 #endif // _STEPConstruct_ContextTool_HeaderFile