Back to home page

EIC code displayed by LXR

 
 

    


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

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 <TopTools_DataMapOfShapeShape.hxx>
0025 #include <TopTools_MapOfShape.hxx>
0026 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0027 #include <TopoDS_Edge.hxx>
0028 #include <TopoDS_Face.hxx>
0029 
0030 #include <NCollection_DataMap.hxx>
0031 #include <TopoDS_Shape.hxx>
0032 #include <TopTools_ShapeMapHasher.hxx>
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 
0045   DEFINE_STANDARD_ALLOC
0046   
0047   //! Creates an empty Modifier.
0048   Standard_EXPORT BRepTools_Modifier(Standard_Boolean theMutableInput = Standard_False);
0049   
0050   //! Creates a modifier on the shape <S>.
0051   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S);
0052   
0053   //! Creates a modifier on  the shape <S>, and performs
0054   //! the modifications described by <M>.
0055   Standard_EXPORT BRepTools_Modifier(const TopoDS_Shape& S, const 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 Handle(BRepTools_Modification)& M,
0062                                 const Message_ProgressRange& theProgress = Message_ProgressRange());
0063   
0064   //! Returns Standard_True if the modification has
0065   //! been computed successfully.
0066   Standard_Boolean IsDone() const;
0067 
0068   //! Returns the current mutable input state
0069   Standard_EXPORT Standard_Boolean 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(Standard_Boolean theMutableInput);
0075 
0076   //! Returns the modified shape corresponding to <S>.
0077   const TopoDS_Shape& ModifiedShape (const TopoDS_Shape& S) const;
0078   
0079 
0080 protected:
0081   
0082 
0083 
0084 private:
0085 
0086   struct NewCurveInfo
0087   {
0088     Handle(Geom_Curve) myCurve;
0089     TopLoc_Location myLoc;
0090     Standard_Real myToler;
0091   };
0092 
0093   struct NewSurfaceInfo
0094   {
0095     Handle(Geom_Surface) mySurface;
0096     TopLoc_Location myLoc;
0097     Standard_Real myToler;
0098     Standard_Boolean myRevWires;
0099     Standard_Boolean myRevFace;
0100   };
0101 
0102   Standard_EXPORT void Put (const TopoDS_Shape& S);
0103   
0104   Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S,
0105                                             const Handle(BRepTools_Modification)& M,
0106                                             Standard_Boolean& theNewGeom,
0107                                             const Message_ProgressRange& theProgress = Message_ProgressRange());
0108 
0109   Standard_EXPORT void CreateNewVertices(
0110     const TopTools_IndexedDataMapOfShapeListOfShape& theMVE, 
0111     const Handle(BRepTools_Modification)& M);
0112 
0113   Standard_EXPORT void FillNewCurveInfo(
0114     const TopTools_IndexedDataMapOfShapeListOfShape& theMEF, 
0115     const Handle(BRepTools_Modification)& M);
0116 
0117   Standard_EXPORT void FillNewSurfaceInfo(const Handle(BRepTools_Modification)& M);
0118 
0119   Standard_EXPORT void CreateOtherVertices(
0120     const TopTools_IndexedDataMapOfShapeListOfShape& theMVE, 
0121     const TopTools_IndexedDataMapOfShapeListOfShape& theMEF, 
0122     const Handle(BRepTools_Modification)& M);
0123 
0124   TopTools_DataMapOfShapeShape myMap;
0125   TopoDS_Shape myShape;
0126   Standard_Boolean myDone;
0127   NCollection_DataMap<TopoDS_Edge, NewCurveInfo, TopTools_ShapeMapHasher> myNCInfo;
0128   NCollection_DataMap<TopoDS_Face, NewSurfaceInfo, TopTools_ShapeMapHasher> myNSInfo;
0129   TopTools_MapOfShape myNonUpdFace;
0130   TopTools_MapOfShape myHasNewGeom;
0131   Standard_Boolean myMutableInput;
0132 
0133 };
0134 
0135 
0136 #include <BRepTools_Modifier.lxx>
0137 
0138 
0139 
0140 
0141 
0142 #endif // _BRepTools_Modifier_HeaderFile