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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepTools_Modifier_HeaderFile
18 #define _BRepTools_Modifier_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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>
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>
38 class Standard_NullObject;
39 class Standard_NoSuchObject;
41 class BRepTools_Modification;
45 //! Performs geometric modifications on a shape.
46 class BRepTools_Modifier
52 //! Creates an empty Modifier.
53 Standard_EXPORT BRepTools_Modifier(Standard_Boolean theMutableInput = Standard_False);
55 //! Creates a modifier on the shape <S>.
56 Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S);
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);
62 //! Initializes the modifier with the shape <S>.
63 Standard_EXPORT void Init (const TopoDS_Shape& S);
65 //! Performs the modifications described by <M>.
66 Standard_EXPORT void Perform (const Handle(BRepTools_Modification)& M,
67 const Message_ProgressRange& theProgress = Message_ProgressRange());
69 //! Returns Standard_True if the modification has
70 //! been computed successfully.
71 Standard_Boolean IsDone() const;
73 //! Returns the current mutable input state
74 Standard_EXPORT Standard_Boolean IsMutableInput() const;
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);
81 //! Returns the modified shape corresponding to <S>.
82 const TopoDS_Shape& ModifiedShape (const TopoDS_Shape& S) const;
93 Handle(Geom_Curve) myCurve;
94 TopLoc_Location myLoc;
95 Standard_Real myToler;
100 Handle(Geom_Surface) mySurface;
101 TopLoc_Location myLoc;
102 Standard_Real myToler;
103 Standard_Boolean myRevWires;
104 Standard_Boolean myRevFace;
107 Standard_EXPORT void Put (const TopoDS_Shape& S);
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());
114 Standard_EXPORT void CreateNewVertices(
115 const TopTools_IndexedDataMapOfShapeListOfShape& theMVE,
116 const Handle(BRepTools_Modification)& M);
118 Standard_EXPORT void FillNewCurveInfo(
119 const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
120 const Handle(BRepTools_Modification)& M);
122 Standard_EXPORT void FillNewSurfaceInfo(const Handle(BRepTools_Modification)& M);
124 Standard_EXPORT void CreateOtherVertices(
125 const TopTools_IndexedDataMapOfShapeListOfShape& theMVE,
126 const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
127 const Handle(BRepTools_Modification)& M);
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;
141 #include <BRepTools_Modifier.lxx>
147 #endif // _BRepTools_Modifier_HeaderFile