00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // File: ShHealOper_Tool.hxx 00024 // Created: 26.04.04 11:36:04 00025 // Author: Galina KULIKOVA 00026 // 00027 #ifndef ShHealOper_Tool_HeaderFile 00028 #define ShHealOper_Tool_HeaderFile 00029 00030 #include <MMgt_TShared.hxx> 00031 #include <ShapeBuild_ReShape.hxx> 00032 #include <TopoDS_Shape.hxx> 00033 00035 // 00036 //enumeration for definition of the status of the error if operation failed 00037 enum ShHealOper_Error { 00038 ShHealOper_NotError, 00039 ShHealOper_InvalidParameters, 00040 ShHealOper_ErrorExecution 00041 }; 00042 00043 class ShHealOper_Tool 00044 { 00045 public: 00046 // ---------- PUBLIC METHODS ---------- 00047 00049 Standard_EXPORT ShHealOper_Tool () ; 00050 00051 Standard_EXPORT ShHealOper_Tool (const TopoDS_Shape& theShape); 00052 // Constructor initialized by shape from which faces will be removed. 00053 00054 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape); 00055 //Method for initalization by whole shape. 00056 00057 inline const TopoDS_Shape& GetResultShape() const 00058 { 00059 return myResultShape; 00060 00061 } 00062 //Returns result shape. 00063 00064 inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape, 00065 TopoDS_Shape& theNewShape) const 00066 { 00067 theNewShape = myContext->Apply(theOldShape); 00068 return (!theNewShape.IsSame(theOldShape)); 00069 } 00070 //Returns modified shape obtained after operation from initial shape. 00071 00072 inline Standard_Boolean IsDone() const 00073 { 00074 return myDone; 00075 } 00076 //Returns status of the operation. 00077 00078 inline void SetContext(Handle(ShapeBuild_ReShape)& theContext) 00079 { 00080 myContext = theContext; 00081 } 00082 //Initialization by context keeping modification of sub-shapes. 00083 00084 inline Handle(ShapeBuild_ReShape) Context() 00085 { 00086 return myContext; 00087 } 00088 //Returns context keeping modification of sub-shapes 00089 00090 inline Standard_Integer GetErrorStatus() 00091 { 00092 return myErrorStatus; 00093 } 00094 protected: 00095 // ---------- PROTECTED FIELDS ---------- 00096 00097 Handle(ShapeBuild_ReShape) myContext; 00098 TopoDS_Shape myInitShape; 00099 TopoDS_Shape myResultShape; 00100 Standard_Boolean myDone; 00101 ShHealOper_Error myErrorStatus; 00102 public: 00103 // Declaration of CASCADE RTTI 00104 //DEFINE_STANDARD_RTTI (ShHealOper_Tool) 00105 }; 00106 00107 // Definition of HANDLE object using Standard_DefineHandle.hxx 00108 //DEFINE_STANDARD_HANDLE (ShHealOper_Tool, ) 00109 00110 00111 #endif