Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2021 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _BRepTools_PurgeLocations_HeaderFile
0015 #define _BRepTools_PurgeLocations_HeaderFile
0016 
0017 #include <Standard.hxx>
0018 #include <Standard_Transient.hxx>
0019 #include <BRepTools_ReShape.hxx>
0020 #include <TopTools_LocationSet.hxx>
0021 
0022 
0023 
0024 //! Removes location datums, which satisfy conditions:
0025 //! aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec())
0026 //! from all locations of shape and its subshapes
0027 class BRepTools_PurgeLocations
0028 {
0029 
0030 public:
0031   
0032   Standard_EXPORT BRepTools_PurgeLocations();
0033    
0034   //! Removes all locations correspodingly to criterium from theShape.
0035   Standard_EXPORT Standard_Boolean Perform(const TopoDS_Shape& theShape);
0036 
0037   //! Returns shape with removed locations.
0038   Standard_EXPORT const TopoDS_Shape& GetResult() const;
0039 
0040   Standard_EXPORT Standard_Boolean  IsDone() const;
0041 
0042   //! Returns modified shape obtained from initial shape.
0043   TopoDS_Shape ModifiedShape(const TopoDS_Shape& theInitShape) const;
0044 
0045 private:
0046 
0047   void AddShape(const TopoDS_Shape& theS);
0048   Standard_Boolean PurgeLocation(const TopoDS_Shape& theS, TopoDS_Shape& theRes);
0049 
0050   Standard_Boolean myDone;
0051   TopoDS_Shape myShape;
0052   TopTools_IndexedMapOfShape myMapShapes;
0053   TopTools_LocationSet myLocations;
0054   TopTools_DataMapOfShapeShape myMapNewShapes;
0055   Handle(BRepTools_ReShape) myReShape;
0056 
0057 };
0058 
0059 #endif // _BRepTools_PurgeLocations_HeaderFile