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