Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-03-28
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 _BRepTools_Substitution_HeaderFile
0018 #define _BRepTools_Substitution_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0024 #include <TopTools_ListOfShape.hxx>
0025 class TopoDS_Shape;
0026 
0027 
0028 //! A tool to substitute subshapes by other shapes.
0029 //!
0030 //! The user use the method Substitute to define the
0031 //! modifications.
0032 //! A set of shapes is designated to replace a initial
0033 //! shape.
0034 //!
0035 //! The method Build reconstructs a new Shape with the
0036 //! modifications.The Shape and the new shape are
0037 //! registered.
0038 class BRepTools_Substitution 
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   Standard_EXPORT BRepTools_Substitution();
0046   
0047   //! Reset all the fields.
0048   Standard_EXPORT void Clear();
0049   
0050   //! <Oldshape> will be replaced by <NewShapes>.
0051   //!
0052   //! <NewShapes> can be empty , in this case <OldShape>
0053   //! will disparate from its ancestors.
0054   //!
0055   //! if an item of <NewShapes> is oriented FORWARD.
0056   //! it will be oriented as <OldShape> in its ancestors.
0057   //! else it will be reversed.
0058   Standard_EXPORT void Substitute (const TopoDS_Shape& OldShape, const TopTools_ListOfShape& NewShapes);
0059   
0060   //! Build NewShape from <S> if its subshapes has modified.
0061   //!
0062   //! The methods <IsCopied> and <Copy> allows you to keep
0063   //! the resul of <Build>
0064   Standard_EXPORT void Build (const TopoDS_Shape& S);
0065   
0066   //! Returns   True if <S> has   been  replaced .
0067   Standard_EXPORT Standard_Boolean IsCopied (const TopoDS_Shape& S) const;
0068   
0069   //! Returns the set of shapes substituted to <S>.
0070   Standard_EXPORT const TopTools_ListOfShape& Copy (const TopoDS_Shape& S) const;
0071 
0072 
0073 
0074 
0075 protected:
0076 
0077 
0078 
0079 
0080 
0081 private:
0082 
0083 
0084 
0085   TopTools_DataMapOfShapeListOfShape myMap;
0086 
0087 
0088 };
0089 
0090 
0091 
0092 
0093 
0094 
0095 
0096 #endif // _BRepTools_Substitution_HeaderFile