Salome HOME
22752: [EDF] Provide explicit feedback on what has been done by Shape Processing...
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IHealing.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 #include "GEOM_Function.hxx"
24
25 #include <TColStd_HArray1OfInteger.hxx>
26 #include <TColStd_HArray1OfExtendedString.hxx>
27 #include "TColStd_HSequenceOfTransient.hxx"
28 #include <ShHealOper_ModifStats.hxx>
29
30 class GEOMImpl_IHealing
31 {
32 public:
33
34   enum {
35     ARG_SHAPE_PROCESS_OPERATORS =  1,
36     ARG_SHAPE_PROCESS_PARAMS    =  2,
37     ARG_SHAPE_PROCESS_VALUES    =  3,
38     ARG_ORIGINAL                =  4,
39     ARG_LIST_ARGUMENTS          =  5,
40     ARG_IS_COMMON_VERTEX        =  6,
41     ARG_TOLERANCE               =  7,
42     ARG_DEV_EDGE_VALUE          =  8,
43     ARG_IS_BY_PARAMETER         =  9,
44     ARG_SUBSHAPE_INDEX          = 10,
45     ARG_LIST_SHAPES             = 11,
46     ARG_STATISTICS              =  4
47   };
48
49   GEOMImpl_IHealing(Handle(GEOM_Function) theFunction): _func(theFunction) {}
50
51   void SetOperators( const Handle(TColStd_HArray1OfExtendedString)& arr ) {  if ( !arr.IsNull() ) _func->SetStringArray(ARG_SHAPE_PROCESS_OPERATORS, arr); }
52   Handle(TColStd_HArray1OfExtendedString) GetOperators() { return _func->GetStringArray(ARG_SHAPE_PROCESS_OPERATORS); }
53
54   void SetParameters( const Handle(TColStd_HArray1OfExtendedString)& arr ) {  if ( !arr.IsNull() ) _func->SetStringArray(ARG_SHAPE_PROCESS_PARAMS, arr); }
55   Handle(TColStd_HArray1OfExtendedString) GetParameters() { return _func->GetStringArray(ARG_SHAPE_PROCESS_PARAMS); }
56
57   void SetValues( const Handle(TColStd_HArray1OfExtendedString)& arr ) {  if ( !arr.IsNull() ) _func->SetStringArray(ARG_SHAPE_PROCESS_VALUES, arr); }
58   Handle(TColStd_HArray1OfExtendedString) GetValues() { return _func->GetStringArray(ARG_SHAPE_PROCESS_VALUES); }
59
60   void SetOriginal( Handle(GEOM_Function) f ) { _func->SetReference(ARG_ORIGINAL, f); }
61   Handle(GEOM_Function) GetOriginal() { return _func->GetReference(ARG_ORIGINAL); }
62
63   void SetFaces( const Handle(TColStd_HArray1OfInteger)& arr ) { if ( !arr.IsNull() ) _func->SetIntegerArray(ARG_LIST_ARGUMENTS, arr); }
64   Handle(TColStd_HArray1OfInteger) GetFaces() { return _func->GetIntegerArray(ARG_LIST_ARGUMENTS); }
65
66   void SetWires( const Handle(TColStd_HArray1OfInteger)& arr ) { if ( !arr.IsNull() ) _func->SetIntegerArray(ARG_LIST_ARGUMENTS, arr); }
67   Handle(TColStd_HArray1OfInteger) GetWires() { return _func->GetIntegerArray(ARG_LIST_ARGUMENTS); }
68
69   void SetIsCommonVertex( Standard_Boolean val ) { _func->SetInteger(ARG_IS_COMMON_VERTEX, val ? 1 : 0 ); }
70   Standard_Boolean GetIsCommonVertex() { return (_func->GetInteger(ARG_IS_COMMON_VERTEX) != 0 ); }
71
72   void SetIsByParameter( Standard_Boolean val ) { _func->SetInteger(ARG_IS_BY_PARAMETER, val ? 1 : 0 ); }
73   Standard_Boolean GetIsByParameter() { return (_func->GetInteger(ARG_IS_BY_PARAMETER) != 0 ); }
74
75   void SetTolerance( Standard_Real val ) { _func->SetReal(ARG_TOLERANCE, val); }
76   Standard_Real GetTolerance() { return _func->GetReal(ARG_TOLERANCE); }
77
78   void SetDevideEdgeValue( Standard_Real val ) { _func->SetReal(ARG_DEV_EDGE_VALUE, val); }
79   Standard_Real GetDevideEdgeValue() { return _func->GetReal(ARG_DEV_EDGE_VALUE); }
80
81   void SetIndex( Standard_Integer val ) { _func->SetInteger(ARG_SUBSHAPE_INDEX, val); }
82   Standard_Integer GetIndex() { return _func->GetInteger(ARG_SUBSHAPE_INDEX); }
83
84   void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
85   { _func->SetReferenceList(ARG_LIST_SHAPES, theShapes); }
86   Handle(TColStd_HSequenceOfTransient) GetShapes()
87   { return _func->GetReferenceList(ARG_LIST_SHAPES); }
88
89   Handle(TColStd_HSequenceOfTransient) GetOriginalAndShapes()
90   {
91     Handle(TColStd_HSequenceOfTransient) funs = GetShapes();
92     if ( funs.IsNull() ) funs = new TColStd_HSequenceOfTransient;
93     funs->Prepend( GetOriginal() );
94     return funs;
95   }
96
97   void SetStatistics( ShHealOper_ModifStats * ms )
98   {
99     if ( ms ) ms->Clear();
100     _func->SetCallBackData( (void*) ms );
101   }
102   ShHealOper_ModifStats * GetStatistics()
103   {
104     return (ShHealOper_ModifStats*) _func->GetCallBackData();
105   }
106
107 private:
108   Handle(GEOM_Function) _func;
109 };