1 // SMESH StdMeshersGUI : GUI for StdMeshers plugin
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : StdMeshersGUI_CreateStdHypothesisDlg.cxx
25 // Moved here from SMESHGUI_CreateStdHypothesisDlg.cxx
26 // Author : Nicolas REJNERI
31 #include "StdMeshersGUI_CreateStdHypothesisDlg.h"
32 #include "StdMeshersGUI_Parameters.h"
34 #include "SMESHGUI_Hypotheses.h"
36 #include "utilities.h"
38 #include "SALOMEGUI_QtCatchCorbaException.hxx"
39 #include "QAD_MessageBox.h"
40 #include "QAD_WaitCursor.h"
41 #include "QAD_Desktop.h"
43 //=================================================================================
44 // class : StdMeshersGUI_CreateStdHypothesisDlg()
46 //=================================================================================
47 StdMeshersGUI_CreateStdHypothesisDlg::StdMeshersGUI_CreateStdHypothesisDlg (const QString& hypType,
52 : StdMeshersGUI_CreateHypothesisDlg (hypType, parent, name, modal, fl)
55 if (hypType.compare("LocalLength") == 0)
56 hypTypeStr = "LOCAL_LENGTH";
57 else if (hypType.compare("NumberOfSegments") == 0)
58 hypTypeStr = "NB_SEGMENTS";
59 else if (hypType.compare("MaxElementArea") == 0)
60 hypTypeStr = "MAX_ELEMENT_AREA";
61 else if (hypType.compare("MaxElementVolume") == 0)
62 hypTypeStr = "MAX_ELEMENT_VOLUME";
63 else if (hypType.compare("StartEndLength") == 0)
64 hypTypeStr = "START_END_LENGTH";
65 else if (hypType.compare("Deflection1D") == 0)
66 hypTypeStr = "DEFLECTION1D";
67 else if (hypType.compare("Arithmetic1D") == 0)
68 hypTypeStr = "ARITHMETIC_1D";
72 QString caption( tr ( QString( "SMESH_%1_TITLE" ).arg( hypTypeStr )));
73 QString hypTypeName( tr ( QString( "SMESH_%1_HYPOTHESIS" ).arg( hypTypeStr )));
74 QString hypIconName( tr ( QString( "ICON_DLG_%1" ).arg( hypTypeStr )));
76 CreateDlgLayout(caption,
77 QAD_Desktop::getResourceManager()->loadPixmap( "SMESH", hypIconName ),
81 //=================================================================================
82 // function : ~StdMeshersGUI_CreateStdHypothesisDlg()
83 // purpose : Destroys the object and frees any allocated resources
84 //=================================================================================
85 StdMeshersGUI_CreateStdHypothesisDlg::~StdMeshersGUI_CreateStdHypothesisDlg()
87 // no need to delete child widgets, Qt does it all for us
89 //=================================================================================
90 // function : FillParameters()
92 //=================================================================================
93 void StdMeshersGUI_CreateStdHypothesisDlg::GetParameters
94 (const QString & hypType,
95 std::list<SMESHGUI_aParameterPtr> & params)
97 StdMeshersGUI_Parameters::GetParameters( hypType, params );
100 //=================================================================================
101 // function : SetParameters()
103 //=================================================================================
104 bool StdMeshersGUI_CreateStdHypothesisDlg::SetParameters
105 (SMESH::SMESH_Hypothesis_ptr theHyp, const list<SMESHGUI_aParameterPtr> & params)
107 StdMeshersGUI_Parameters::SetParameters( theHyp, params );