Salome HOME
remise en marche du plugin t_shape_fluid
authorPaul RASCLE <paul.rascle@edf.fr>
Fri, 8 Jan 2016 15:38:11 +0000 (16:38 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Fri, 8 Jan 2016 15:38:11 +0000 (16:38 +0100)
CMakeLists.txt
src/CMakeLists.txt
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/Tools/geom_plugins.py
src/Tools/t_shape/CMakeLists.txt
src/Tools/t_shape/__init__.py [new file with mode: 0644]
src/Tools/t_shape/t_shape_builder.py
src/Tools/t_shape/t_shape_dialog.py
src/Tools/t_shape/t_shape_dialog.ui
src/Tools/t_shape/t_shape_dialog_ui.py [deleted file]

index 828cfb7f421afee8a432489d7534c46e01fc64aa..4dc80fd57ff7f2aac716ca5e32c1f20c6d11bdc1 100755 (executable)
@@ -127,6 +127,7 @@ IF(SALOME_BUILD_GUI)
 
   # Qt4
   FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
+  FIND_PACKAGE(SalomePyQt4)
 ENDIF(SALOME_BUILD_GUI)
 
 ##
index bd7e3428d56bc9104b3e6753b39a5c45c0fc9345..13d33e44460c7c33dd6e25c655cdcc58f0951d85 100755 (executable)
@@ -24,7 +24,7 @@ SET(SUBDIRS_COMMON
   ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig 
   GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
   AdvancedEngine OCC2VTK
-  STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin
+  STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin Tools
   )
 
 ##
index 2f225edbdfc22452eeecfecae315cd2c05525567..5a094f30350e99d841b479aa8bd979c7027a9e99 100644 (file)
@@ -5350,7 +5350,7 @@ shells and solids on the other hand.</translation>
     </message>
     <message>
         <source>GEOM_PLUGINS_OTHER</source>
-        <translation>Other</translation>
+        <translation>Python Plugins</translation>
     </message>
     <message>
         <source>SHOW_ONLY_SELECTED</source>
index 1a1231364e262448b3064b9240238cbe36347ea7..01acd20ca6eab1a8ae9b5a00f7a97c0e5efe2a39 100644 (file)
@@ -5342,7 +5342,7 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
     </message>
     <message>
         <source>GEOM_PLUGINS_OTHER</source>
-        <translation>Autre</translation>
+        <translation>Plugins Python</translation>
     </message>
     <message>
         <source>SHOW_ONLY_SELECTED</source>
index 00ad4f1497b9e94058e68a40a74426354d526102..a1f6ab394ef7f56a32558dd202cb92b03a3c3077 100644 (file)
@@ -22,8 +22,8 @@
 import salome_pluginsmanager
 
 def t_shape_fluid(context):
-    import t_shape_builder
-    import t_shape_dialog
+    from t_shape import t_shape_builder
+    from t_shape import t_shape_dialog
     import xalome
     from PyQt4.QtGui import QMessageBox
     activeStudy = context.study
index 35cc005549a6d8ad50143e14a16ccaf1664fec38..4701fc26d5a8e22ef3e2b73c98d935ed7980198f 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(UsePyQt4)
+
 # --- scripts ---
 
 # scripts / static
 SET(plugin_SCRIPTS
+  __init__.py
   t_shape_builder.py
   t_shape_dialog.py
   t_shape_dialog.ui
-  t_shape_dialog_ui.py
-  ) 
+  )
+
+# uic files / to be processed by pyuic
+SET(_pyuic_files
+  t_shape_dialog.ui
+)
+
+# scripts / pyuic wrappings
+PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/t_shape)
+SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_GEOM_INSTALL_PLUGINS}/t_shape)
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_GEOM_INSTALL_PLUGINS}/t_shape)
\ No newline at end of file
diff --git a/src/Tools/t_shape/__init__.py b/src/Tools/t_shape/__init__.py
new file mode 100644 (file)
index 0000000..40a96af
--- /dev/null
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
index 09a818b29e21370a74ffc54452b1aebe234f7b41..3082dc849520b024d00ce10ca31fe0bba04387a5 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 import sys
 import salome
index ce60329948040cde34f06caae121dd522856c4ea..9fb4f9b289fd971b1032873a5b4f4800ae282314 100644 (file)
@@ -34,19 +34,23 @@ class TShapeDialog(QtGui.QDialog):
       self.ui.setupUi(self)
       self.show()
       self._wasOk = False
-      self.ui.doubleSpinBox_5.setEnabled(False)
+      self.ui.dsb_solidThickness.setEnabled(False)
       self.ui.label_5.setEnabled(False)
