0025748: Parallel version of progress indicator
[occt.git] / src / STEPControl / STEPControl_ActorWrite.hxx
1 // Created on: 1995-01-31
2 // Created by: Dieter THIEMANN
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _STEPControl_ActorWrite_HeaderFile
18 #define _STEPControl_ActorWrite_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <Standard_Real.hxx>
25 #include <STEPConstruct_ContextTool.hxx>
26 #include <Transfer_ActorOfFinderProcess.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <TopTools_HSequenceOfShape.hxx>
29 #include <STEPControl_StepModelType.hxx>
30 class Transfer_Finder;
31 class Transfer_Binder;
32 class Transfer_FinderProcess;
33 class StepShape_ShapeDefinitionRepresentation;
34 class StepGeom_Axis2Placement3d;
35 class TopoDS_Shape;
36 class StepShape_NonManifoldSurfaceShapeRepresentation;
37
38
39 class STEPControl_ActorWrite;
40 DEFINE_STANDARD_HANDLE(STEPControl_ActorWrite, Transfer_ActorOfFinderProcess)
41
42 //! This class performs the transfer of a Shape from TopoDS
43 //! to AP203 or AP214 (CD2 or DIS)
44 class STEPControl_ActorWrite : public Transfer_ActorOfFinderProcess
45 {
46
47 public:
48
49   
50   Standard_EXPORT STEPControl_ActorWrite();
51   
52   Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Transfer_Finder)& start) Standard_OVERRIDE;
53   
54   Standard_EXPORT virtual Handle(Transfer_Binder) Transfer
55                    (const Handle(Transfer_Finder)& start,
56                     const Handle(Transfer_FinderProcess)& FP,
57                     const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
58   
59   Standard_EXPORT Handle(Transfer_Binder) TransferSubShape
60                    (const Handle(Transfer_Finder)& start,
61                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
62                     Handle(StepGeom_Axis2Placement3d)& AX1, 
63                     const Handle(Transfer_FinderProcess)& FP,
64                     const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, 
65                     const Standard_Boolean isManifold = Standard_True,
66                     const Message_ProgressRange& theProgress = Message_ProgressRange());
67   
68   Standard_EXPORT Handle(Transfer_Binder) TransferShape
69                    (const Handle(Transfer_Finder)& start,
70                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
71                     const Handle(Transfer_FinderProcess)& FP,
72                     const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL,
73                     const Standard_Boolean isManifold = Standard_True,
74                     const Message_ProgressRange& theProgress = Message_ProgressRange());
75   
76   Standard_EXPORT Handle(Transfer_Binder) TransferCompound
77                    (const Handle(Transfer_Finder)& start,
78                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
79                     const Handle(Transfer_FinderProcess)& FP,
80                     const Message_ProgressRange& theProgress = Message_ProgressRange());
81   
82   Standard_EXPORT void SetMode (const STEPControl_StepModelType M);
83   
84   Standard_EXPORT STEPControl_StepModelType Mode() const;
85   
86   Standard_EXPORT void SetGroupMode (const Standard_Integer mode);
87   
88   Standard_EXPORT Standard_Integer GroupMode() const;
89   
90   Standard_EXPORT void SetTolerance (const Standard_Real Tol);
91   
92   //! Customizable method to check whether shape S should
93   //! be written as assembly or not
94   //! Default implementation uses flag GroupMode and analyses
95   //! the shape itself
96   //! NOTE: this method can modify shape
97   Standard_EXPORT virtual Standard_Boolean IsAssembly (TopoDS_Shape& S) const;
98
99
100
101
102   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorWrite,Transfer_ActorOfFinderProcess)
103
104 protected:
105
106
107
108
109 private:
110
111   
112   //! Non-manifold shapes are stored in NMSSR group
113   //! (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION).
114   //! Use this method to get the corresponding NMSSR (or
115   //! to create a new one if doesn't exist yet)
116   //! (ssv; 13.11.2010)
117   Standard_EXPORT Handle(StepShape_NonManifoldSurfaceShapeRepresentation) getNMSSRForGroup (const Handle(TopTools_HSequenceOfShape)& shapeGroup, const Handle(Transfer_FinderProcess)& FP, Standard_Boolean& isNMSSRCreated) const;
118   
119   //! bind already written shared faces to STEP entity for non-manifold
120   Standard_EXPORT void mergeInfoForNM(const Handle(Transfer_FinderProcess)& theFP, const Handle(Standard_Transient) &theInfo) const;
121
122   Standard_Integer mygroup;
123   Standard_Real mytoler;
124   STEPConstruct_ContextTool myContext;
125
126
127 };
128
129
130
131
132
133
134
135 #endif // _STEPControl_ActorWrite_HeaderFile