Salome HOME
NGO - Update T-Shape
[modules/geom.git] / src / Tools / geom_plugins.py
index 00ad4f1497b9e94058e68a40a74426354d526102..07baf9ce18921b8b22b976f390466e90d22003ba 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2010-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2016  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 import salome_pluginsmanager
 
 def t_shape_fluid(context):
-    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_()
-    if dialog.wasOk():
-      r1, r2, h1, h2, thickness = dialog.getData()
-      #QMessageBox.about(None, "Building in progress", "building shape, please be patient")
-      shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness)
-      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)
-        #entry = xalome.addToStudy(activeStudy, shape, "Tube" )
-        #xalome.displayShape(entry)
 
+    #from salome.geom.t_shape import t_shape_builder
+    from salome.geom.t_shape import t_shape_dialog
+    dialog = t_shape_dialog.getDialog()
+    dialog.setContext(context)
+    dialog.show()
 
 salome_pluginsmanager.AddFunction('T shape fluid',
                                   'Creates the fluid part of a pipe T-shape',
-                                  t_shape_fluid)
\ No newline at end of file
+                                  t_shape_fluid)