diff options
author | deepa-chaudhari | 2015-08-14 10:40:07 +0530 |
---|---|---|
committer | deepa-chaudhari | 2015-08-14 10:40:07 +0530 |
commit | b47147e28d492740f7a6dc3ccb1f768faf8840f9 (patch) | |
tree | 5c4b534bf3fda5291fe315a982fda9a6156a0837 /Connections/Shear/Finplate | |
parent | 22efad1eb080cfe51fadff023cc4ad7faafa56c8 (diff) | |
download | OsdagLive-b47147e28d492740f7a6dc3ccb1f768faf8840f9.tar.gz OsdagLive-b47147e28d492740f7a6dc3ccb1f768faf8840f9.tar.bz2 OsdagLive-b47147e28d492740f7a6dc3ccb1f768faf8840f9.zip |
zoom functionalityzoom,pan,rotate
Diffstat (limited to 'Connections/Shear/Finplate')
-rw-r--r-- | Connections/Shear/Finplate/finPlate.ui | 22 | ||||
-rw-r--r-- | Connections/Shear/Finplate/finPlateMain.py | 31 | ||||
-rw-r--r-- | Connections/Shear/Finplate/ui_finPlate.py | 24 |
3 files changed, 48 insertions, 29 deletions
diff --git a/Connections/Shear/Finplate/finPlate.ui b/Connections/Shear/Finplate/finPlate.ui index 46075b4..97ea6f2 100644 --- a/Connections/Shear/Finplate/finPlate.ui +++ b/Connections/Shear/Finplate/finPlate.ui @@ -676,7 +676,7 @@ <property name="geometry"> <rect> <x>150</x> - <y>140</y> + <y>220</y> <width>161</width> <height>25</height> </rect> @@ -695,7 +695,7 @@ <property name="geometry"> <rect> <x>6</x> - <y>75</y> + <y>155</y> <width>151</width> <height>25</height> </rect> @@ -715,7 +715,7 @@ <property name="geometry"> <rect> <x>150</x> - <y>170</y> + <y>40</y> <width>161</width> <height>25</height> </rect> @@ -747,7 +747,7 @@ <property name="geometry"> <rect> <x>150</x> - <y>110</y> + <y>190</y> <width>161</width> <height>25</height> </rect> @@ -823,7 +823,7 @@ <property name="geometry"> <rect> <x>6</x> - <y>170</y> + <y>40</y> <width>120</width> <height>25</height> </rect> @@ -843,7 +843,7 @@ <property name="geometry"> <rect> <x>6</x> - <y>110</y> + <y>190</y> <width>120</width> <height>25</height> </rect> @@ -863,7 +863,7 @@ <property name="geometry"> <rect> <x>150</x> - <y>75</y> + <y>155</y> <width>161</width> <height>25</height> </rect> @@ -879,7 +879,7 @@ <property name="geometry"> <rect> <x>6</x> - <y>135</y> + <y>215</y> <width>120</width> <height>25</height> </rect> @@ -3143,7 +3143,7 @@ <property name="geometry"> <rect> <x>150</x> - <y>45</y> + <y>125</y> <width>161</width> <height>25</height> </rect> @@ -3233,7 +3233,7 @@ <property name="geometry"> <rect> <x>180</x> - <y>210</y> + <y>70</y> <width>60</width> <height>50</height> </rect> @@ -3246,7 +3246,7 @@ <property name="geometry"> <rect> <x>6</x> - <y>45</y> + <y>125</y> <width>131</width> <height>22</height> </rect> diff --git a/Connections/Shear/Finplate/finPlateMain.py b/Connections/Shear/Finplate/finPlateMain.py index 40a7eba..cfb06a6 100644 --- a/Connections/Shear/Finplate/finPlateMain.py +++ b/Connections/Shear/Finplate/finPlateMain.py @@ -8,7 +8,7 @@ from PyQt4.QtCore import QString, pyqtSignal from OCC.TopoDS import topods, TopoDS_Shape from OCC.gp import gp_Pnt from nutBoltPlacement import NutBoltArray -from OCC import VERSION, BRepTools +from OCC import VERSION, BRepTools, OSD from ui_finPlate import Ui_MainWindow from model import * from finPlateCalc import finConn @@ -38,7 +38,6 @@ from OCC.StlAPI import StlAPI_Writer class MainController(QtGui.QMainWindow): closed = pyqtSignal() - def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_MainWindow() @@ -100,11 +99,13 @@ class MainController(QtGui.QMainWindow): self.ui.actionSave_log_messages.triggered.connect(self.save_log) self.ui.actionEnlarge_font_size.triggered.connect(self.showFontDialogue) self.ui.actionZoom_in.triggered.connect(self.callZoomin) + self.ui.actionZoom_out.triggered.connect(self.callZoomout) self.ui.actionSave_3D_model_as.triggered.connect(self.save3DcadImages) self.ui.actionSave_current_2D_image_as.triggered.connect(self.save2DcadImages) self.ui.actionView_2D_on_ZX.triggered.connect(self.call_Frontview) self.ui.actionView_2D_on_XY.triggered.connect(self.call_Topview) self.ui.actionView_2D_on_YZ.triggered.connect(self.call_Sideview) + self.ui.actionPan.triggered.connect(self.call_Pannig) # self.ui.combo_Beam.addItems(get_beamcombolist()) # self.ui.comboColSec.addItems(get_columncombolist()) @@ -119,9 +120,13 @@ class MainController(QtGui.QMainWindow): self.ui.btn_CreateDesign.clicked.connect(self.save_design)#Saves the create design report self.ui.btn_SaveMessages.clicked.connect(self.save_log) + # Saving and Restoring the finPlate window state. #self.retrieve_prevstate() + self.ui.btnZmIn.clicked.connect(self.callZoomin) + self.ui.btnZmOut.clicked.connect(self.callZoomout) + self.ui.btnRotatCw.clicked.connect(self.callRotation) self.ui.btn_Reset.clicked.connect(self.resetbtn_clicked) self.ui.btn_Design.clicked.connect(self.design_btnclicked) @@ -145,8 +150,17 @@ class MainController(QtGui.QMainWindow): self.ui.textEdit.setFont(font) def callZoomin(self): - self.display.DynamicZoom() + self.display.ZoomFactor(2) + + def callZoomout(self): + self.display.ZoomFactor(0.5) + + def callRotation(self): + self.display.Rotation(15,0) + def call_Pannig(self): + self.display.Pan(50,0) + def save2DcadImages(self): files_types = "PNG (*.png);;JPG (*.jpg);;GIF (*.gif)" fileName = QtGui.QFileDialog.getSaveFileName(self, 'Export', "/home/deepa/Cadfiles/untitled.png", files_types ) @@ -598,7 +612,6 @@ class MainController(QtGui.QMainWindow): moment_capacity = resultObj['Plate']['momentcapacity'] self.ui.txtMomntCapacity.setText(str(moment_capacity)) - def displaylog_totextedit(self): ''' @@ -713,14 +726,20 @@ class MainController(QtGui.QMainWindow): osdagDisplayShape(self.display, self.connectivity.weldModelLeft, color = 'red', update = True) osdagDisplayShape(self.display, self.connectivity.weldModelRight, color = 'red', update = True) osdagDisplayShape(self.display,self.connectivity.plateModel,color = 'blue', update = True) - self.display.DisplayShape(self.connectivity.nutBoltArray.getModels(), color = Quantity_NOC_SADDLEBROWN, update=True) + nutboltlist = self.connectivity.nutBoltArray.getModels() + for nutbolt in nutboltlist: + osdagDisplayShape(self.display,nutbolt,color = Quantity_NOC_SADDLEBROWN,update = True) + #self.display.DisplayShape(self.connectivity.nutBoltArray.getModels(), color = Quantity_NOC_SADDLEBROWN, update=True) elif component == "Model": osdagDisplayShape(self.display, self.connectivity.columnModel, update=True) osdagDisplayShape(self.display, self.connectivity.beamModel, material = Graphic3d_NOT_2D_ALUMINUM, update=True) osdagDisplayShape(self.display, self.connectivity.weldModelLeft, color = 'red', update = True) osdagDisplayShape(self.display, self.connectivity.weldModelRight, color = 'red', update = True) osdagDisplayShape(self.display,self.connectivity.plateModel,color = 'blue', update = True) - self.display.DisplayShape(self.connectivity.nutBoltArray.getModels(), color = Quantity_NOC_SADDLEBROWN, update=True) + nutboltlist = self.connectivity.nutBoltArray.getModels() + for nutbolt in nutboltlist: + osdagDisplayShape(self.display,nutbolt,color = Quantity_NOC_SADDLEBROWN,update = True) + #self.display.DisplayShape(self.connectivity.nutBoltArray.getModels(), color = Quantity_NOC_SADDLEBROWN, update=True) def fetchBeamPara(self): beam_sec = self.ui.combo_Beam.currentText() diff --git a/Connections/Shear/Finplate/ui_finPlate.py b/Connections/Shear/Finplate/ui_finPlate.py index 4045b35..d6c3b0c 100644 --- a/Connections/Shear/Finplate/ui_finPlate.py +++ b/Connections/Shear/Finplate/ui_finPlate.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'finPlate.ui' # -# Created: Thu Jul 16 15:44:41 2015 +# Created: Tue Aug 11 16:24:42 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! @@ -252,14 +252,14 @@ class Ui_MainWindow(object): self.dockWidgetContents = QtGui.QWidget() self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents")) self.txtFy = QtGui.QLineEdit(self.dockWidgetContents) - self.txtFy.setGeometry(QtCore.QRect(150, 140, 161, 25)) + self.txtFy.setGeometry(QtCore.QRect(150, 220, 161, 25)) font = QtGui.QFont() font.setBold(False) font.setWeight(50) self.txtFy.setFont(font) self.txtFy.setObjectName(_fromUtf8("txtFy")) self.label_3 = QtGui.QLabel(self.dockWidgetContents) - self.label_3.setGeometry(QtCore.QRect(6, 75, 151, 25)) + self.label_3.setGeometry(QtCore.QRect(6, 155, 151, 25)) font = QtGui.QFont() font.setPointSize(11) font.setBold(False) @@ -267,7 +267,7 @@ class Ui_MainWindow(object): self.label_3.setFont(font) self.label_3.setObjectName(_fromUtf8("label_3")) self.comboConnLoc = QtGui.QComboBox(self.dockWidgetContents) - self.comboConnLoc.setGeometry(QtCore.QRect(150, 170, 161, 25)) + self.comboConnLoc.setGeometry(QtCore.QRect(150, 40, 161, 25)) font = QtGui.QFont() font.setPointSize(11) font.setBold(False) @@ -278,7 +278,7 @@ class Ui_MainWindow(object): self.comboConnLoc.addItem(_fromUtf8("")) self.comboConnLoc.addItem(_fromUtf8("")) self.txtFu = QtGui.QLineEdit(self.dockWidgetContents) - self.txtFu.setGeometry(QtCore.QRect(150, 110, 161, 25)) + self.txtFu.setGeometry(QtCore.QRect(150, 190, 161, 25)) font = QtGui.QFont() font.setBold(False) font.setWeight(50) @@ -304,7 +304,7 @@ class Ui_MainWindow(object): self.label.setFont(font) self.label.setObjectName(_fromUtf8("label")) self.label_4 = QtGui.QLabel(self.dockWidgetContents) - self.label_4.setGeometry(QtCore.QRect(6, 170, 120, 25)) + self.label_4.setGeometry(QtCore.QRect(6, 40, 120, 25)) font = QtGui.QFont() font.setPointSize(11) font.setBold(False) @@ -312,7 +312,7 @@ class Ui_MainWindow(object): self.label_4.setFont(font) self.label_4.setObjectName(_fromUtf8("label_4")) self.lbl_fu = QtGui.QLabel(self.dockWidgetContents) - self.lbl_fu.setGeometry(QtCore.QRect(6, 110, 120, 25)) + self.lbl_fu.setGeometry(QtCore.QRect(6, 190, 120, 25)) font = QtGui.QFont() font.setPointSize(11) font.setBold(False) @@ -320,12 +320,12 @@ class Ui_MainWindow(object): self.lbl_fu.setFont(font) self.lbl_fu.setObjectName(_fromUtf8("lbl_fu")) self.comboColSec = QtGui.QComboBox(self.dockWidgetContents) - self.comboColSec.setGeometry(QtCore.QRect(150, 75, 161, 25)) + self.comboColSec.setGeometry(QtCore.QRect(150, 155, 161, 25)) self.comboColSec.setStyleSheet(_fromUtf8("QComboBox { combobox-popup: 0; }")) self.comboColSec.setMaxVisibleItems(5) self.comboColSec.setObjectName(_fromUtf8("comboColSec")) self.lbl_fy = QtGui.QLabel(self.dockWidgetContents) - self.lbl_fy.setGeometry(QtCore.QRect(6, 135, 120, 25)) + self.lbl_fy.setGeometry(QtCore.QRect(6, 215, 120, 25)) font = QtGui.QFont() font.setPointSize(11) font.setBold(False) @@ -1009,7 +1009,7 @@ class Ui_MainWindow(object): self.btn_Design.setFont(font) self.btn_Design.setObjectName(_fromUtf8("btn_Design")) self.combo_Beam = QtGui.QComboBox(self.dockWidgetContents) - self.combo_Beam.setGeometry(QtCore.QRect(150, 45, 161, 25)) + self.combo_Beam.setGeometry(QtCore.QRect(150, 125, 161, 25)) self.combo_Beam.setStyleSheet(_fromUtf8("QComboBox { combobox-popup: 0; }")) self.combo_Beam.setMaxVisibleItems(5) self.combo_Beam.setObjectName(_fromUtf8("combo_Beam")) @@ -1034,11 +1034,11 @@ class Ui_MainWindow(object): self.comboWldSize.addItem(_fromUtf8("")) self.comboWldSize.addItem(_fromUtf8("")) self.lbl_connectivity = QtGui.QLabel(self.dockWidgetContents) - self.lbl_connectivity.setGeometry(QtCore.QRect(180, 210, 60, 50)) + self.lbl_connectivity.setGeometry(QtCore.QRect(180, 70, 60, 50)) self.lbl_connectivity.setScaledContents(True) self.lbl_connectivity.setObjectName(_fromUtf8("lbl_connectivity")) self.label_9 = QtGui.QLabel(self.dockWidgetContents) - self.label_9.setGeometry(QtCore.QRect(6, 45, 131, 22)) + self.label_9.setGeometry(QtCore.QRect(6, 125, 131, 22)) font = QtGui.QFont() font.setPointSize(11) font.setBold(False) |