Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:57

0001 // Created on: 2002-11-13
0002 // Created by: Galina KULIKOVA
0003 // Copyright (c) 2002-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _ShapeUpgrade_RemoveLocations_HeaderFile
0017 #define _ShapeUpgrade_RemoveLocations_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <TopAbs_ShapeEnum.hxx>
0023 #include <TopoDS_Shape.hxx>
0024 #include <TopTools_DataMapOfShapeShape.hxx>
0025 #include <Standard_Transient.hxx>
0026 
0027 
0028 class ShapeUpgrade_RemoveLocations;
0029 DEFINE_STANDARD_HANDLE(ShapeUpgrade_RemoveLocations, Standard_Transient)
0030 
0031 //! Removes all locations sub-shapes of specified shape
0032 class ShapeUpgrade_RemoveLocations : public Standard_Transient
0033 {
0034 
0035 public:
0036 
0037   
0038   //! Empty constructor
0039   Standard_EXPORT ShapeUpgrade_RemoveLocations();
0040   
0041   //! Removes all location correspodingly to RemoveLevel.
0042   Standard_EXPORT Standard_Boolean Remove (const TopoDS_Shape& theShape);
0043   
0044   //! Returns shape with removed locations.
0045     TopoDS_Shape GetResult() const;
0046   
0047   //! sets level starting with that location will be removed,
0048   //! by default TopAbs_SHAPE. In this case locations will be kept for specified shape
0049   //! and if specified shape is TopAbs_COMPOUND for sub-shapes of first level.
0050     void SetRemoveLevel (const TopAbs_ShapeEnum theLevel);
0051   
0052   //! sets level starting with that location will be removed.Value of level can be set to
0053   //! TopAbs_SHAPE,TopAbs_COMPOUND,TopAbs_SOLID,TopAbs_SHELL,TopAbs_FACE.By default TopAbs_SHAPE.
0054   //! In this case location will be removed for all shape types for exception of compound.
0055     TopAbs_ShapeEnum RemoveLevel() const;
0056   
0057   //! Returns modified shape obtained from initial shape.
0058     TopoDS_Shape ModifiedShape (const TopoDS_Shape& theInitShape) const;
0059 
0060 
0061 
0062 
0063   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_RemoveLocations,Standard_Transient)
0064 
0065 protected:
0066 
0067 
0068 
0069 
0070 private:
0071 
0072   
0073   Standard_EXPORT Standard_Boolean MakeNewShape (const TopoDS_Shape& theShape, const TopoDS_Shape& theAncShape, TopoDS_Shape& theNewShape, const Standard_Boolean theRemoveLoc);
0074 
0075   TopAbs_ShapeEnum myLevelRemoving;
0076   TopoDS_Shape myShape;
0077   TopTools_DataMapOfShapeShape myMapNewShapes;
0078 
0079 
0080 };
0081 
0082 
0083 #include <ShapeUpgrade_RemoveLocations.lxx>
0084 
0085 
0086 
0087 
0088 
0089 #endif // _ShapeUpgrade_RemoveLocations_HeaderFile