Back to index

salome-geom  6.5.0
ShHealOper_ShapeProcess.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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_ShapeProcess.hxx
00024 // Created:   13.04.04 11:45:20
00025 // Author:    Galina KULIKOVA
00026 //
00027 #ifndef ShHealOper_ShapeProcess_HeaderFile
00028 #define ShHealOper_ShapeProcess_HeaderFile
00029 
00030 #include <Resource_Manager.hxx>
00031 #include <TopoDS_Shape.hxx>
00032 #include <TopTools_DataMapOfShapeShape.hxx>
00033 #include <TColStd_SequenceOfAsciiString.hxx>
00034 #include <TCollection_AsciiString.hxx>
00035 #include <ShapeProcessAPI_ApplySequence.hxx>
00036 #include <ShapeProcess_ShapeContext.hxx>
00037 
00039 //Class for performing Shape healing operations on the shape.
00040 
00041 class ShHealOper_ShapeProcess 
00042 {
00043  public:
00044   // ---------- PUBLIC METHODS ----------
00045 
00047   Standard_EXPORT ShHealOper_ShapeProcess();
00048   //Constuctor initializes by defaults parameters 
00049   // (name of resource file - ShHealing, prefix - ShapeProcess, 
00050   // SaveHistory = Standard_False, level = TopAbs_FACE)
00051 
00053   Standard_EXPORT ShHealOper_ShapeProcess 
00054     (const TCollection_AsciiString& theNameResource,
00055      const TCollection_AsciiString& thePrefix = "ShapeProcess");
00056   //Constuctor initializes by specified name of resource file and prefix
00057   
00058   Standard_EXPORT void Perform(const TopoDS_Shape& theOldShape, 
00059                                            TopoDS_Shape& theNewShape);
00060   //Perform modifications of specified shape.
00061   
00062   Standard_EXPORT void SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators);
00063   //Set sequence of operatotrs different than sequence written in the resourse file.
00064   
00065   Standard_EXPORT Standard_Boolean GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators);
00066   //Get sequence of operators.
00067 
00068   Standard_EXPORT void SetParameter(const TCollection_AsciiString& theNameParam,
00069                                     const TCollection_AsciiString& theVal);
00070   //Set value of specified parameter different than value written in the resourse file.
00071   
00072   Standard_EXPORT Standard_Boolean GetParameter(const TCollection_AsciiString& theNameParam,
00073                                        TCollection_AsciiString& theVal);
00074   //Get value of parameter by it's name.
00075 
00076  inline void SetSaveHistoryMode(const Standard_Boolean theSaveHistory,
00077                                 TopAbs_ShapeEnum theuntil = TopAbs_FACE)
00078  {
00079    mySaveHistoryMode = theSaveHistory;
00080    myLevel = theuntil;
00081  }
00082   //Set SaveHistoryMode nnd level of the shapes until history will be saved to the
00083   //specified values.
00084 
00085 
00086   inline Standard_Boolean GetSaveHistoryMode()
00087   {
00088     return mySaveHistoryMode;
00089   }
00090   //Returns SaveHistoryMode.
00091   
00092   inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
00093                                            TopoDS_Shape& theNewShape)
00094   {
00095     Standard_Boolean isModif = (!myMapModifications.IsEmpty() && 
00096                                 myMapModifications.IsBound(theOldShape));
00097     if(isModif)
00098       theNewShape = myMapModifications.Find(theOldShape);
00099     else
00100       theNewShape = theOldShape;
00101     return isModif;
00102   }
00103   //Get modified shape for any specified shape
00104   
00105   inline Standard_Boolean isDone()
00106   {
00107     return myDone;
00108   }
00109   //returns status of operation.
00110  protected:
00111   // ---------- PROTECTED METHODS ----------
00112 
00113 
00114 
00115  private:
00116   // ---------- PRIVATE FIELDS ----------
00117 
00118   //Handle(Resource_Manager) myResource;
00119   ShapeProcessAPI_ApplySequence myOperations;
00120   TCollection_AsciiString myPrefix;
00121   TopTools_DataMapOfShapeShape myMapModifications;
00122   Standard_Boolean mySaveHistoryMode;
00123   TopAbs_ShapeEnum myLevel;
00124   Standard_Boolean myDone;
00125  public:
00126 // Declaration of CASCADE RTTI
00127 //DEFINE_STANDARD_RTTI (ShHealOper_ShapeProcess)
00128 };
00129 
00130 // Definition of HANDLE object using Standard_DefineHandle.hxx
00131 //DEFINE_STANDARD_HANDLE (ShHealOper_ShapeProcess, )
00132 
00133 
00134 #endif