Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:06

0001 // Created on: 1995-10-26
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepAlgo_AsDes_HeaderFile
0018 #define _BRepAlgo_AsDes_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0023 #include <Standard_Transient.hxx>
0024 #include <TopTools_ListOfShape.hxx>
0025 class TopoDS_Shape;
0026 
0027 
0028 class BRepAlgo_AsDes;
0029 DEFINE_STANDARD_HANDLE(BRepAlgo_AsDes, Standard_Transient)
0030 
0031 //! SD to store descendants and ascendants of Shapes.
0032 class BRepAlgo_AsDes : public Standard_Transient
0033 {
0034 
0035 public:
0036 
0037   //! Creates an empty AsDes.
0038   Standard_EXPORT BRepAlgo_AsDes();
0039   
0040   Standard_EXPORT void Clear();
0041   
0042   //! Stores <SS> as a futur subshape of <S>.
0043   Standard_EXPORT void Add (const TopoDS_Shape& S, const TopoDS_Shape& SS);
0044   
0045   //! Stores <SS> as futurs SubShapes of <S>.
0046   Standard_EXPORT void Add (const TopoDS_Shape& S, const TopTools_ListOfShape& SS);
0047   
0048   Standard_EXPORT Standard_Boolean HasAscendant (const TopoDS_Shape& S) const;
0049   
0050   Standard_EXPORT Standard_Boolean HasDescendant (const TopoDS_Shape& S) const;
0051   
0052   //! Returns the Shape containing <S>.
0053   Standard_EXPORT const TopTools_ListOfShape& Ascendant (const TopoDS_Shape& S) const;
0054   
0055   //! Returns futur subhapes of <S>.
0056   Standard_EXPORT const TopTools_ListOfShape& Descendant (const TopoDS_Shape& S) const;
0057   
0058   //! Returns futur subhapes of <S>.
0059   Standard_EXPORT TopTools_ListOfShape& ChangeDescendant (const TopoDS_Shape& S);
0060 
0061   //! Replace theOldS by theNewS.
0062   //! theOldS disappear from this.
0063   Standard_EXPORT void Replace (const TopoDS_Shape& theOldS, const TopoDS_Shape& theNewS);
0064 
0065   //! Remove theS from me.
0066   Standard_EXPORT void Remove (const TopoDS_Shape& theS);
0067 
0068   //! Returns  True if (S1> and <S2>  has  common
0069   //! Descendants.  Stores in <LC> the Commons Descendants.
0070   Standard_EXPORT Standard_Boolean HasCommonDescendant (const TopoDS_Shape& S1, const TopoDS_Shape& S2, TopTools_ListOfShape& LC) const;
0071 
0072   DEFINE_STANDARD_RTTIEXT(BRepAlgo_AsDes,Standard_Transient)
0073 
0074 private:
0075 
0076   //! Replace theOldS by theNewS.
0077   //! theOldS disappear from this.
0078   Standard_EXPORT void BackReplace (const TopoDS_Shape& theOldS,
0079                                     const TopoDS_Shape& theNewS,
0080                                     const TopTools_ListOfShape& theL,
0081                                     const Standard_Boolean theInUp);
0082 
0083 private:
0084 
0085   TopTools_DataMapOfShapeListOfShape up;
0086   TopTools_DataMapOfShapeListOfShape down;
0087 
0088 };
0089 
0090 #endif // _BRepAlgo_AsDes_HeaderFile