Salome HOME
4a6480220edf7b37b06093d9be699eeeb8d963b7
[modules/geom.git] / src / RepairGUI / RepairGUI_ShapeProcessDlg.h
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 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : RepairGUI_ShapeProcessDlg.h
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 //
27 #ifndef REPAIRGUI_SHAPEPROCESSDLG_H
28 #define REPAIRGUI_SHAPEPROCESSDLG_H
29
30 #include <GEOMBase_Skeleton.h>
31
32 #include <QMap>
33
34 class DlgRef_1Sel;
35 class SalomeApp_IntSpinBox;
36 class SalomeApp_DoubleSpinBox;
37 class QComboBox;
38 class QCheckBox;
39 class QListWidget;
40
41 //=================================================================================
42 // class    : RepairGUI_ShapeProcessDlg
43 // purpose  :
44 //=================================================================================
45 class RepairGUI_ShapeProcessDlg : public GEOMBase_Skeleton
46
47   Q_OBJECT
48
49 public:
50   RepairGUI_ShapeProcessDlg( GeometryGUI*, QWidget* = 0, bool = false );
51   ~RepairGUI_ShapeProcessDlg();
52   
53 protected:
54   // redefined from GEOMBase_Helper
55   virtual GEOM::GEOM_IOperations_ptr createOperation();
56   virtual bool                       isValid( QString& );
57   virtual bool                       execute( ObjectList&  );
58   
59 private:
60   void                               init();
61   void                               reset();
62   void                               loadDefaults(); // initialize all controls with default values (from resource file)
63     
64   GEOM::string_array*                getActiveOperators();
65   GEOM::string_array*                getParameters( const GEOM::string_array& );
66   GEOM::string_array*                getValues( const GEOM::string_array& );
67
68   QStringList                        getTexts( const GEOM::string_array& );
69
70   void                               enterEvent( QEvent* );
71
72   QWidget*                           getControl( const QString&  );
73   void                               setValue( QWidget*, const QString& ); // initialize the given control in the proper way
74   // (analize its class and convert the value string)
75   QString                            getValue( QWidget* ) const; // retrieve value of the control in the proper way
76   QString                            getText( QWidget* ) const; // retrieve text of the control (for spin-boxes only)
77
78   //QDict<QString,QWidget*>            myCtrlMap;  // map of controls (values) of parameters
79   void                               initParamsValues(); // initialize the data structures
80   void                               initSelection();
81
82 private:
83   QStringList                        myOpLst; // list of available Shape Healing Operators
84   QMap<QString,QStringList>          myValMap; // map of parameters of operators
85
86   GEOM::ListOfGO_var                 myObjects;  // selected objects
87   
88   DlgRef_1Sel*                       mySelectWdgt;
89   QListWidget*                       myOpList;
90   
91   SalomeApp_DoubleSpinBox*           myFixShapeTol3D;
92   SalomeApp_DoubleSpinBox*           myFixShapeMaxTol3D;
93
94   SalomeApp_DoubleSpinBox*           myFixFaceSizeTol;
95   
96   SalomeApp_DoubleSpinBox*           myDropSmallEdgesTol3D;
97
98   SalomeApp_DoubleSpinBox*           mySplitAngleAngle;
99   SalomeApp_DoubleSpinBox*           mySplitAngleMaxTol;
100   
101   SalomeApp_IntSpinBox*              mySplitClosedFacesNum;
102   
103   SalomeApp_DoubleSpinBox*           mySplitContTol3D;
104   QComboBox*                         mySplitContSurfCont;
105   QComboBox*                         mySplitContCurvCont;
106   
107   QCheckBox*                         myBSplineSurfModeChk;
108   QCheckBox*                         myBSpline3DCurveChk;
109   QCheckBox*                         myBSpline2DCurveChk;
110   SalomeApp_DoubleSpinBox*           myBSplineTol3D;
111   SalomeApp_DoubleSpinBox*           myBSplineTol2D;
112   SalomeApp_IntSpinBox*              myBSplineDegree;
113   SalomeApp_IntSpinBox*              myBSplineSegments;
114   QComboBox*                         myBSpline2DCont;
115   QComboBox*                         myBSpline3DCont;
116   
117   QCheckBox*                         myToBezierSurfModeChk;
118   QCheckBox*                         myToBezier3DCurveChk;
119   QCheckBox*                         myToBezier2DCurveChk;
120   SalomeApp_DoubleSpinBox*           myToBezierMaxTol;
121   
122   SalomeApp_DoubleSpinBox*           mySameParameterTol3D;
123   
124 private slots:
125   void                               onOk();
126   bool                               onApply();
127
128   void                               activate();
129   
130   void                               lineEditReturnPressed();
131   void                               selectionChanged();
132   void                               selectClicked();
133   void                               advOptionToggled( bool );
134 };             
135
136 #endif // REPAIRGUI_SHAPEPROCESSDLG_H