42cf5bc1 |
1 | // Created on: 1995-03-28 |
2 | // Created by: Yves FRICAUD |
3 | // Copyright (c) 1995-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_Substitution_HeaderFile |
18 | #define _BRepTools_Substitution_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
42cf5bc1 |
22 | |
23 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
24 | #include <TopTools_ListOfShape.hxx> |
42cf5bc1 |
25 | class TopoDS_Shape; |
26 | |
27 | |
28 | //! A tool to substitute subshapes by other shapes. |
29 | //! |
30 | //! The user use the method Substitute to define the |
31 | //! modifications. |
32 | //! A set of shapes is designated to replace a initial |
33 | //! shape. |
34 | //! |
35 | //! The method Build reconstructs a new Shape with the |
36 | //! modifications.The Shape and the new shape are |
37 | //! registered. |
38 | class BRepTools_Substitution |
39 | { |
40 | public: |
41 | |
42 | DEFINE_STANDARD_ALLOC |
43 | |
44 | |
45 | Standard_EXPORT BRepTools_Substitution(); |
46 | |
47 | //! Reset all the fields. |
48 | Standard_EXPORT void Clear(); |
49 | |
50 | //! <Oldshape> will be replaced by <NewShapes>. |
51 | //! |
52 | //! <NewShapes> can be empty , in this case <OldShape> |
53 | //! will disparate from its ancestors. |
54 | //! |
55 | //! if an item of <NewShapes> is oriented FORWARD. |
56 | //! it will be oriented as <OldShape> in its ancestors. |
57 | //! else it will be reversed. |
58 | Standard_EXPORT void Substitute (const TopoDS_Shape& OldShape, const TopTools_ListOfShape& NewShapes); |
59 | |
60 | //! Build NewShape from <S> if its subshapes has modified. |
61 | //! |
62 | //! The methods <IsCopied> and <Copy> allows you to keep |
63 | //! the resul of <Build> |
64 | Standard_EXPORT void Build (const TopoDS_Shape& S); |
65 | |
66 | //! Returns True if <S> has been replaced . |
67 | Standard_EXPORT Standard_Boolean IsCopied (const TopoDS_Shape& S) const; |
68 | |
b81b237f |
69 | //! Returns the set of shapes substituted to <S>. |
42cf5bc1 |
70 | Standard_EXPORT const TopTools_ListOfShape& Copy (const TopoDS_Shape& S) const; |
71 | |
72 | |
73 | |
74 | |
75 | protected: |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | private: |
82 | |
83 | |
84 | |
85 | TopTools_DataMapOfShapeListOfShape myMap; |
86 | |
87 | |
88 | }; |
89 | |
90 | |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | #endif // _BRepTools_Substitution_HeaderFile |