42cf5bc1 |
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> |
b47bcd7e |
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> |
42cf5bc1 |
30 | #include <Standard_Boolean.hxx> |
e8862cf4 |
31 | |
b47bcd7e |
32 | #include <NCollection_DataMap.hxx> |
33 | #include <TopoDS_Shape.hxx> |
34 | #include <TopTools_ShapeMapHasher.hxx> |
35 | #include <TopLoc_Location.hxx> |
7e785937 |
36 | #include <Message_ProgressRange.hxx> |
e8862cf4 |
37 | |
42cf5bc1 |
38 | class Standard_NullObject; |
39 | class Standard_NoSuchObject; |
40 | class TopoDS_Shape; |
41 | class BRepTools_Modification; |
b47bcd7e |
42 | class Geom_Curve; |
43 | class Geom_Surface; |
42cf5bc1 |
44 | |
45 | //! Performs geometric modifications on a shape. |
46 | class BRepTools_Modifier |
47 | { |
48 | public: |
49 | |
50 | DEFINE_STANDARD_ALLOC |
42cf5bc1 |
51 | |
52 | //! Creates an empty Modifier. |
b47bcd7e |
53 | Standard_EXPORT BRepTools_Modifier(Standard_Boolean theMutableInput = Standard_False); |
42cf5bc1 |
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>. |
7e785937 |
66 | Standard_EXPORT void Perform (const Handle(BRepTools_Modification)& M, |
67 | const Message_ProgressRange& theProgress = Message_ProgressRange()); |
42cf5bc1 |
68 | |
69 | //! Returns Standard_True if the modification has |
70 | //! been computed successfully. |
b47bcd7e |
71 | Standard_Boolean IsDone() const; |
42cf5bc1 |
72 | |
b47bcd7e |
73 | //! Returns the current mutable input state |
74 | Standard_EXPORT Standard_Boolean IsMutableInput() const; |
42cf5bc1 |
75 | |
b47bcd7e |
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); |
42cf5bc1 |
80 | |
b47bcd7e |
81 | //! Returns the modified shape corresponding to <S>. |
82 | const TopoDS_Shape& ModifiedShape (const TopoDS_Shape& S) const; |
83 | |
42cf5bc1 |
84 | |
85 | protected: |
b47bcd7e |
86 | |
42cf5bc1 |
87 | |
88 | |
89 | private: |
90 | |
b47bcd7e |
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 | |
42cf5bc1 |
107 | Standard_EXPORT void Put (const TopoDS_Shape& S); |
108 | |
b47bcd7e |
109 | Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S, |
110 | const Handle(BRepTools_Modification)& M, |
111 | Standard_Boolean& theNewGeom, |
7e785937 |
112 | const Message_ProgressRange& theProgress = Message_ProgressRange()); |
42cf5bc1 |
113 | |
b47bcd7e |
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); |
42cf5bc1 |
128 | |
129 | TopTools_DataMapOfShapeShape myMap; |
130 | TopoDS_Shape myShape; |
131 | Standard_Boolean myDone; |
b47bcd7e |
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; |
42cf5bc1 |
137 | |
138 | }; |
139 | |
140 | |
141 | #include <BRepTools_Modifier.lxx> |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | #endif // _BRepTools_Modifier_HeaderFile |