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
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.
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.
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
24 #ifndef ShHealOper_Tool_HeaderFile
25 #define ShHealOper_Tool_HeaderFile
27 #include <MMgt_TShared.hxx>
28 #include <ShapeBuild_ReShape.hxx>
29 #include <TopoDS_Shape.hxx>
31 /// Class ShHealOper_Tool
33 //enumeration for definition of the status of the error if operation failed
34 enum ShHealOper_Error {
36 ShHealOper_InvalidParameters,
37 ShHealOper_ErrorExecution
43 // ---------- PUBLIC METHODS ----------
46 Standard_EXPORT ShHealOper_Tool () ;
48 Standard_EXPORT ShHealOper_Tool (const TopoDS_Shape& theShape);
49 // Constructor initialized by shape from which faces will be removed.
51 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
52 //Method for initalization by whole shape.
54 inline const TopoDS_Shape& GetResultShape() const
59 //Returns result shape.
61 inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
62 TopoDS_Shape& theNewShape) const
64 theNewShape = myContext->Apply(theOldShape);
65 return (!theNewShape.IsSame(theOldShape));
67 //Returns modified shape obtained after operation from initial shape.
69 inline Standard_Boolean IsDone() const
73 //Returns status of the operation.
75 inline void SetContext(Handle(ShapeBuild_ReShape)& theContext)
77 myContext = theContext;
79 //Initialization by context keeping modification of sub-shapes.
81 inline Handle(ShapeBuild_ReShape) Context()
85 //Returns context keeping modification of sub-shapes
87 inline Standard_Integer GetErrorStatus()
92 // ---------- PROTECTED FIELDS ----------
94 Handle(ShapeBuild_ReShape) myContext;
95 TopoDS_Shape myInitShape;
96 TopoDS_Shape myResultShape;
97 Standard_Boolean myDone;
98 ShHealOper_Error myErrorStatus;
100 // Declaration of CASCADE RTTI
101 //DEFINE_STANDARD_RTTI (ShHealOper_Tool)
104 // Definition of HANDLE object using Standard_DefineHandle.hxx
105 //DEFINE_STANDARD_HANDLE (ShHealOper_Tool, )