Salome HOME
Synchronize adm files
[modules/geom.git] / src / ShHealOper / ShHealOper_ShapeProcess.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // File:      ShHealOper_ShapeProcess.hxx
24 // Created:   13.04.04 11:45:20
25 // Author:    Galina KULIKOVA
26 //
27 #ifndef ShHealOper_ShapeProcess_HeaderFile
28 #define ShHealOper_ShapeProcess_HeaderFile
29
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>
37
38 ///  Class ShHealOper_ShapeProcess
39 //Class for performing Shape healing operations on the shape.
40
41 class ShHealOper_ShapeProcess 
42 {
43  public:
44   // ---------- PUBLIC METHODS ----------
45
46   /// Empty constructor
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)
51
52   /// Copy constructor
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
57   
58   Standard_EXPORT void Perform(const TopoDS_Shape& theOldShape, 
59                                            TopoDS_Shape& theNewShape);
60   //Perform modifications of specified shape.
61   
62   Standard_EXPORT void SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators);
63   //Set sequence of operatotrs different than sequence written in the resourse file.
64   
65   Standard_EXPORT Standard_Boolean GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators);
66   //Get sequence of operators.
67
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.
71   
72   Standard_EXPORT Standard_Boolean GetParameter(const TCollection_AsciiString& theNameParam,
73                                        TCollection_AsciiString& theVal);
74   //Get value of parameter by it's name.
75
76  inline void SetSaveHistoryMode(const Standard_Boolean theSaveHistory,
77                                 TopAbs_ShapeEnum theuntil = TopAbs_FACE)
78  {
79    mySaveHistoryMode = theSaveHistory;
80    myLevel = theuntil;
81  }
82   //Set SaveHistoryMode nnd level of the shapes until history will be saved to the
83   //specified values.
84
85
86   inline Standard_Boolean GetSaveHistoryMode()
87   {
88     return mySaveHistoryMode;
89   }
90   //Returns SaveHistoryMode.
91   
92   inline Standard_Boolean GetModifiedShape(const TopoDS_Shape& theOldShape,
93                                            TopoDS_Shape& theNewShape)
94   {
95     Standard_Boolean isModif = (!myMapModifications.IsEmpty() && 
96                                 myMapModifications.IsBound(theOldShape));
97     if(isModif)
98       theNewShape = myMapModifications.Find(theOldShape);
99     else
100       theNewShape = theOldShape;
101     return isModif;
102   }
103   //Get modified shape for any specified shape
104   
105   inline Standard_Boolean isDone()
106   {
107     return myDone;
108   }
109   //returns status of operation.
110  protected:
111   // ---------- PROTECTED METHODS ----------
112
113
114
115  private:
116   // ---------- PRIVATE FIELDS ----------
117
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;
125  public:
126 // Declaration of CASCADE RTTI
127 //DEFINE_STANDARD_RTTI (ShHealOper_ShapeProcess)
128 };
129
130 // Definition of HANDLE object using Standard_DefineHandle.hxx
131 //DEFINE_STANDARD_HANDLE (ShHealOper_ShapeProcess, )
132
133
134 #endif