Warnings on vc14 were eliminated
[occt.git] / src / STEPControl / STEPControl_ActorRead.hxx
1 // Created on: 1994-12-21
2 // Created by: Dieter THIEMANN
3 // Copyright (c) 1994-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_ActorRead_HeaderFile
18 #define _STEPControl_ActorRead_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <StepToTopoDS_NMTool.hxx>
24 #include <Standard_Real.hxx>
25 #include <Transfer_ActorOfTransientProcess.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
30 class StepRepr_Representation;
31 class Standard_Transient;
32 class Transfer_Binder;
33 class Transfer_TransientProcess;
34 class StepGeom_Axis2Placement3d;
35 class gp_Trsf;
36 class StepRepr_RepresentationRelationship;
37 class TransferBRep_ShapeBinder;
38 class StepBasic_ProductDefinition;
39 class StepRepr_NextAssemblyUsageOccurrence;
40 class StepShape_ShapeRepresentation;
41 class StepShape_ContextDependentShapeRepresentation;
42 class StepRepr_ShapeRepresentationRelationship;
43 class StepGeom_GeometricRepresentationItem;
44 class StepRepr_MappedItem;
45 class StepShape_FaceSurface;
46 class TopoDS_Shell;
47 class TopoDS_Compound;
48
49
50 class STEPControl_ActorRead;
51 DEFINE_STANDARD_HANDLE(STEPControl_ActorRead, Transfer_ActorOfTransientProcess)
52
53 //! This class performs the transfer of an Entity from
54 //! AP214 and AP203, either Geometric or Topologic.
55 //!
56 //! I.E. for each type of Entity, it invokes the appropriate Tool
57 //! then returns the Binder which contains the Result
58 class STEPControl_ActorRead : public Transfer_ActorOfTransientProcess
59 {
60
61 public:
62
63   
64   Standard_EXPORT STEPControl_ActorRead();
65   
66   Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE;
67   
68   Standard_EXPORT virtual Handle(Transfer_Binder) Transfer (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP) Standard_OVERRIDE;
69   
70   Standard_EXPORT Handle(Transfer_Binder) TransferShape (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP, const Standard_Boolean isManifold = Standard_True);
71   
72   //! set units and tolerances context by given ShapeRepresentation
73   Standard_EXPORT void PrepareUnits (const Handle(StepRepr_Representation)& rep, const Handle(Transfer_TransientProcess)& TP);
74   
75   //! reset units and tolerances context to default
76   //! (mm, radians, read.precision.val, etc.)
77   Standard_EXPORT void ResetUnits();
78   
79   //! Computes transformation defined by two axis placements (in MAPPED_ITEM
80   //! or ITEM_DEFINED_TRANSFORMATION) taking into account their
81   //! representation contexts (i.e. units, which may be different)
82   //! Returns True if transformation is computed and is not an identity.
83   Standard_EXPORT Standard_Boolean ComputeTransformation (const Handle(StepGeom_Axis2Placement3d)& Origin, const Handle(StepGeom_Axis2Placement3d)& Target, const Handle(StepRepr_Representation)& OrigContext, const Handle(StepRepr_Representation)& TargContext, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
84   
85   //! Computes transformation defined by given
86   //! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
87   Standard_EXPORT Standard_Boolean ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship)& SRR, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
88
89
90
91
92   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
93
94 protected:
95
96   
97   //! Transfers product definition entity
98   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepBasic_ProductDefinition)& PD, const Handle(Transfer_TransientProcess)& TP);
99   
100   //! Transfers next assembly usage occurence entity
101   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO, const Handle(Transfer_TransientProcess)& TP);
102   
103   //! Transfers shape representation entity
104   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepShape_ShapeRepresentation)& sr, const Handle(Transfer_TransientProcess)& TP, Standard_Boolean& isBound);
105   
106   //! Transfers context dependent shape representation entity
107   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR, const Handle(Transfer_TransientProcess)& TP);
108   
109   //! Transfers  shape representation relationship entity
110   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepRepr_ShapeRepresentationRelationship)& und, const Handle(Transfer_TransientProcess)& TP, const Standard_Integer nbrep = 0);
111   
112   //! Transfers  geometric representation item entity such as ManifoldSolidBRep ,...etc
113   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepGeom_GeometricRepresentationItem)& git, const Handle(Transfer_TransientProcess)& TP, const Standard_Boolean isManifold);
114   
115   //! Transfers  mapped item
116   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepRepr_MappedItem)& mapit, const Handle(Transfer_TransientProcess)& TP);
117   
118   //! Transfers  FaceSurface entity
119   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (const Handle(StepShape_FaceSurface)& fs, const Handle(Transfer_TransientProcess)& TP);
120   
121   //! Tranlates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
122   Standard_EXPORT Handle(TransferBRep_ShapeBinder) OldWay (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP);
123
124
125
126 private:
127
128   
129   Standard_EXPORT TopoDS_Shell closeIDEASShell (const TopoDS_Shell& shell, const TopTools_ListOfShape& closingShells);
130   
131   Standard_EXPORT void computeIDEASClosings (const TopoDS_Compound& comp, TopTools_IndexedDataMapOfShapeListOfShape& shellClosingMap);
132
133   StepToTopoDS_NMTool myNMTool;
134   Standard_Real myPrecision;
135   Standard_Real myMaxTol;
136   Handle(StepRepr_Representation) mySRContext;
137
138
139 };
140
141
142
143
144
145
146
147 #endif // _STEPControl_ActorRead_HeaderFile