1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File: ShHealOper_ShapeProcess.hxx
22 // Created: 13.04.04 11:45:20
23 // Author: Galina KULIKOVA
26 #ifndef ShHealOper_ShapeProcess_HeaderFile
27 #define ShHealOper_ShapeProcess_HeaderFile
29 #include <Resource_Manager.hxx>
30 #include <TopoDS_Shape.hxx>
31 #include <TopTools_DataMapOfShapeShape.hxx>
32 #include <TColStd_SequenceOfAsciiString.hxx>
33 #include <TCollection_AsciiString.hxx>
34 #include <ShapeProcessAPI_ApplySequence.hxx>
35 #include <ShapeProcess_ShapeContext.hxx>
37 /// Class ShHealOper_ShapeProcess
38 //Class for performing Shape healing operations on the shape.
40 class ShHealOper_ShapeProcess
43 // ---------- PUBLIC METHODS ----------
46 Standard_EXPORT ShHealOper_ShapeProcess();
47 //Constuctor initializes by defaults parameters
48 // (name of resource file - ShHealing, prefix - ShapeProcess,
49 // SaveHistory = Standard_False, level = TopAbs_FACE)
52 Standard_EXPORT ShHealOper_ShapeProcess
53 (const TCollection_AsciiString& theNameResource,
54 const TCollection_AsciiString& thePrefix = "ShapeProcess");
55 //Constuctor initializes by specified name of resource file and prefix
57 Standard_EXPORT void Perform(const TopoDS_Shape& theOldShape,
58 TopoDS_Shape& theNewShape);
59 //Perform modifications of specified shape.
61 Standard_EXPORT void SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators);
62 //Set sequence of operatotrs different than sequence written in the resourse file.
64 Standard_EXPORT Standard_Boolean GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators);
65 //Get sequence of operators.
67 Standard_EXPORT void SetParameter(const TCollection_AsciiString& theNameParam,
68 const TCollection_AsciiString& theVal);
69 //Set value of specified parameter different than value written in the resourse file.
71 Standard_EXPORT Standard_Boolean GetParameter(const TCollection_AsciiString& theNameParam,
72 TCollection_AsciiString& theVal);
73 //Get value of parameter by it's name.
75 inline void SetSaveHistoryMode(const Standard_Boolean theSaveHistory,
76 TopAbs_ShapeEnum theuntil = TopAbs_FACE)
78 mySaveHistoryMode = theSaveHistory;
81 //Set SaveHistoryMode nnd level of the shapes until history will be saved to the
85 inline Standard_Boolean GetSaveHistoryMode()
87 return mySaveHistoryMode;
89 //Returns SaveHistoryMode.
91 inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
92 TopoDS_Shape& theNewShape)
94 Standard_Boolean isModif = (!myMapModifications.IsEmpty() &&
95 myMapModifications.IsBound(theOldShape));
97 theNewShape = myMapModifications.Find(theOldShape);
99 theNewShape = theOldShape;
102 //Get modified shape for any specified shape
104 inline Standard_Boolean isDone()
108 //returns status of operation.
110 // ---------- PROTECTED METHODS ----------
115 // ---------- PRIVATE FIELDS ----------
117 //Handle(Resource_Manager) myResource;
118 ShapeProcessAPI_ApplySequence myOperations;
119 TCollection_AsciiString myPrefix;
120 TopTools_DataMapOfShapeShape myMapModifications;
121 Standard_Boolean mySaveHistoryMode;
122 TopAbs_ShapeEnum myLevel;
123 Standard_Boolean myDone;
125 // Declaration of CASCADE RTTI
126 //DEFINE_STANDARD_RTTI (ShHealOper_ShapeProcess)
129 // Definition of HANDLE object using Standard_DefineHandle.hxx
130 //DEFINE_STANDARD_HANDLE (ShHealOper_ShapeProcess, )