+      self.ui.dsb_bigRadius.setValue(50.0)
+      self.ui.dsb_smallRadius.setValue(40.0)
+      self.ui.dsb_bigHeight.setValue(80.0)
+      self.ui.dsb_smallHeight.setValue(80.0)
    
     def accept(self):
       self._wasOk = True
       QtGui.QDialog.accept(self)
       
     def getData(self):
-      r1 = self.ui.doubleSpinBox.value()
-      r2 = self.ui.doubleSpinBox_2.value()
-      h1 = self.ui.doubleSpinBox_3.value()
-      h2 = self.ui.doubleSpinBox_4.value()
-      thickness = self.ui.doubleSpinBox_5.value()
+      r1 = self.ui.dsb_bigRadius.value()
+      r2 = self.ui.dsb_smallRadius.value()
+      h1 = self.ui.dsb_bigHeight.value()
+      h2 = self.ui.dsb_smallHeight.value()
+      thickness = self.ui.dsb_solidThickness.value()
       
       return r1, r2, h1, h2, thickness
 
index 8caa136b562bcd824aff397edd80432b38bd3c08..55a48232e811615cb466d1a5d936d4b237dd3307 100644 (file)
    <item row="0" column="0">
     <layout class="QGridLayout" name="gridLayout">
      <item row="2" column="1">
-      <widget class="QDoubleSpinBox" name="doubleSpinBox_2"/>
+      <widget class="QDoubleSpinBox" name="dsb_smallRadius">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>40.000000000000000</double>
+       </property>
+      </widget>
      </item>
      <item row="0" column="0">
       <widget class="QLabel" name="label">
       </widget>
      </item>
      <item row="3" column="1">
-      <widget class="QDoubleSpinBox" name="doubleSpinBox_3"/>
+      <widget class="QDoubleSpinBox" name="dsb_bigHeight">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>1000000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>80.000000000000000</double>
+       </property>
+      </widget>
      </item>
      <item row="4" column="1">
-      <widget class="QDoubleSpinBox" name="doubleSpinBox_4"/>
+      <widget class="QDoubleSpinBox" name="dsb_smallHeight">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>1000000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>80.000000000000000</double>
+       </property>
+      </widget>
      </item>
      <item row="0" column="1">
-      <widget class="QDoubleSpinBox" name="doubleSpinBox"/>
+      <widget class="QDoubleSpinBox" name="dsb_bigRadius">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>50.000000000000000</double>
+       </property>
+      </widget>
      </item>
      <item row="3" column="0">
       <widget class="QLabel" name="label_3">
    <item row="1" column="0">
     <layout class="QGridLayout" name="gridLayout_2">
      <item row="0" column="0">
-      <widget class="QCheckBox" name="checkBox">
+      <widget class="QCheckBox" name="cb_buildSolid">
        <property name="text">
         <string>Build solid part</string>
        </property>
       </widget>
      </item>
      <item row="1" column="1">
-      <widget class="QDoubleSpinBox" name="doubleSpinBox_5"/>
+      <widget class="QDoubleSpinBox" name="dsb_solidThickness">
+       <property name="decimals">
+        <number>5</number>
+       </property>
+       <property name="maximum">
+        <double>1000000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>5.000000000000000</double>
+       </property>
+      </widget>
      </item>
     </layout>
    </item>
    </hints>
   </connection>
   <connection>
-   <sender>checkBox</sender>
+   <sender>cb_buildSolid</sender>
    <signal>clicked(bool)</signal>
    <receiver>label_5</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>89</x>
-     <y>184</y>
+     <x>99</x>
+     <y>170</y>
     </hint>
     <hint type="destinationlabel">
      <x>107</x>
    </hints>
   </connection>
   <connection>
-   <sender>checkBox</sender>
+   <sender>cb_buildSolid</sender>
    <signal>clicked(bool)</signal>
-   <receiver>doubleSpinBox_5</receiver>
+   <receiver>dsb_solidThickness</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>140</x>
-     <y>178</y>
+     <x>150</x>
+     <y>170</y>
     </hint>
     <hint type="destinationlabel">
      <x>277</x>
