Salome HOME
Fix for Bug IPAL9053( 3.0.0: "Check Geometry" and "Load script" functionalities from...
[modules/geom.git] / src / ShHealOper / ShHealOper_Tool.hxx
1 // File:      ShHealOper_Tool.hxx
2 // Created:   26.04.04 11:36:04
3 // Author:    Galina KULIKOVA
4 //  < MODULE = KERNEL> <PACKAGE = ShHealOper> : <Shape Healing Operations>
5 //  Copyright (C) 2003  CEA
6 //
7 //  This library is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU Lesser General Public
9 //  License as published by the Free Software Foundation; either
10 //  version 2.1 of the License.
11 //
12
13 //  This library is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Lesser General Public License for more details.
17 //
18 //  You should have received a copy of the GNU Lesser General Public
19 //  License along with this library; if not, write to the Free Software
20 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21 //
22
23
24 #ifndef ShHealOper_Tool_HeaderFile
25 #define ShHealOper_Tool_HeaderFile
26
27 #include <MMgt_TShared.hxx>
28 #include <ShapeBuild_ReShape.hxx>
29 #include <TopoDS_Shape.hxx>
30
31 ///  Class ShHealOper_Tool
32 //
33 //enumeration for definition of the status of the error if operation failed
34 enum ShHealOper_Error {
35   ShHealOper_NotError,
36   ShHealOper_InvalidParameters,
37   ShHealOper_ErrorExecution
38 };
39
40 class ShHealOper_Tool 
41 {
42  public:
43   // ---------- PUBLIC METHODS ----------
44
45   /// Empty constructor
46   Standard_EXPORT ShHealOper_Tool () ;
47
48   Standard_EXPORT ShHealOper_Tool (const TopoDS_Shape& theShape);
49   // Constructor initialized by shape from which faces will be removed.
50
51   Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
52   //Method for initalization by whole shape.
53   
54   inline const TopoDS_Shape& GetResultShape() const
55   {
56     return myResultShape;
57
58   }
59   //Returns result shape.
60
61   inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
62                                            TopoDS_Shape& theNewShape) const
63   {
64     theNewShape = myContext->Apply(theOldShape);
65     return (!theNewShape.IsSame(theOldShape));
66   }
67   //Returns modified shape obtained after operation from initial shape.
68
69   inline Standard_Boolean IsDone() const 
70   {
71     return myDone;
72   }
73   //Returns status of the operation.
74   
75   inline void SetContext(Handle(ShapeBuild_ReShape)& theContext)
76   {
77     myContext = theContext;
78   }
79   //Initialization by context keeping modification of sub-shapes.
80
81   inline Handle(ShapeBuild_ReShape) Context()
82   {
83     return myContext;
84   }
85   //Returns context keeping modification of sub-shapes
86
87   inline Standard_Integer GetErrorStatus()
88   {
89     return myErrorStatus;
90   }
91  protected:
92   // ---------- PROTECTED FIELDS ----------
93
94   Handle(ShapeBuild_ReShape) myContext;
95   TopoDS_Shape myInitShape;
96   TopoDS_Shape myResultShape;
97   Standard_Boolean myDone;
98   ShHealOper_Error myErrorStatus;
99  public:
100 // Declaration of CASCADE RTTI
101 //DEFINE_STANDARD_RTTI (ShHealOper_Tool)
102 };
103
104 // Definition of HANDLE object using Standard_DefineHandle.hxx
105 //DEFINE_STANDARD_HANDLE (ShHealOper_Tool, )
106
107
108 #endif