42cf5bc1 |
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 |
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 _BRepAlgo_AsDes_HeaderFile |
18 | #define _BRepAlgo_AsDes_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
25e59720 |
24 | #include <Standard_Transient.hxx> |
42cf5bc1 |
25 | #include <TopTools_ListOfShape.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | class Standard_ConstructionError; |
28 | class TopoDS_Shape; |
29 | |
30 | |
31 | class BRepAlgo_AsDes; |
25e59720 |
32 | DEFINE_STANDARD_HANDLE(BRepAlgo_AsDes, Standard_Transient) |
42cf5bc1 |
33 | |
34 | //! SD to store descendants and ascendants of Shapes. |
25e59720 |
35 | class BRepAlgo_AsDes : public Standard_Transient |
42cf5bc1 |
36 | { |
37 | |
38 | public: |
39 | |
42cf5bc1 |
40 | //! Creates an empty AsDes. |
41 | Standard_EXPORT BRepAlgo_AsDes(); |
42 | |
43 | Standard_EXPORT void Clear(); |
44 | |
45 | //! Stores <SS> as a futur subshape of <S>. |
46 | Standard_EXPORT void Add (const TopoDS_Shape& S, const TopoDS_Shape& SS); |
47 | |
48 | //! Stores <SS> as futurs SubShapes of <S>. |
49 | Standard_EXPORT void Add (const TopoDS_Shape& S, const TopTools_ListOfShape& SS); |
50 | |
51 | Standard_EXPORT Standard_Boolean HasAscendant (const TopoDS_Shape& S) const; |
52 | |
53 | Standard_EXPORT Standard_Boolean HasDescendant (const TopoDS_Shape& S) const; |
54 | |
55 | //! Returns the Shape containing <S>. |
56 | Standard_EXPORT const TopTools_ListOfShape& Ascendant (const TopoDS_Shape& S) const; |
57 | |
58 | //! Returns futur subhapes of <S>. |
59 | Standard_EXPORT const TopTools_ListOfShape& Descendant (const TopoDS_Shape& S) const; |
60 | |
61 | //! Returns futur subhapes of <S>. |
62 | Standard_EXPORT TopTools_ListOfShape& ChangeDescendant (const TopoDS_Shape& S); |
42cf5bc1 |
63 | |
316ea293 |
64 | //! Replace theOldS by theNewS. |
65 | //! theOldS disappear from this. |
66 | Standard_EXPORT void Replace (const TopoDS_Shape& theOldS, const TopoDS_Shape& theNewS); |
42cf5bc1 |
67 | |
316ea293 |
68 | //! Remove theS from me. |
69 | Standard_EXPORT void Remove (const TopoDS_Shape& theS); |
42cf5bc1 |
70 | |
316ea293 |
71 | //! Returns True if (S1> and <S2> has common |
72 | //! Descendants. Stores in <LC> the Commons Descendants. |
73 | Standard_EXPORT Standard_Boolean HasCommonDescendant (const TopoDS_Shape& S1, const TopoDS_Shape& S2, TopTools_ListOfShape& LC) const; |
42cf5bc1 |
74 | |
25e59720 |
75 | DEFINE_STANDARD_RTTIEXT(BRepAlgo_AsDes,Standard_Transient) |
42cf5bc1 |
76 | |
316ea293 |
77 | private: |
42cf5bc1 |
78 | |
316ea293 |
79 | //! Replace theOldS by theNewS. |
80 | //! theOldS disappear from this. |
81 | Standard_EXPORT void BackReplace (const TopoDS_Shape& theOldS, |
82 | const TopoDS_Shape& theNewS, |
83 | const TopTools_ListOfShape& theL, |
84 | const Standard_Boolean theInUp); |
42cf5bc1 |
85 | |
86 | private: |
87 | |
42cf5bc1 |
88 | TopTools_DataMapOfShapeListOfShape up; |
89 | TopTools_DataMapOfShapeListOfShape down; |
90 | |
42cf5bc1 |
91 | }; |
92 | |
42cf5bc1 |
93 | #endif // _BRepAlgo_AsDes_HeaderFile |