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
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_Substitution_HeaderFile
18 #define _BRepTools_Substitution_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopTools_DataMapOfShapeListOfShape.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <Standard_Boolean.hxx>
27 class Standard_NoSuchObject;
31 //! A tool to substitute subshapes by other shapes.
33 //! The user use the method Substitute to define the
35 //! A set of shapes is designated to replace a initial
38 //! The method Build reconstructs a new Shape with the
39 //! modifications.The Shape and the new shape are
41 class BRepTools_Substitution
48 Standard_EXPORT BRepTools_Substitution();
50 //! Reset all the fields.
51 Standard_EXPORT void Clear();
53 //! <Oldshape> will be replaced by <NewShapes>.
55 //! <NewShapes> can be empty , in this case <OldShape>
56 //! will disparate from its ancestors.
58 //! if an item of <NewShapes> is oriented FORWARD.
59 //! it will be oriented as <OldShape> in its ancestors.
60 //! else it will be reversed.
61 Standard_EXPORT void Substitute (const TopoDS_Shape& OldShape, const TopTools_ListOfShape& NewShapes);
63 //! Build NewShape from <S> if its subshapes has modified.
65 //! The methods <IsCopied> and <Copy> allows you to keep
66 //! the resul of <Build>
67 Standard_EXPORT void Build (const TopoDS_Shape& S);
69 //! Returns True if <S> has been replaced .
70 Standard_EXPORT Standard_Boolean IsCopied (const TopoDS_Shape& S) const;
72 //! Returns the set of shapes substitued to <S> .
73 Standard_EXPORT const TopTools_ListOfShape& Copy (const TopoDS_Shape& S) const;
88 TopTools_DataMapOfShapeListOfShape myMap;
99 #endif // _BRepTools_Substitution_HeaderFile