0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / ShapeUpgrade / ShapeUpgrade_RemoveLocations.hxx
CommitLineData
42cf5bc1 1// Created on: 2002-11-13
2// Created by: Galina KULIKOVA
3// Copyright (c) 2002-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _ShapeUpgrade_RemoveLocations_HeaderFile
17#define _ShapeUpgrade_RemoveLocations_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <TopAbs_ShapeEnum.hxx>
23#include <TopoDS_Shape.hxx>
24#include <TopTools_DataMapOfShapeShape.hxx>
25e59720 25#include <Standard_Transient.hxx>
42cf5bc1 26#include <Standard_Boolean.hxx>
27class TopoDS_Shape;
28
29
30class ShapeUpgrade_RemoveLocations;
25e59720 31DEFINE_STANDARD_HANDLE(ShapeUpgrade_RemoveLocations, Standard_Transient)
42cf5bc1 32
33//! Removes all locations sub-shapes of specified shape
25e59720 34class ShapeUpgrade_RemoveLocations : public Standard_Transient
42cf5bc1 35{
36
37public:
38
39
40 //! Empy constructor
41 Standard_EXPORT ShapeUpgrade_RemoveLocations();
42
43 //! Removes all location correspodingly to RemoveLevel.
44 Standard_EXPORT Standard_Boolean Remove (const TopoDS_Shape& theShape);
45
46 //! Returns shape with removed locatins.
47 TopoDS_Shape GetResult() const;
48
49 //! sets level starting with that location will be removed,
50 //! by default TopAbs_SHAPE. In this case locations will be kept for specified shape
51 //! and if specified shape is TopAbs_COMPOUND for sub-shapes of first level.
52 void SetRemoveLevel (const TopAbs_ShapeEnum theLevel);
53
54 //! sets level starting with that location will be removed.Value of level can be set to
55 //! TopAbs_SHAPE,TopAbs_COMPOUND,TopAbs_SOLID,TopAbs_SHELL,TopAbs_FACE.By default TopAbs_SHAPE.
56 //! In this case location will be removed for all shape types for exception of compound.
57 TopAbs_ShapeEnum RemoveLevel() const;
58
59 //! Returns modified shape obtained from initial shape.
60 TopoDS_Shape ModifiedShape (const TopoDS_Shape& theInitShape) const;
61
62
63
64
25e59720 65 DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_RemoveLocations,Standard_Transient)
42cf5bc1 66
67protected:
68
69
70
71
72private:
73
74
75 Standard_EXPORT Standard_Boolean MakeNewShape (const TopoDS_Shape& theShape, const TopoDS_Shape& theAncShape, TopoDS_Shape& theNewShape, const Standard_Boolean theRemoveLoc);
76
77 TopAbs_ShapeEnum myLevelRemoving;
78 TopoDS_Shape myShape;
79 TopTools_DataMapOfShapeShape myMapNewShapes;
80
81
82};
83
84
85#include <ShapeUpgrade_RemoveLocations.lxx>
86
87
88
89
90
91#endif // _ShapeUpgrade_RemoveLocations_HeaderFile