1 // Created on: 1995-10-26
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 _BRepAlgo_AsDes_HeaderFile
18 #define _BRepAlgo_AsDes_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TopTools_DataMapOfShapeListOfShape.hxx>
24 #include <MMgt_TShared.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <Standard_Boolean.hxx>
27 class Standard_ConstructionError;
32 DEFINE_STANDARD_HANDLE(BRepAlgo_AsDes, MMgt_TShared)
34 //! SD to store descendants and ascendants of Shapes.
35 class BRepAlgo_AsDes : public MMgt_TShared
41 //! Creates an empty AsDes.
42 Standard_EXPORT BRepAlgo_AsDes();
44 Standard_EXPORT void Clear();
46 //! Stores <SS> as a futur subshape of <S>.
47 Standard_EXPORT void Add (const TopoDS_Shape& S, const TopoDS_Shape& SS);
49 //! Stores <SS> as futurs SubShapes of <S>.
50 Standard_EXPORT void Add (const TopoDS_Shape& S, const TopTools_ListOfShape& SS);
52 Standard_EXPORT Standard_Boolean HasAscendant (const TopoDS_Shape& S) const;
54 Standard_EXPORT Standard_Boolean HasDescendant (const TopoDS_Shape& S) const;
56 //! Returns the Shape containing <S>.
57 Standard_EXPORT const TopTools_ListOfShape& Ascendant (const TopoDS_Shape& S) const;
59 //! Returns futur subhapes of <S>.
60 Standard_EXPORT const TopTools_ListOfShape& Descendant (const TopoDS_Shape& S) const;
62 //! Returns futur subhapes of <S>.
63 Standard_EXPORT TopTools_ListOfShape& ChangeDescendant (const TopoDS_Shape& S);
65 //! Replace <OldS> by <NewS>.
66 //! <OldS> disapear from <me>.
67 Standard_EXPORT void Replace (const TopoDS_Shape& OldS, const TopoDS_Shape& NewS);
69 //! Remove <S> from me.
70 Standard_EXPORT void Remove (const TopoDS_Shape& S);
72 //! Returns True if (S1> and <S2> has common
73 //! Descendants. Stores in <LC> the Commons Descendants.
74 Standard_EXPORT Standard_Boolean HasCommonDescendant (const TopoDS_Shape& S1, const TopoDS_Shape& S2, TopTools_ListOfShape& LC) const;
79 DEFINE_STANDARD_RTTI(BRepAlgo_AsDes,MMgt_TShared)
89 //! Replace <OldS> by <NewS>.
90 //! <OldS> disapear from <me>.
91 Standard_EXPORT void BackReplace (const TopoDS_Shape& OldS, const TopoDS_Shape& NewS, const TopTools_ListOfShape& L, const Standard_Boolean InUp);
93 TopTools_DataMapOfShapeListOfShape up;
94 TopTools_DataMapOfShapeListOfShape down;
105 #endif // _BRepAlgo_AsDes_HeaderFile