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 // File : StdMeshersGUI_NbSegmentsCreator.h 00024 // Author : Open CASCADE S.A.S. 00025 // 00026 #ifndef STDMESHERSGUI_NBSEGMENTSCREATOR_H 00027 #define STDMESHERSGUI_NBSEGMENTSCREATOR_H 00028 00029 // SMESH includes 00030 #include "SMESH_StdMeshersGUI.hxx" 00031 00032 #include "StdMeshersGUI_StdHypothesisCreator.h" 00033 00034 // IDL includes 00035 #include <SALOMEconfig.h> 00036 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00037 00038 class SalomeApp_IntSpinBox; 00039 class QtxComboBox; 00040 class SMESHGUI_SpinBox; 00041 class StdMeshersGUI_DistrTableFrame; 00042 class StdMeshersGUI_DistrPreview; 00043 class QLineEdit; 00044 class QButtonGroup; 00045 class QGroupBox; 00046 class QGridLayout; 00047 class QRadioButton; 00048 class StdMeshersGUI_SubShapeSelectorWdg; 00049 00050 typedef struct 00051 { 00052 int myNbSeg, myDistrType, myConv; 00053 double myScale; 00054 SMESH::double_array myTable; 00055 QString myName, myExpr; 00056 QString myNbSegVarName, myScaleVarName; 00057 00058 } NbSegmentsHypothesisData; 00059 00060 class STDMESHERSGUI_EXPORT StdMeshersGUI_NbSegmentsCreator : public StdMeshersGUI_StdHypothesisCreator 00061 { 00062 Q_OBJECT 00063 00064 public: 00065 StdMeshersGUI_NbSegmentsCreator(); 00066 virtual ~StdMeshersGUI_NbSegmentsCreator(); 00067 00068 virtual bool checkParams( QString& ) const; 00069 00070 protected: 00071 virtual QFrame* buildFrame(); 00072 virtual void retrieveParams() const; 00073 virtual QString storeParams() const; 00074 00075 protected slots: 00076 virtual void onValueChanged(); 00077 00078 private: 00079 bool readParamsFromHypo( NbSegmentsHypothesisData& ) const; 00080 bool readParamsFromWidgets( NbSegmentsHypothesisData& ) const; 00081 bool storeParamsToHypo( const NbSegmentsHypothesisData& ) const; 00082 00083 private: 00084 SalomeApp_IntSpinBox* myNbSeg; 00085 QtxComboBox* myDistr; 00086 SMESHGUI_SpinBox* myScale; 00087 StdMeshersGUI_DistrTableFrame* myTable; 00088 StdMeshersGUI_DistrPreview* myPreview; 00089 QLineEdit *myName, *myExpr; 00090 QGroupBox* myConvBox; 00091 QButtonGroup* myConv; 00092 QLabel *myLScale, *myLTable, *myLExpr, *myInfo; 00093 QGridLayout* myGroupLayout; 00094 int myTableRow, myPreviewRow; 00095 //QRadioButton* myCutNeg; 00096 QGroupBox* myReversedEdgesBox; 00097 00098 StdMeshersGUI_SubShapeSelectorWdg* myDirectionWidget; 00099 }; 00100 00101 #endif // STDMESHERSGUI_NBSEGMENTSCREATOR_H