1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2022 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Author : Renaud Nédélec (OpenCascade S.A.S)
23 from qtsalome import *
25 from salome.geom.t_shape.t_shape_dialog_ui import Ui_Dialog
28 class TShapeDialog(Ui_Dialog,QWidget):
30 QWidget.__init__(self)
31 # Set up the user interface from Designer.
36 self.dsb_solidThickness.setEnabled(False)
37 self.label_5.setEnabled(False)
38 self.dsb_bigRadius.setValue(50.0)
39 self.dsb_smallRadius.setValue(40.0)
40 self.dsb_bigHeight.setValue(80.0)
41 self.dsb_smallHeight.setValue(80.0)
44 from salome.geom.t_shape import t_shape_progress
48 r1, r2, h1, h2, thickness = self.getData()
49 #QMessageBox.about(None, "Building in progress", "building shape, please be patient")
50 #shape = t_shape_builder.build_shape(r1, r2, h1, h2, thickness)
51 shapeBuilder = t_shape_progress.t_shape_progress()
52 shape = shapeBuilder.run(r1, r2, h1, h2, thickness)
53 entry = xalome.addToStudy(shape, "T_shape_fluid" )
54 xalome.displayShape(entry)
57 r1 = self.dsb_bigRadius.value()
58 r2 = self.dsb_smallRadius.value()
59 h1 = self.dsb_bigHeight.value()
60 h2 = self.dsb_smallHeight.value()
62 if self.cb_buildSolid.isChecked():
63 thickness = self.dsb_solidThickness.value()
65 return r1, r2, h1, h2, thickness
77 This function returns a singleton instance of the plugin dialog.
78 It is mandatory in order to call show without a parent ...
82 __dialog = TShapeDialog()
91 app = QApplication(sys.argv)
92 Dialog = TShapeDialog()
96 #sys.exit(app.exec_())
98 if __name__=="__main__":