Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:16:21

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 //! Removes location datums, which satisfy conditions:
0023 //! aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec())
0024 //! from all locations of shape and its subshapes
0025 class BRepTools_PurgeLocations
0026 {
0027 
0028 public:
0029   Standard_EXPORT BRepTools_PurgeLocations();
0030 
0031   //! Removes all locations correspondingly to criterium from theShape.
0032   Standard_EXPORT Standard_Boolean Perform(const TopoDS_Shape& theShape);
0033 
0034   //! Returns shape with removed locations.
0035   Standard_EXPORT const TopoDS_Shape& GetResult() const;
0036 
0037   Standard_EXPORT Standard_Boolean IsDone() const;
0038 
0039   //! Returns modified shape obtained from initial shape.
0040   TopoDS_Shape ModifiedShape(const TopoDS_Shape& theInitShape) const;
0041 
0042 private:
0043   void             AddShape(const TopoDS_Shape& theS);
0044   Standard_Boolean PurgeLocation(const TopoDS_Shape& theS, TopoDS_Shape& theRes);
0045 
0046   Standard_Boolean             myDone;
0047   TopoDS_Shape                 myShape;
0048   TopTools_IndexedMapOfShape   myMapShapes;
0049   TopTools_LocationSet         myLocations;
0050   TopTools_DataMapOfShapeShape myMapNewShapes;
0051   Handle(BRepTools_ReShape)    myReShape;
0052 };
0053 
0054 #endif // _BRepTools_PurgeLocations_HeaderFile