1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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 #include "ShHealOper_Tool.hxx"
40 /// Class ShHealOper_ShapeProcess
41 //Class for performing Shape healing operations on the shape.
43 class ShHealOper_ShapeProcess : public ShHealOper_Tool
46 // ---------- PUBLIC METHODS ----------
49 Standard_EXPORT ShHealOper_ShapeProcess();
50 //Constuctor initializes by defaults parameters
51 // (name of resource file - ShHealing, prefix - ShapeProcess,
52 // SaveHistory = Standard_False, level = TopAbs_FACE)
55 Standard_EXPORT ShHealOper_ShapeProcess
56 (const TCollection_AsciiString& theNameResource,
57 const TCollection_AsciiString& thePrefix = "ShapeProcess");
58 //Constuctor initializes by specified name of resource file and prefix
60 Standard_EXPORT void Perform(const TopoDS_Shape& theOldShape,
61 TopoDS_Shape& theNewShape);
62 //Perform modifications of specified shape.
64 Standard_EXPORT void SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators);
65 //Set sequence of operatotrs different than sequence written in the resourse file.
67 Standard_EXPORT Standard_Boolean GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators);
68 //Get sequence of operators.
70 Standard_EXPORT void SetParameter(const TCollection_AsciiString& theNameParam,
71 const TCollection_AsciiString& theVal);
72 //Set value of specified parameter different than value written in the resourse file.
74 Standard_EXPORT Standard_Boolean GetParameter(const TCollection_AsciiString& theNameParam,
75 TCollection_AsciiString& theVal);
76 //Get value of parameter by it's name.
78 inline void SetSaveHistoryMode(const Standard_Boolean theSaveHistory,
79 TopAbs_ShapeEnum theuntil = TopAbs_FACE)
81 mySaveHistoryMode = theSaveHistory;
84 //Set SaveHistoryMode nnd level of the shapes until history will be saved to the
88 inline Standard_Boolean GetSaveHistoryMode()
90 return mySaveHistoryMode;
92 //Returns SaveHistoryMode.
94 inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
95 TopoDS_Shape& theNewShape)
97 Standard_Boolean isModif = (!myMapModifications.IsEmpty() &&
98 myMapModifications.IsBound(theOldShape));
100 theNewShape = myMapModifications.Find(theOldShape);
102 theNewShape = theOldShape;
105 //Get modified shape for any specified shape
107 inline Standard_Boolean isDone()
111 //returns status of operation.
113 // ---------- PROTECTED METHODS ----------
118 // ---------- PRIVATE FIELDS ----------
120 //Handle(Resource_Manager) myResource;
121 ShapeProcessAPI_ApplySequence myOperations;
122 TCollection_AsciiString myPrefix;
123 TopTools_DataMapOfShapeShape myMapModifications;
124 Standard_Boolean mySaveHistoryMode;
125 TopAbs_ShapeEnum myLevel;
126 Standard_Boolean myDone;
128 // Declaration of CASCADE RTTI
129 //DEFINE_STANDARD_RTTI (ShHealOper_ShapeProcess)
132 // Definition of HANDLE object using Standard_DefineHandle.hxx
133 //DEFINE_STANDARD_HANDLE (ShHealOper_ShapeProcess, )