Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:18:28

0001 // Created on: 1994-08-25
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1994-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_Modifier_HeaderFile
0018 #define _BRepTools_Modifier_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopoDS_Shape.hxx>
0025 #include <TopTools_ShapeMapHasher.hxx>
0026 #include <NCollection_DataMap.hxx>
0027 #include <NCollection_Map.hxx>
0028 #include <NCollection_List.hxx>
0029 #include <NCollection_IndexedDataMap.hxx>
0030 #include <TopoDS_Edge.hxx>
0031 #include <TopoDS_Face.hxx>
0032 
0033 #include <TopLoc_Location.hxx>
0034 #include <Message_ProgressRange.hxx>
0035 
0036 class BRepTools_Modification;
0037 class Geom_Curve;
0038 class Geom_Surface;
0039 
0040 //! Performs geometric modifications on a shape.
0041 class BRepTools_Modifier
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! Creates an empty Modifier.
0047   Standard_EXPORT BRepTools_Modifier(bool theMutableInput = false);
0048 
0049   //! Creates a modifier on the shape <S>.
0050   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S);
0051 
0052   //! Creates a modifier on the shape <S>, and performs
0053   //! the modifications described by <M>.
0054   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape&                        S,
0055                                      const occ::handle<BRepTools_Modification>& M);
0056 
0057   //! Initializes the modifier with the shape <S>.
0058   Standard_EXPORT void Init(const TopoDS_Shape& S);
0059 
0060   //! Performs the modifications described by <M>.
0061   Standard_EXPORT void Perform(const occ::handle<BRepTools_Modification>& M,
0062                                const Message_ProgressRange& theProgress = Message_ProgressRange());
0063 
0064   //! Returns true if the modification has
0065   //! been computed successfully.
0066   bool IsDone() const;
0067 
0068   //! Returns the current mutable input state
0069   Standard_EXPORT bool IsMutableInput() const;
0070 
0071   //! Sets the mutable input state
0072   //! If true then the input (original) shape can be modified
0073   //! during modification process
0074   Standard_EXPORT void SetMutableInput(bool theMutableInput);
0075 
0076   //! Returns the modified shape corresponding to <S>.
0077   const TopoDS_Shape& ModifiedShape(const TopoDS_Shape& S) const;
0078 
0079 private:
0080   struct NewCurveInfo
0081   {
0082     occ::handle<Geom_Curve> myCurve;
0083     TopLoc_Location         myLoc;
0084     double                  myToler;
0085   };
0086 
0087   struct NewSurfaceInfo
0088   {
0089     occ::handle<Geom_Surface> mySurface;
0090     TopLoc_Location           myLoc;
0091     double                    myToler;
0092     bool                      myRevWires;
0093     bool                      myRevFace;
0094   };
0095 
0096   Standard_EXPORT void Put(const TopoDS_Shape& S);
0097 
0098   Standard_EXPORT bool Rebuild(const TopoDS_Shape&                        S,
0099                                const occ::handle<BRepTools_Modification>& M,
0100                                bool&                                      theNewGeom,
0101                                const Message_ProgressRange& theProgress = Message_ProgressRange());
0102 
0103   Standard_EXPORT void CreateNewVertices(
0104     const NCollection_IndexedDataMap<TopoDS_Shape,
0105                                      NCollection_List<TopoDS_Shape>,
0106                                      TopTools_ShapeMapHasher>& theMVE,
0107     const occ::handle<BRepTools_Modification>&                 M);
0108 
0109   Standard_EXPORT void FillNewCurveInfo(
0110     const NCollection_IndexedDataMap<TopoDS_Shape,
0111                                      NCollection_List<TopoDS_Shape>,
0112                                      TopTools_ShapeMapHasher>& theMEF,
0113     const occ::handle<BRepTools_Modification>&                 M);
0114 
0115   Standard_EXPORT void FillNewSurfaceInfo(const occ::handle<BRepTools_Modification>& M);
0116 
0117   Standard_EXPORT void CreateOtherVertices(
0118     const NCollection_IndexedDataMap<TopoDS_Shape,
0119                                      NCollection_List<TopoDS_Shape>,
0120                                      TopTools_ShapeMapHasher>& theMVE,
0121     const NCollection_IndexedDataMap<TopoDS_Shape,
0122                                      NCollection_List<TopoDS_Shape>,
0123                                      TopTools_ShapeMapHasher>& theMEF,
0124     const occ::handle<BRepTools_Modification>&                 M);
0125 
0126   NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>  myMap;
0127   TopoDS_Shape                                                              myShape;
0128   bool                                                                      myDone;
0129   NCollection_DataMap<TopoDS_Edge, NewCurveInfo, TopTools_ShapeMapHasher>   myNCInfo;
0130   NCollection_DataMap<TopoDS_Face, NewSurfaceInfo, TopTools_ShapeMapHasher> myNSInfo;
0131   NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>                    myNonUpdFace;
0132   NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>                    myHasNewGeom;
0133   bool                                                                      myMutableInput;
0134 };
0135 
0136 #include <BRepTools_Modifier.lxx>
0137 
0138 #endif // _BRepTools_Modifier_HeaderFile