From a71898b2c0e4f0c129b9c488f70105c7448dfe3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Renaud=20N=C3=A9d=C3=A9lec?= Date: Mon, 23 Jun 2014 16:25:36 +0200 Subject: [PATCH] some cleaning --- src/Tools/salome_plugins.py | 2 +- src/Tools/t_shape_builder.py | 15 ++------------- src/Tools/t_shape_dialog.py | 25 ------------------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/Tools/salome_plugins.py b/src/Tools/salome_plugins.py index d75b4a7b1..b55d4d7ee 100644 --- a/src/Tools/salome_plugins.py +++ b/src/Tools/salome_plugins.py @@ -36,7 +36,7 @@ def t_shape_fluid(context): dialog.exec_() if dialog.wasOk(): r1, r2, h1, h2 = dialog.getData() - QMessageBox.about(None, "Building in progress", "building shape, please be patient") + #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) diff --git a/src/Tools/t_shape_builder.py b/src/Tools/t_shape_builder.py index 2f6bc6ba2..f729f7f6c 100644 --- a/src/Tools/t_shape_builder.py +++ b/src/Tools/t_shape_builder.py @@ -103,9 +103,6 @@ def build_shape(study, r1, r2, h1, h2): v1, l1, arc1, part1 = demidisk(study, r1, a1) v2, l2, arc2, part2 = demidisk(study, r2, a1, 90.0) - geompy.addToStudy(part1, 'part1') - geompy.addToStudy(part2, 'part2') - # --- extrusion des sections --> demi cylindres de travail, pour en extraire les sections utilisées au niveau du Té # et enveloppe cylindrique du cylindre principal @@ -113,10 +110,6 @@ def build_shape(study, r1, r2, h1, h2): demicyl2 = geompy.MakePrismVecH(part2, OZ, h2) arcextru = geompy.MakePrismVecH(arc1, OX, h1) - geompy.addToStudy(demicyl1, 'demicyl1') - geompy.addToStudy(demicyl2, 'demicyl2') - geompy.addToStudy(arcextru, 'arcextru') - # --- plan de coupe à 45° sur le cylindre principal, # section à 45° du cylndre principal, # section du cylindre secondaire par l'enveloppe cylindique du cylindre principal @@ -240,25 +233,21 @@ def build_shape(study, r1, r2, h1, h2): # --- extrusion droite des faces de jonction, pour reconstituer les demi cylindres extru1 = geompy.MakePrismVecH(sect45, OX, h1+10) - geompy.addToStudy(extru1, "extru1") base2 = geompy.MakePartition(faci[5:], [], [], [], geompy.ShapeType["FACE"], 0, [], 0, True) extru2 = geompy.MakePrismVecH(base2, OZ, h2) - geompy.addToStudy(extru2, "extru2") # --- partition et coupe demiDisque = geompy.MakeFaceWires([arc1, l1[0]], 1) demiCylindre = geompy.MakePrismVecH(demiDisque, OX, h1) - #geompy.addToStudy(demiCylindre, "demiCylindre") + box = geompy.MakeBox(0, -2*(r1+h1), -2*(r1+h1), 2*(r1+h1), 2*(r1+h1), 2*(r1+h1)) rot = geompy.MakeRotation(box, OY, 45*math.pi/180.0) - #geompy.addToStudy(rot, "rot") + garder = geompy.MakeCutList(demiCylindre, [extru2, rot], True) - geompy.addToStudy(garder, "garder") raccord = geompy.MakePartition([garder], faci, [], [], geompy.ShapeType["SOLID"], 0, [], 0, True) assemblage = geompy.MakePartition([raccord, extru1, extru2], [], [], [], geompy.ShapeType["SOLID"], 0, [], 0, True) - geompy.addToStudy(assemblage, "assemblage") box = geompy.MakeBox(-1, -(r1+r2), -1, h1, r1+r2, h2) geompy.addToStudy(box, "box") diff --git a/src/Tools/t_shape_dialog.py b/src/Tools/t_shape_dialog.py index 6ac37c51f..297be4b21 100644 --- a/src/Tools/t_shape_dialog.py +++ b/src/Tools/t_shape_dialog.py @@ -36,7 +36,6 @@ class TShapeDialog(QtGui.QDialog): self._wasOk = False def accept(self): - print "DATA ACCEPTED" self._wasOk = True QtGui.QDialog.accept(self) @@ -47,25 +46,6 @@ class TShapeDialog(QtGui.QDialog): h2 = self.ui.doubleSpinBox_4.value() return r1, r2, h1, h2 - - #def setupUi(self): - #TShapeDialog_UI.setupUi(self) - #self.handleAcceptWith(self.accept) - #self.handleRejectWith(self.reject) - - #def handleAcceptWith(self,callbackFunction): - #"""This defines the function to be connected to the signal 'accepted()' (click on Ok)""" - #QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), callbackFunction) - - #def handleRejectWith(self,callbackFunction): - #"""This defines the function to be connected to the signal 'rejected()' (click on Cancel)""" - #QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), callbackFunction) - - #def accept(self): - #'''Callback function when dialog is accepted (click Ok)''' - #self._wasOk = True - ## We should test here the validity of values - #QtGui.QDialog.accept(self) def reject(self): self._wasOk = False @@ -74,11 +54,6 @@ class TShapeDialog(QtGui.QDialog): def wasOk(self): return self._wasOk - #def setData(self): - #pass - - #def getData(self): - #pass # ================ # Tests -- 2.39.2