c604279fc9ac91ff888ba162534b0358ae70c7b6
[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 <TopoDS_Shape.hxx>
26 #include <Standard_Boolean.hxx>
27
28 #include <Message_ProgressIndicator.hxx>
29
30 class Standard_NullObject;
31 class Standard_NoSuchObject;
32 class TopoDS_Shape;
33 class BRepTools_Modification;
34 class Message_ProgressIndicator;
35
36
37 //! Performs geometric modifications on a shape.
38 class BRepTools_Modifier 
39 {
40 public:
41
42   DEFINE_STANDARD_ALLOC
43
44   
45   //! Creates an empty Modifier.
46   Standard_EXPORT BRepTools_Modifier();
47   
48   //! Creates a modifier on the shape <S>.
49   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S);
50   
51   //! Creates a modifier on  the shape <S>, and performs
52   //! the modifications described by <M>.
53   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
54   
55   //! Initializes the modifier with the shape <S>.
56   Standard_EXPORT void Init (const TopoDS_Shape& S);
57   
58   //! Performs the modifications described by <M>.
59   Standard_EXPORT void Perform (const Handle(BRepTools_Modification)& M, const Handle(Message_ProgressIndicator)& aProgress = NULL);
60   
61   //! Returns Standard_True if the modification has
62   //! been computed successfully.
63     Standard_Boolean IsDone() const;
64   
65   //! Returns the modified shape corresponding to <S>.
66     const TopoDS_Shape& ModifiedShape (const TopoDS_Shape& S) const;
67
68
69
70
71 protected:
72
73
74
75
76
77 private:
78
79   
80   Standard_EXPORT void Put (const TopoDS_Shape& S);
81   
82   Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M, const Handle(Message_ProgressIndicator)& aProgress = NULL);
83
84
85   TopTools_DataMapOfShapeShape myMap;
86   TopoDS_Shape myShape;
87   Standard_Boolean myDone;
88
89
90 };
91
92
93 #include <BRepTools_Modifier.lxx>
94
95
96
97
98
99 #endif // _BRepTools_Modifier_HeaderFile