Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/STEPControl_ActorWrite.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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