afc1869a9e4b11ba61cda761245950814e83ab8f
[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 (const Handle(Transfer_Finder)& start, const Handle(Transfer_FinderProcess)& FP) Standard_OVERRIDE;
55   
56   Standard_EXPORT Handle(Transfer_Binder) TransferSubShape (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, Handle(StepGeom_Axis2Placement3d)& AX1, const Handle(Transfer_FinderProcess)& FP, const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, const Standard_Boolean isManifold = Standard_True);
57   
58   Standard_EXPORT Handle(Transfer_Binder) TransferShape (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, const Handle(Transfer_FinderProcess)& FP, const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, const Standard_Boolean isManifold = Standard_True);
59   
60   Standard_EXPORT Handle(Transfer_Binder) TransferCompound (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, const Handle(Transfer_FinderProcess)& FP);
61   
62   Standard_EXPORT void SetMode (const STEPControl_StepModelType M);
63   
64   Standard_EXPORT STEPControl_StepModelType Mode() const;
65   
66   Standard_EXPORT void SetGroupMode (const Standard_Integer mode);
67   
68   Standard_EXPORT Standard_Integer GroupMode() const;
69   
70   Standard_EXPORT void SetTolerance (const Standard_Real Tol);
71   
72   //! Customizable method to check whether shape S should
73   //! be written as assembly or not
74   //! Default implementation uses flag GroupMode and analyses
75   //! the shape itself
76   //! NOTE: this method can modify shape
77   Standard_EXPORT virtual Standard_Boolean IsAssembly (TopoDS_Shape& S) const;
78
79
80
81
82   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorWrite,Transfer_ActorOfFinderProcess)
83
84 protected:
85
86
87
88
89 private:
90
91   
92   //! Non-manifold shapes are stored in NMSSR group
93   //! (NON_MANIFOLD_SURFACE_SHAPE_REPRESENTATION).
94   //! Use this method to get the corresponding NMSSR (or
95   //! to create a new one if doesn't exist yet)
96   //! (ssv; 13.11.2010)
97   Standard_EXPORT Handle(StepShape_NonManifoldSurfaceShapeRepresentation) getNMSSRForGroup (const Handle(TopTools_HSequenceOfShape)& shapeGroup, const Handle(Transfer_FinderProcess)& FP, Standard_Boolean& isNMSSRCreated) const;
98   
99   //! bind already written shared faces to STEP entity for non-manifold
100   Standard_EXPORT void mergeInfoForNM(const Handle(Transfer_FinderProcess)& theFP, const Handle(Standard_Transient) &theInfo) const;
101
102   Standard_Integer mygroup;
103   Standard_Real mytoler;
104   STEPConstruct_ContextTool myContext;
105
106
107 };
108
109
110
111
112
113
114
115 #endif // _STEPControl_ActorWrite_HeaderFile