]> SALOME platform Git repositories - modules/geom.git/blob - src/RepairGUI/RepairGUI_ShapeProcessDlg.h
Salome HOME
Fix issue 0020479: EDF 1116 GEOM: Create a group, "Add" button is inactive but "Selec...
[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
25 //  Module : GEOM
26 //
27 #ifndef DIALOGBOX_ShapeProcess_H
28 #define DIALOGBOX_ShapeProcess_H
29
30 #include "GEOMBase_Skeleton.h"
31 #include "DlgRef_1Sel_QTD.h"
32 #include "RepairGUI.h"
33 #include "QtxDblSpinBox.h"
34
35 #include <qspinbox.h>
36 #include <qcombobox.h>
37 #include <qcheckbox.h>
38 #include <qlistview.h>
39 #include <qwidgetstack.h>
40 #include <qvaluelist.h>
41 #include <qdict.h>
42 #include <qmap.h>
43
44 //=================================================================================
45 // class    : RepairGUI_ShapeProcessDlg
46 // purpose  :
47 //=================================================================================
48 class RepairGUI_ShapeProcessDlg : public GEOMBase_Skeleton
49
50     Q_OBJECT
51
52 public:
53     RepairGUI_ShapeProcessDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
54                               const char* name = 0, bool modal = FALSE, WFlags fl = 0);
55     ~RepairGUI_ShapeProcessDlg();
56
57 protected:
58     // redefined from GEOMBase_Helper
59     virtual GEOM::GEOM_IOperations_ptr createOperation();
60     virtual bool isValid( QString& );
61     virtual bool execute( ObjectList& objects );
62
63     virtual void closeEvent( QCloseEvent* e );        
64
65 private:
66     void             init();
67     void             reset();
68     void             loadDefaults(); // initialize all controls with default values (from resource file)
69
70     GEOM::string_array* getActiveOperators();
71     GEOM::string_array* getParameters( const GEOM::string_array& theOperators );
72     GEOM::string_array* getValues( const GEOM::string_array& theParameters );
73
74     void             enterEvent(QEvent* e);
75
76     QWidget*         getControl( const char* );
77     void             setValue( QWidget*, const char* ); // initialize the given control in the proper way
78                                                         // (analize its class and convert the value string)
79     const char*      getValue( QWidget* theControl ) const; // retrieve value of the control in the proper way
80
81     QStringList      myOpLst; // list of available Shape Healing Operators
82     QMap<QString,QStringList> myValMap; // map of parameters of operators
83     //QDict<QString,QWidget*> myCtrlMap;  // map of controls (values) of parameters
84     void             initParamsValues(); // initialize the data structures
85     void             initSelection();
86
87     GEOM::ListOfGO_var myObjects;  // selected objects
88
89     DlgRef_1Sel_QTD* mySelectWdgt;
90     QListView*       myOpList;
91     QWidgetStack*    myStack;
92
93     QtxDblSpinBox*   myFixShapeTol3D;
94     QtxDblSpinBox*   myFixShapeMaxTol3D;
95
96     QtxDblSpinBox*   myFixFaceSizeTol;
97
98     QtxDblSpinBox*   myDropSmallEdgesTol3D;
99
100     QtxDblSpinBox*   mySplitAngleAngle;
101     QtxDblSpinBox*   mySplitAngleMaxTol;
102
103     QSpinBox*        mySplitClosedFacesNum;
104
105     QtxDblSpinBox*   mySplitContTol3D;
106     QComboBox*       mySplitContSurfCont;
107     QComboBox*       mySplitContCurvCont;
108
109     QCheckBox*       myBSplineSurfModeChk;
110     QCheckBox*       myBSpline3DCurveChk;
111     QCheckBox*       myBSpline2DCurveChk;
112     QtxDblSpinBox*   myBSplineTol3D;
113     QtxDblSpinBox*   myBSplineTol2D;
114     QSpinBox*        myBSplineDegree;
115     QSpinBox*        myBSplineSegments;
116     QComboBox*       myBSpline2DCont;
117     QComboBox*       myBSpline3DCont;
118
119     QCheckBox*       myToBezierSurfModeChk;
120     QCheckBox*       myToBezier3DCurveChk;
121     QCheckBox*       myToBezier2DCurveChk;
122     QtxDblSpinBox*   myToBezierMaxTol;
123
124     QtxDblSpinBox*   mySameParameterTol3D;
125     
126 private slots:
127     void             onOk();
128     bool             onApply();
129
130     void             activate();
131
132     void             lineEditReturnPressed();
133     void             selectionChanged();
134     void             selectClicked();
135     void             operationChanged();
136     void             advOptionToggled(bool);
137 };             
138
139 #endif // DIALOGBOX_ShapeProcess_H