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_Image_HeaderFile
0018 #define _BRepAlgo_Image_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_ListOfShape.hxx>
0025 #include <TopTools_DataMapOfShapeShape.hxx>
0026 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0027 #include <Standard_Boolean.hxx>
0028 #include <TopAbs_ShapeEnum.hxx>
0029 class TopoDS_Shape;
0030 
0031 
0032 //! Stores link between a shape <S> and a shape <NewS>
0033 //! obtained from <S>. <NewS> is an image of <S>.
0034 class BRepAlgo_Image 
0035 {
0036 public:
0037 
0038   DEFINE_STANDARD_ALLOC
0039 
0040   
0041   Standard_EXPORT BRepAlgo_Image();
0042   
0043   Standard_EXPORT void SetRoot (const TopoDS_Shape& S);
0044   
0045   //! Links <NewS> as image of <OldS>.
0046   Standard_EXPORT void Bind (const TopoDS_Shape& OldS, const TopoDS_Shape& NewS);
0047   
0048   //! Links <NewS> as image of <OldS>.
0049   Standard_EXPORT void Bind (const TopoDS_Shape& OldS, const TopTools_ListOfShape& NewS);
0050   
0051   //! Add <NewS> to the image of <OldS>.
0052   Standard_EXPORT void Add (const TopoDS_Shape& OldS, const TopoDS_Shape& NewS);
0053   
0054   //! Add <NewS> to the image of <OldS>.
0055   Standard_EXPORT void Add (const TopoDS_Shape& OldS, const TopTools_ListOfShape& NewS);
0056   
0057   Standard_EXPORT void Clear();
0058   
0059   //! Remove <S> to set of images.
0060   Standard_EXPORT void Remove (const TopoDS_Shape& S);
0061   
0062   //! Removes the root <theRoot> from the list of roots and up and down maps.
0063   Standard_EXPORT void RemoveRoot (const TopoDS_Shape& Root);
0064 
0065   //! Replaces the <OldRoot> with the <NewRoot>, so all images
0066   //! of the <OldRoot> become the images of the <NewRoot>.
0067   //! The <OldRoot> is removed.
0068   Standard_EXPORT void ReplaceRoot (const TopoDS_Shape& OldRoot, const TopoDS_Shape& NewRoot);
0069 
0070   Standard_EXPORT const TopTools_ListOfShape& Roots() const;
0071   
0072   Standard_EXPORT Standard_Boolean IsImage (const TopoDS_Shape& S) const;
0073   
0074   //! Returns the generator of <S>
0075   Standard_EXPORT const TopoDS_Shape& ImageFrom (const TopoDS_Shape& S) const;
0076   
0077   //! Returns the upper generator of <S>
0078   Standard_EXPORT const TopoDS_Shape& Root (const TopoDS_Shape& S) const;
0079   
0080   Standard_EXPORT Standard_Boolean HasImage (const TopoDS_Shape& S) const;
0081   
0082   //! Returns the Image of <S>.
0083   //! Returns <S> in the list if HasImage(S) is false.
0084   Standard_EXPORT const TopTools_ListOfShape& Image (const TopoDS_Shape& S) const;
0085   
0086   //! Stores in <L> the images of images of...images of <S>.
0087   //! <L> contains only <S> if  HasImage(S) is false.
0088   Standard_EXPORT void LastImage (const TopoDS_Shape& S, TopTools_ListOfShape& L) const;
0089   
0090   //! Keeps only the link between roots and lastimage.
0091   Standard_EXPORT void Compact();
0092   
0093   //! Deletes in the images the shape of type <ShapeType>
0094   //! which are not in <S>.
0095   //! Warning:  Compact() must be call before.
0096   Standard_EXPORT void Filter (const TopoDS_Shape& S, const TopAbs_ShapeEnum ShapeType);
0097 
0098 
0099 
0100 
0101 protected:
0102 
0103 
0104 
0105 
0106 
0107 private:
0108 
0109 
0110 
0111   TopTools_ListOfShape roots;
0112   TopTools_DataMapOfShapeShape up;
0113   TopTools_DataMapOfShapeListOfShape down;
0114 
0115 
0116 };
0117 
0118 
0119 
0120 
0121 
0122 
0123 
0124 #endif // _BRepAlgo_Image_HeaderFile