Salome HOME
first fully working version, not optimised though
[modules/geom.git] / src / Tools / salome_plugins.py
index d18c494732540cc9ed9125a6b99d5f281ba509d8..b55d4d7ee169bd5d04aa1cb353012b450fcae002 100644 (file)
 import salome_pluginsmanager
 
 def t_shape_fluid(context):
-    activeStudy = context.study
+    import t_shape_builder
     import t_shape_dialog
+    import xalome
+    from PyQt4.QtGui import QMessageBox
+    activeStudy = context.study
+    
     dialog = t_shape_dialog.TShapeDialog()
 
     # Get the parameter values from a gui dialog box. If the dialog is
     # closed using the Ok button, then the data are requested from the
     # gui and used to create the shape of the tube.
     dialog.exec_()
-    dialog.getData()
+    if dialog.wasOk():
+      r1, r2, h1, h2 = dialog.getData()
+      #QMessageBox.about(None, "Building in progress", "building shape, please be patient")
+      shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2)
+      entry = xalome.addToStudy(activeStudy, shape, "T_shape_fluid" )
+      xalome.displayShape(entry)
     #if dialog.wasOk():
         #radius, length, width = dialog.getData()
         #shape = tubebuilder.createGeometry(activeStudy, radius, length, width)