1 // File: ShHealOper_ShapeProcess.hxx
2 // Created: 13.04.04 11:45:20
3 // Author: Galina KULIKOVA
4 // < MODULE = KERNEL> <PACKAGE = ShHealOper> : <Shape Healing Operations>
5 // Copyright (C) 2003 CEA
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef ShHealOper_ShapeProcess_HeaderFile
25 #define ShHealOper_ShapeProcess_HeaderFile
27 #include <Resource_Manager.hxx>
28 #include <TopoDS_Shape.hxx>
29 #include <TopTools_DataMapOfShapeShape.hxx>
30 #include <TColStd_SequenceOfAsciiString.hxx>
31 #include <TCollection_AsciiString.hxx>
32 #include <ShapeProcessAPI_ApplySequence.hxx>
33 #include <ShapeProcess_ShapeContext.hxx>
35 /// Class ShHealOper_ShapeProcess
36 //Class for performing Shape healing operations on the shape.
38 class ShHealOper_ShapeProcess
41 // ---------- PUBLIC METHODS ----------
44 Standard_EXPORT ShHealOper_ShapeProcess();
45 //Constuctor initializes by defaults parameters
46 // (name of resource file - ShHealing, prefix - ShapeProcess,
47 // SaveHistory = Standard_False, level = TopAbs_FACE)
50 Standard_EXPORT ShHealOper_ShapeProcess
51 (const TCollection_AsciiString& theNameResource,
52 const TCollection_AsciiString& thePrefix = "ShapeProcess");
53 //Constuctor initializes by specified name of resource file and prefix
55 Standard_EXPORT void Perform(const TopoDS_Shape& theOldShape,
56 TopoDS_Shape& theNewShape);
57 //Perform modifications of specified shape.
59 Standard_EXPORT void SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators);
60 //Set sequence of operatotrs different than sequence written in the resourse file.
62 Standard_EXPORT Standard_Boolean GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators);
63 //Get sequence of operators.
65 Standard_EXPORT void SetParameter(const TCollection_AsciiString& theNameParam,
66 const TCollection_AsciiString& theVal);
67 //Set value of specified parameter different than value written in the resourse file.
69 Standard_EXPORT Standard_Boolean GetParameter(const TCollection_AsciiString& theNameParam,
70 TCollection_AsciiString& theVal);
71 //Get value of parameter by it's name.
73 inline void SetSaveHistoryMode(const Standard_Boolean theSaveHistory,
74 TopAbs_ShapeEnum theuntil = TopAbs_FACE)
76 mySaveHistoryMode = theSaveHistory;
79 //Set SaveHistoryMode nnd level of the shapes until history will be saved to the
83 inline Standard_Boolean GetSaveHistoryMode()
85 return mySaveHistoryMode;
87 //Returns SaveHistoryMode.
89 inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
90 TopoDS_Shape& theNewShape)
92 Standard_Boolean isModif = (!myMapModifications.IsEmpty() &&
93 myMapModifications.IsBound(theOldShape));
95 theNewShape = myMapModifications.Find(theOldShape);
97 theNewShape = theOldShape;
100 //Get modified shape for any specified shape
102 inline Standard_Boolean isDone()
106 //returns status of operation.
108 // ---------- PROTECTED METHODS ----------
113 // ---------- PRIVATE FIELDS ----------
115 //Handle(Resource_Manager) myResource;
116 ShapeProcessAPI_ApplySequence myOperations;
117 TCollection_AsciiString myPrefix;
118 TopTools_DataMapOfShapeShape myMapModifications;
119 Standard_Boolean mySaveHistoryMode;
120 TopAbs_ShapeEnum myLevel;
121 Standard_Boolean myDone;
123 // Declaration of CASCADE RTTI
124 //DEFINE_STANDARD_RTTI (ShHealOper_ShapeProcess)
127 // Definition of HANDLE object using Standard_DefineHandle.hxx
128 //DEFINE_STANDARD_HANDLE (ShHealOper_ShapeProcess, )