00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // GEOM GEOMGUI : GUI for Geometry component 00024 // File : RepairGUI_ShapeProcessDlg.h 00025 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S. 00026 // 00027 #ifndef REPAIRGUI_SHAPEPROCESSDLG_H 00028 #define REPAIRGUI_SHAPEPROCESSDLG_H 00029 00030 #include <GEOMBase_Skeleton.h> 00031 00032 #include <QMap> 00033 00034 class DlgRef_1Sel; 00035 class SalomeApp_IntSpinBox; 00036 class SalomeApp_DoubleSpinBox; 00037 class QComboBox; 00038 class QCheckBox; 00039 class QListWidget; 00040 00041 //================================================================================= 00042 // class : RepairGUI_ShapeProcessDlg 00043 // purpose : 00044 //================================================================================= 00045 class RepairGUI_ShapeProcessDlg : public GEOMBase_Skeleton 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 RepairGUI_ShapeProcessDlg( GeometryGUI*, QWidget* = 0, bool = false ); 00051 ~RepairGUI_ShapeProcessDlg(); 00052 00053 protected: 00054 // redefined from GEOMBase_Helper 00055 virtual GEOM::GEOM_IOperations_ptr createOperation(); 00056 virtual bool isValid( QString& ); 00057 virtual bool execute( ObjectList& ); 00058 00059 private: 00060 void init(); 00061 void reset(); 00062 void loadDefaults(); // initialize all controls with default values (from resource file) 00063 00064 GEOM::string_array* getActiveOperators(); 00065 GEOM::string_array* getParameters( const GEOM::string_array& ); 00066 GEOM::string_array* getValues( const GEOM::string_array& ); 00067 00068 QStringList getTexts( const GEOM::string_array& ); 00069 00070 void enterEvent( QEvent* ); 00071 00072 QWidget* getControl( const QString& ); 00073 void setValue( QWidget*, const QString& ); // initialize the given control in the proper way 00074 // (analize its class and convert the value string) 00075 QString getValue( QWidget* ) const; // retrieve value of the control in the proper way 00076 QString getText( QWidget* ) const; // retrieve text of the control (for spin-boxes only) 00077 00078 //QDict<QString,QWidget*> myCtrlMap; // map of controls (values) of parameters 00079 void initParamsValues(); // initialize the data structures 00080 void initSelection(); 00081 00082 private: 00083 QStringList myOpLst; // list of available Shape Healing Operators 00084 QMap<QString,QStringList> myValMap; // map of parameters of operators 00085 00086 GEOM::ListOfGO_var myObjects; // selected objects 00087 00088 DlgRef_1Sel* mySelectWdgt; 00089 QListWidget* myOpList; 00090 00091 SalomeApp_DoubleSpinBox* myFixShapeTol3D; 00092 SalomeApp_DoubleSpinBox* myFixShapeMaxTol3D; 00093 00094 SalomeApp_DoubleSpinBox* myFixFaceSizeTol; 00095 00096 SalomeApp_DoubleSpinBox* myDropSmallEdgesTol3D; 00097 00098 SalomeApp_DoubleSpinBox* mySplitAngleAngle; 00099 SalomeApp_DoubleSpinBox* mySplitAngleMaxTol; 00100 00101 SalomeApp_IntSpinBox* mySplitClosedFacesNum; 00102 00103 SalomeApp_DoubleSpinBox* mySplitContTol3D; 00104 QComboBox* mySplitContSurfCont; 00105 QComboBox* mySplitContCurvCont; 00106 00107 QCheckBox* myBSplineSurfModeChk; 00108 QCheckBox* myBSpline3DCurveChk; 00109 QCheckBox* myBSpline2DCurveChk; 00110 SalomeApp_DoubleSpinBox* myBSplineTol3D; 00111 SalomeApp_DoubleSpinBox* myBSplineTol2D; 00112 SalomeApp_IntSpinBox* myBSplineDegree; 00113 SalomeApp_IntSpinBox* myBSplineSegments; 00114 QComboBox* myBSpline2DCont; 00115 QComboBox* myBSpline3DCont; 00116 00117 QCheckBox* myToBezierSurfModeChk; 00118 QCheckBox* myToBezier3DCurveChk; 00119 QCheckBox* myToBezier2DCurveChk; 00120 SalomeApp_DoubleSpinBox* myToBezierMaxTol; 00121 00122 SalomeApp_DoubleSpinBox* mySameParameterTol3D; 00123 00124 private slots: 00125 void onOk(); 00126 bool onApply(); 00127 00128 void activate(); 00129 00130 void lineEditReturnPressed(); 00131 void selectionChanged(); 00132 void selectClicked(); 00133 void advOptionToggled( bool ); 00134 }; 00135 00136 #endif // REPAIRGUI_SHAPEPROCESSDLG_H