Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-01-31
0002 // Created by: Dieter THIEMANN
0003 // Copyright (c) 1995-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 _STEPControl_ActorWrite_HeaderFile
0018 #define _STEPControl_ActorWrite_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <STEPConstruct_ContextTool.hxx>
0025 #include <Transfer_ActorOfFinderProcess.hxx>
0026 #include <TopTools_HSequenceOfShape.hxx>
0027 #include <STEPControl_StepModelType.hxx>
0028 class Transfer_Finder;
0029 class Transfer_Binder;
0030 class Transfer_FinderProcess;
0031 class StepData_Factors;
0032 class StepShape_ShapeDefinitionRepresentation;
0033 class StepGeom_Axis2Placement3d;
0034 class TopoDS_Shape;
0035 class StepShape_NonManifoldSurfaceShapeRepresentation;
0036 
0037 
0038 class STEPControl_ActorWrite;
0039 DEFINE_STANDARD_HANDLE(STEPControl_ActorWrite, Transfer_ActorOfFinderProcess)
0040 
0041 //! This class performs the transfer of a Shape from TopoDS
0042 //! to AP203 or AP214 (CD2 or DIS)
0043 class STEPControl_ActorWrite : public Transfer_ActorOfFinderProcess
0044 {
0045 
0046 public:
0047 
0048   
0049   Standard_EXPORT STEPControl_ActorWrite();
0050   
0051   Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Transfer_Finder)& start) Standard_OVERRIDE;
0052   
0053   Standard_EXPORT virtual Handle(Transfer_Binder) Transfer
0054                    (const Handle(Transfer_Finder)& start,
0055                     const Handle(Transfer_FinderProcess)& FP,
0056                     const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
0057   
0058   Standard_EXPORT Handle(Transfer_Binder) TransferSubShape
0059                    (const Handle(Transfer_Finder)& start,
0060                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
0061                     Handle(StepGeom_Axis2Placement3d)& AX1, 
0062                     const Handle(Transfer_FinderProcess)& FP,
0063                     const StepData_Factors& theLocalFactors,
0064                     const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, 
0065                     const Standard_Boolean isManifold = Standard_True,
0066                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0067   
0068   Standard_EXPORT Handle(Transfer_Binder) TransferShape
0069                    (const Handle(Transfer_Finder)& start,
0070                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
0071                     const Handle(Transfer_FinderProcess)& FP,
0072                     const StepData_Factors& theLocalFactors,
0073                     const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL,
0074                     const Standard_Boolean isManifold = Standard_True,
0075                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0076   
0077   Standard_EXPORT Handle(Transfer_Binder) TransferCompound
0078                    (const Handle(Transfer_Finder)& start,
0079                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
0080                     const Handle(Transfer_FinderProcess)& FP,
0081                     const StepData_Factors& theLocalFactors,
0082                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0083   
0084   Standard_EXPORT void SetMode (const STEPControl_StepModelType M);
0085   
0086   Standard_EXPORT STEPControl_StepModelType Mode() const;
0087   
0088   Standard_EXPORT void SetGroupMode (const Standard_Integer mode);
0089   
0090   Standard_EXPORT Standard_Integer GroupMode() const;
0091   
0092   Standard_EXPORT void SetTolerance (const Standard_Real Tol);
0093   
0094   //! Customizable method to check whether shape S should
0095   //! be written as assembly or not
0096   //! Default implementation uses flag GroupMode and analyses
0097   //! the shape itself
0098   //! NOTE: this method can modify shape
0099   Standard_EXPORT virtual Standard_Boolean IsAssembly (const Handle(StepData_StepModel)& theModel,
0100                                                        TopoDS_Shape& S) const;
0101 
0102 
0103 
0104 
0105   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorWrite,Transfer_ActorOfFinderProcess)
0106 
0107 protected:
0108 
0109 
0110 
0111 
0112 private:
0113 
0114   
0115   //! Non-manifold shapes are stored in NMSSR group
0116   //! (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION).
0117   //! Use this method to get the corresponding NMSSR (or
0118   //! to create a new one if doesn't exist yet)
0119   //! (ssv; 13.11.2010)
0120   Standard_EXPORT Handle(StepShape_NonManifoldSurfaceShapeRepresentation) getNMSSRForGroup (const Handle(TopTools_HSequenceOfShape)& shapeGroup, const Handle(Transfer_FinderProcess)& FP, Standard_Boolean& isNMSSRCreated) const;
0121   
0122   //! bind already written shared faces to STEP entity for non-manifold
0123   Standard_EXPORT void mergeInfoForNM(const Handle(Transfer_FinderProcess)& theFP, const Handle(Standard_Transient) &theInfo) const;
0124 
0125   //! Gets sequence of vertices of all compounds level by recursive
0126   //! @param[in] theShape shape to iterate, checked for compound type and sub shapes vertex type
0127   //! @param[out] theVertices sequence of found vertices via recursively iterate of shape
0128   //! @return TRUE if one or more vertex was found and all shapes were compound or vertex
0129   Standard_Boolean separateShapeToSoloVertex(const TopoDS_Shape& theShape,
0130                                              TopTools_SequenceOfShape& theVertices);
0131 
0132 
0133 
0134   Standard_Integer mygroup;
0135   Standard_Real mytoler;
0136   STEPConstruct_ContextTool myContext;
0137 
0138 
0139 };
0140 
0141 
0142 
0143 
0144 
0145 
0146 
0147 #endif // _STEPControl_ActorWrite_HeaderFile