Salome HOME
Update copyright information
[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 QSpinBox;
35 class QtxDoubleSpinBox;
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   void                               enterEvent( QEvent* );
68
69   QWidget*                           getControl( const QString&  );
70   void                               setValue( QWidget*, const QString& ); // initialize the given control in the proper way
71   // (analize its class and convert the value string)
72   QString                            getValue( QWidget* ) const; // retrieve value of the control in the proper way
73
74   //QDict<QString,QWidget*>            myCtrlMap;  // map of controls (values) of parameters
75   void                               initParamsValues(); // initialize the data structures
76   void                               initSelection();
77
78 private:
79   QStringList                        myOpLst; // list of available Shape Healing Operators
80   QMap<QString,QStringList>          myValMap; // map of parameters of operators
81
82   GEOM::ListOfGO_var                 myObjects;  // selected objects
83   
84   DlgRef_1Sel*                       mySelectWdgt;
85   QListWidget*                       myOpList;
86   
87   QtxDoubleSpinBox*                  myFixShapeTol3D;
88   QtxDoubleSpinBox*                  myFixShapeMaxTol3D;
89
90   QtxDoubleSpinBox*                  myFixFaceSizeTol;
91   
92   QtxDoubleSpinBox*                  myDropSmallEdgesTol3D;
93
94   QtxDoubleSpinBox*                  mySplitAngleAngle;
95   QtxDoubleSpinBox*                  mySplitAngleMaxTol;
96   
97   QSpinBox*                          mySplitClosedFacesNum;
98   
99   QtxDoubleSpinBox*                  mySplitContTol3D;
100   QComboBox*                         mySplitContSurfCont;
101   QComboBox*                         mySplitContCurvCont;
102   
103   QCheckBox*                         myBSplineSurfModeChk;
104   QCheckBox*                         myBSpline3DCurveChk;
105   QCheckBox*                         myBSpline2DCurveChk;
106   QtxDoubleSpinBox*                  myBSplineTol3D;
107   QtxDoubleSpinBox*                  myBSplineTol2D;
108   QSpinBox*                          myBSplineDegree;
109   QSpinBox*                          myBSplineSegments;
110   QComboBox*                         myBSpline2DCont;
111   QComboBox*                         myBSpline3DCont;
112   
113   QCheckBox*                         myToBezierSurfModeChk;
114   QCheckBox*                         myToBezier3DCurveChk;
115   QCheckBox*                         myToBezier2DCurveChk;
116   QtxDoubleSpinBox*                  myToBezierMaxTol;
117   
118   QtxDoubleSpinBox*                  mySameParameterTol3D;
119   
120 private slots:
121   void                               onOk();
122   bool                               onApply();
123
124   void                               activate();
125   
126   void                               lineEditReturnPressed();
127   void                               selectionChanged();
128   void                               selectClicked();
129   void                               advOptionToggled( bool );
130 };             
131
132 #endif // REPAIRGUI_SHAPEPROCESSDLG_H