1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: ShHealOper_ShapeProcess.hxx
24 // Created: 13.04.04 11:45:20
25 // Author: Galina KULIKOVA
27 #ifndef ShHealOper_ShapeProcess_HeaderFile
28 #define ShHealOper_ShapeProcess_HeaderFile
30 #include <Resource_Manager.hxx>
31 #include <TopoDS_Shape.hxx>
32 #include <TopTools_DataMapOfShapeShape.hxx>
33 #include <TColStd_SequenceOfAsciiString.hxx>
34 #include <TCollection_AsciiString.hxx>
35 #include <ShapeProcessAPI_ApplySequence.hxx>
36 #include <ShapeProcess_ShapeContext.hxx>
38 /// Class ShHealOper_ShapeProcess
39 //Class for performing Shape healing operations on the shape.
41 class ShHealOper_ShapeProcess
44 // ---------- PUBLIC METHODS ----------
47 Standard_EXPORT ShHealOper_ShapeProcess();
48 //Constuctor initializes by defaults parameters
49 // (name of resource file - ShHealing, prefix - ShapeProcess,
50 // SaveHistory = Standard_False, level = TopAbs_FACE)
53 Standard_EXPORT ShHealOper_ShapeProcess
54 (const TCollection_AsciiString& theNameResource,
55 const TCollection_AsciiString& thePrefix = "ShapeProcess");
56 //Constuctor initializes by specified name of resource file and prefix
58 Standard_EXPORT void Perform(const TopoDS_Shape& theOldShape,
59 TopoDS_Shape& theNewShape);
60 //Perform modifications of specified shape.
62 Standard_EXPORT void SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators);
63 //Set sequence of operatotrs different than sequence written in the resourse file.
65 Standard_EXPORT Standard_Boolean GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators);
66 //Get sequence of operators.
68 Standard_EXPORT void SetParameter(const TCollection_AsciiString& theNameParam,
69 const TCollection_AsciiString& theVal);
70 //Set value of specified parameter different than value written in the resourse file.
72 Standard_EXPORT Standard_Boolean GetParameter(const TCollection_AsciiString& theNameParam,
73 TCollection_AsciiString& theVal);
74 //Get value of parameter by it's name.
76 inline void SetSaveHistoryMode(const Standard_Boolean theSaveHistory,
77 TopAbs_ShapeEnum theuntil = TopAbs_FACE)
79 mySaveHistoryMode = theSaveHistory;
82 //Set SaveHistoryMode nnd level of the shapes until history will be saved to the
86 inline Standard_Boolean GetSaveHistoryMode()
88 return mySaveHistoryMode;
90 //Returns SaveHistoryMode.
92 inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
93 TopoDS_Shape& theNewShape)
95 Standard_Boolean isModif = (!myMapModifications.IsEmpty() &&
96 myMapModifications.IsBound(theOldShape));
98 theNewShape = myMapModifications.Find(theOldShape);
100 theNewShape = theOldShape;
103 //Get modified shape for any specified shape
105 inline Standard_Boolean isDone()
109 //returns status of operation.
111 // ---------- PROTECTED METHODS ----------
116 // ---------- PRIVATE FIELDS ----------
118 //Handle(Resource_Manager) myResource;
119 ShapeProcessAPI_ApplySequence myOperations;
120 TCollection_AsciiString myPrefix;
121 TopTools_DataMapOfShapeShape myMapModifications;
122 Standard_Boolean mySaveHistoryMode;
123 TopAbs_ShapeEnum myLevel;
124 Standard_Boolean myDone;
126 // Declaration of CASCADE RTTI
127 //DEFINE_STANDARD_RTTI (ShHealOper_ShapeProcess)
130 // Definition of HANDLE object using Standard_DefineHandle.hxx
131 //DEFINE_STANDARD_HANDLE (ShHealOper_ShapeProcess, )