0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / BRepTools / BRepTools_Modifier.hxx
1 // Created on: 1994-08-25
2 // Created by: Jacques GOUSSARD
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 _BRepTools_Modifier_HeaderFile
18 #define _BRepTools_Modifier_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopTools_DataMapOfShapeShape.hxx>
25 #include <TopTools_MapOfShape.hxx>
26 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
27 #include <TopoDS_Edge.hxx>
28 #include <TopoDS_Face.hxx>
29 #include <TopoDS_Vertex.hxx>
30 #include <Standard_Boolean.hxx>
31
32 #include <NCollection_DataMap.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <TopTools_ShapeMapHasher.hxx>
35 #include <TopLoc_Location.hxx>
36 #include <Message_ProgressRange.hxx>
37
38 class Standard_NullObject;
39 class Standard_NoSuchObject;
40 class TopoDS_Shape;
41 class BRepTools_Modification;
42 class Geom_Curve;
43 class Geom_Surface;
44
45 //! Performs geometric modifications on a shape.
46 class BRepTools_Modifier 
47 {
48 public:
49
50   DEFINE_STANDARD_ALLOC
51   
52   //! Creates an empty Modifier.
53   Standard_EXPORT BRepTools_Modifier(Standard_Boolean theMutableInput = Standard_False);
54   
55   //! Creates a modifier on the shape <S>.
56   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S);
57   
58   //! Creates a modifier on  the shape <S>, and performs
59   //! the modifications described by <M>.
60   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
61   
62   //! Initializes the modifier with the shape <S>.
63   Standard_EXPORT void Init (const TopoDS_Shape& S);
64   
65   //! Performs the modifications described by <M>.
66   Standard_EXPORT void Perform (const Handle(BRepTools_Modification)& M,
67                                 const Message_ProgressRange& theProgress = Message_ProgressRange());
68   
69   //! Returns Standard_True if the modification has
70   //! been computed successfully.
71   Standard_Boolean IsDone() const;
72
73   //! Returns the current mutable input state
74   Standard_EXPORT Standard_Boolean IsMutableInput() const;
75
76   //! Sets the mutable input state
77   //! If true then the input (original) shape can be modified 
78   //! during modification process
79   Standard_EXPORT void SetMutableInput(Standard_Boolean theMutableInput);
80
81   //! Returns the modified shape corresponding to <S>.
82   const TopoDS_Shape& ModifiedShape (const TopoDS_Shape& S) const;
83   
84
85 protected:
86   
87
88
89 private:
90
91   struct NewCurveInfo
92   {
93     Handle(Geom_Curve) myCurve;
94     TopLoc_Location myLoc;
95     Standard_Real myToler;
96   };
97
98   struct NewSurfaceInfo
99   {
100     Handle(Geom_Surface) mySurface;
101     TopLoc_Location myLoc;
102     Standard_Real myToler;
103     Standard_Boolean myRevWires;
104     Standard_Boolean myRevFace;
105   };
106
107   Standard_EXPORT void Put (const TopoDS_Shape& S);
108   
109   Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S,
110                                             const Handle(BRepTools_Modification)& M,
111                                             Standard_Boolean& theNewGeom,
112                                             const Message_ProgressRange& theProgress = Message_ProgressRange());
113
114   Standard_EXPORT void CreateNewVertices(
115     const TopTools_IndexedDataMapOfShapeListOfShape& theMVE, 
116     const Handle(BRepTools_Modification)& M);
117
118   Standard_EXPORT void FillNewCurveInfo(
119     const TopTools_IndexedDataMapOfShapeListOfShape& theMEF, 
120     const Handle(BRepTools_Modification)& M);
121
122   Standard_EXPORT void FillNewSurfaceInfo(const Handle(BRepTools_Modification)& M);
123
124   Standard_EXPORT void CreateOtherVertices(
125     const TopTools_IndexedDataMapOfShapeListOfShape& theMVE, 
126     const TopTools_IndexedDataMapOfShapeListOfShape& theMEF, 
127     const Handle(BRepTools_Modification)& M);
128
129   TopTools_DataMapOfShapeShape myMap;
130   TopoDS_Shape myShape;
131   Standard_Boolean myDone;
132   NCollection_DataMap<TopoDS_Edge, NewCurveInfo, TopTools_ShapeMapHasher> myNCInfo;
133   NCollection_DataMap<TopoDS_Face, NewSurfaceInfo, TopTools_ShapeMapHasher> myNSInfo;
134   TopTools_MapOfShape myNonUpdFace;
135   TopTools_MapOfShape myHasNewGeom;
136   Standard_Boolean myMutableInput;
137
138 };
139
140
141 #include <BRepTools_Modifier.lxx>
142
143
144
145
146
147 #endif // _BRepTools_Modifier_HeaderFile