diff --git a/src/Tools/t_shape/t_shape_dialog_ui.py b/src/Tools/t_shape/t_shape_dialog_ui.py
deleted file mode 100644 (file)
index b034e67..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 't_shape_dialog.ui'
-#
-# Created: Tue Nov  4 16:52:09 2014
-#      by: PyQt4 UI code generator 4.9.6
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-try:
-    _fromUtf8 = QtCore.QString.fromUtf8
-except AttributeError:
-    def _fromUtf8(s):
-        return s
-
-try:
-    _encoding = QtGui.QApplication.UnicodeUTF8
-    def _translate(context, text, disambig):
-        return QtGui.QApplication.translate(context, text, disambig, _encoding)
-except AttributeError:
-    def _translate(context, text, disambig):
-        return QtGui.QApplication.translate(context, text, disambig)
-
-class Ui_Dialog(object):
-    def setupUi(self, Dialog):
-        Dialog.setObjectName(_fromUtf8("Dialog"))
-        Dialog.resize(349, 283)
-        self.gridLayout_3 = QtGui.QGridLayout(Dialog)
-        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
-        self.gridLayout = QtGui.QGridLayout()
-        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
-        self.doubleSpinBox_2 = QtGui.QDoubleSpinBox(Dialog)
-        self.doubleSpinBox_2.setObjectName(_fromUtf8("doubleSpinBox_2"))
-        self.gridLayout.addWidget(self.doubleSpinBox_2, 2, 1, 1, 1)
-        self.label = QtGui.QLabel(Dialog)
-        self.label.setObjectName(_fromUtf8("label"))
-        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
-        self.doubleSpinBox_3 = QtGui.QDoubleSpinBox(Dialog)
-        self.doubleSpinBox_3.setObjectName(_fromUtf8("doubleSpinBox_3"))
-        self.gridLayout.addWidget(self.doubleSpinBox_3, 3, 1, 1, 1)
-        self.doubleSpinBox_4 = QtGui.QDoubleSpinBox(Dialog)
-        self.doubleSpinBox_4.setObjectName(_fromUtf8("doubleSpinBox_4"))
-        self.gridLayout.addWidget(self.doubleSpinBox_4, 4, 1, 1, 1)
-        self.doubleSpinBox = QtGui.QDoubleSpinBox(Dialog)
-        self.doubleSpinBox.setObjectName(_fromUtf8("doubleSpinBox"))
-        self.gridLayout.addWidget(self.doubleSpinBox, 0, 1, 1, 1)
-        self.label_3 = QtGui.QLabel(Dialog)
-        self.label_3.setObjectName(_fromUtf8("label_3"))
-        self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
-        self.label_2 = QtGui.QLabel(Dialog)
-        self.label_2.setObjectName(_fromUtf8("label_2"))
-        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
-        self.label_4 = QtGui.QLabel(Dialog)
-        self.label_4.setObjectName(_fromUtf8("label_4"))
-        self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1)
-        self.gridLayout_3.addLayout(self.gridLayout, 0, 0, 1, 1)
-        self.gridLayout_2 = QtGui.QGridLayout()
-        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
-        self.checkBox = QtGui.QCheckBox(Dialog)
-        self.checkBox.setObjectName(_fromUtf8("checkBox"))
-        self.gridLayout_2.addWidget(self.checkBox, 0, 0, 1, 1)
-        self.label_5 = QtGui.QLabel(Dialog)
-        self.label_5.setObjectName(_fromUtf8("label_5"))
-        self.gridLayout_2.addWidget(self.label_5, 1, 0, 1, 1)
-        self.doubleSpinBox_5 = QtGui.QDoubleSpinBox(Dialog)
-        self.doubleSpinBox_5.setObjectName(_fromUtf8("doubleSpinBox_5"))
-        self.gridLayout_2.addWidget(self.doubleSpinBox_5, 1, 1, 1, 1)
-        self.gridLayout_3.addLayout(self.gridLayout_2, 1, 0, 1, 1)
-        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
-        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
-        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
-        self.gridLayout_3.addWidget(self.buttonBox, 2, 0, 1, 1)
-
-        self.retranslateUi(Dialog)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject)
-        QtCore.QObject.connect(self.checkBox, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.label_5.setEnabled)
-        QtCore.QObject.connect(self.checkBox, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.doubleSpinBox_5.setEnabled)
-        QtCore.QMetaObject.connectSlotsByName(Dialog)
-
-    def retranslateUi(self, Dialog):
-        Dialog.setWindowTitle(_translate("Dialog", "Dialog", None))
-        self.label.setText(_translate("Dialog", "Big pipe radius", None))
-        self.label_3.setText(_translate("Dialog", "Big pipe  height", None))
-        self.label_2.setText(_translate("Dialog", "Small pipe  radius", None))
-        self.label_4.setText(_translate("Dialog", "Small  pipe height", None))
-        self.checkBox.setText(_translate("Dialog", "Build solid part", None))
-        self.label_5.setText(_translate("Dialog", "Solid thickness", None))
-        
-if __name__ == "__main__":
-    import sys
-    app = QtGui.QApplication(sys.argv)
-    Dialog = QtGui.QDialog()
-    ui = Ui_Dialog()
-    ui.setupUi(Dialog)
-    Dialog.show()
-    sys.exit(app.exec_())
-
-