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