Skip to content
Snippets Groups Projects
Commit f0c493ea authored by Joshua Steer's avatar Joshua Steer
Browse files

Merge branch 'master' of https://git.soton.ac.uk/js22g12/AmpScan

parents 76d15a52 e69f298d
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,7 @@ class vtkRenWin(vtk.vtkRenderWindow): ...@@ -64,7 +64,7 @@ class vtkRenWin(vtk.vtkRenderWindow):
Set the scalar bar within the window based upon a look-up table defined Set the scalar bar within the window based upon a look-up table defined
within an actor within an actor
Parmeters Parameters
--------- ---------
actor: ampActor actor: ampActor
The actor from which the lut is read from, the actor must have the The actor from which the lut is read from, the actor must have the
......
...@@ -9,10 +9,11 @@ from AmpScan.pressSens import pressSense ...@@ -9,10 +9,11 @@ from AmpScan.pressSens import pressSense
from PyQt5.QtCore import QPoint, QSize, Qt, QTimer, QRect, pyqtSignal from PyQt5.QtCore import QPoint, QSize, Qt, QTimer, QRect, pyqtSignal
from PyQt5.QtGui import (QColor, QFontMetrics, QImage, QPainter, QIcon, from PyQt5.QtGui import (QColor, QFontMetrics, QImage, QPainter, QIcon,
QOpenGLVersionProfile) QOpenGLVersionProfile)
from PyQt5.QtWidgets import (QAction, QApplication, QGridLayout, from PyQt5.QtWidgets import (QAction, QApplication, QGridLayout, QHBoxLayout,
QMainWindow, QMessageBox, QComboBox, QMainWindow, QMessageBox, QComboBox, QButtonGroup,
QOpenGLWidget, QFileDialog,QLabel,QPushButton, QOpenGLWidget, QFileDialog,QLabel,QPushButton,
QSlider, QWidget, QTableWidget, QTableWidgetItem) QSlider, QWidget, QTableWidget, QTableWidgetItem,
QAbstractButton)
class AmpScanGUI(QMainWindow): class AmpScanGUI(QMainWindow):
...@@ -102,21 +103,61 @@ class AmpScanGUI(QMainWindow): ...@@ -102,21 +103,61 @@ class AmpScanGUI(QMainWindow):
self.alCont = AlignControls(self.filesDrop, self) self.alCont = AlignControls(self.filesDrop, self)
self.alCont.show() self.alCont.show()
self.alCont.icp.clicked.connect(self.runICP) self.alCont.icp.clicked.connect(self.runICP)
# self.renWin.setnumViewports(2) self.alCont.xrotButton.buttonClicked[QAbstractButton].connect(self.rotatex)
# self.renWin.setView(view=[-1, 0, 0], viewport=1) self.alCont.yrotButton.buttonClicked[QAbstractButton].connect(self.rotatey)
# self.renWin.setProjection(True, 0) self.alCont.zrotButton.buttonClicked[QAbstractButton].connect(self.rotatez)
# self.renWin.setProjection(True, 1) self.alCont.xtraButton.buttonClicked[QAbstractButton].connect(self.transx)
## self.renWin.render(self.AmpObj.actors, dispActors=['limb',]) self.alCont.ytraButton.buttonClicked[QAbstractButton].connect(self.transy)
## self.renWin.render(self.AmpObj.actors, dispActors=['socket',], self.alCont.ztraButton.buttonClicked[QAbstractButton].connect(self.transz)
## viewport=1)
# self.renWin.renderActors([self.AmpObj.actor, self.socket.actor], def rotatex(self, button):
# viewport=0) moving = str(self.alCont.moving.currentText())
# self.renWin.renderActors([self.AmpObj.actor, self.socket.actor], ang = [float(button.text()), 0, 0]
# viewport=1) self.files[moving].rotateAng(ang, 'deg')
# self.AmpObj.actor.setColor([1.0, 0.0, 0.0]) self.files[moving].actor.setVert(self.files[moving].vert)
# self.AmpObj.actor.setOpacity(0.5) self.renWin.Render()
# self.socket.actor.setColor([0.0, 0.0, 1.0]) # print('rotate x by %.1f' % ang)
# self.socket.actor.setOpacity(0.5)
def rotatey(self, button):
moving = str(self.alCont.moving.currentText())
ang = [0, float(button.text()), 0]
self.files[moving].rotateAng(ang, 'deg')
self.files[moving].actor.setVert(self.files[moving].vert)
self.renWin.Render()
# print('rotate y by %.1f' % ang)
def rotatez(self, button):
moving = str(self.alCont.moving.currentText())
ang = [0, 0, float(button.text())]
self.files[moving].rotateAng(ang, 'deg')
self.files[moving].actor.setVert(self.files[moving].vert)
self.renWin.Render()
def transx(self, button):
moving = str(self.alCont.moving.currentText())
ang = [float(button.text()), 0, 0]
self.files[moving].translate(ang)
self.files[moving].actor.setVert(self.files[moving].vert)
self.renWin.Render()
# print('rotate x by %.1f' % ang)
def transy(self, button):
moving = str(self.alCont.moving.currentText())
ang = [0, float(button.text()), 0]
self.files[moving].translate(ang)
self.files[moving].actor.setVert(self.files[moving].vert)
self.renWin.Render()
# print('rotate y by %.1f' % ang)
def transz(self, button):
moving = str(self.alCont.moving.currentText())
ang = [0, 0, float(button.text())]
self.files[moving].translate(ang)
self.files[moving].actor.setVert(self.files[moving].vert)
self.renWin.Render()
# print('rotate z by %.1f' % ang)
# self.files[moving].rotateAng(ang, 'deg')
def runICP(self): def runICP(self):
...@@ -172,12 +213,7 @@ class AmpScanGUI(QMainWindow): ...@@ -172,12 +213,7 @@ class AmpScanGUI(QMainWindow):
self.regCont.show() self.regCont.show()
self.regCont.reg.clicked.connect(self.runRegistration) self.regCont.reg.clicked.connect(self.runRegistration)
# self.renWin.setnumViewports(1)
# self.renWin.setProjection()
# self.RegObj = registration(self.socket, self.AmpObj)
# self.RegObj.addActor(CMap=self.AmpObj.CMapN2P)
# self.renWin.renderActors([self.RegObj.actor,])
# self.renWin.setScalarBar(self.RegObj.actor)
def analyse(self): def analyse(self):
""" """
...@@ -348,6 +384,28 @@ class AlignControls(QMainWindow): ...@@ -348,6 +384,28 @@ class AlignControls(QMainWindow):
self.layout.addWidget(self.static, 0, 1) self.layout.addWidget(self.static, 0, 1)
self.layout.addWidget(self.moving, 1, 1) self.layout.addWidget(self.moving, 1, 1)
self.layout.addWidget(self.icp, 2, 0, 1, -1) self.layout.addWidget(self.icp, 2, 0, 1, -1)
rots = ['x', 'y', 'z']
vals = ['-5', '-0.5', '+0.5', '+5']
for i, r in enumerate(rots):
setattr(self, r + 'rotBox', QHBoxLayout())
setattr(self, r + 'rotButton', QButtonGroup())
lab = QLabel(r + ' rotation')
getattr(self, r + 'rotBox').addWidget(lab)
for v in vals:
button = QPushButton(v)
getattr(self, r + 'rotBox').addWidget(button)
getattr(self, r + 'rotButton').addButton(button)
self.layout.addLayout(getattr(self, r + 'rotBox'), i+3, 0, 1, -1)
for i, r in enumerate(rots):
setattr(self, r + 'traBox', QHBoxLayout())
setattr(self, r + 'traButton', QButtonGroup())
lab = QLabel(r + ' translation')
getattr(self, r + 'traBox').addWidget(lab)
for v in vals:
button = QPushButton(v)
getattr(self, r + 'traBox').addWidget(button)
getattr(self, r + 'traButton').addButton(button)
self.layout.addLayout(getattr(self, r + 'traBox'), i+6, 0, 1, -1)
self.main.setLayout(self.layout) self.main.setLayout(self.layout)
self.setWindowTitle("Alignment Manager") self.setWindowTitle("Alignment Manager")
self.getNames() self.getNames()
...@@ -388,7 +446,7 @@ class RegistrationControls(QMainWindow): ...@@ -388,7 +446,7 @@ class RegistrationControls(QMainWindow):
self.layout.addWidget(self.target, 1, 1) self.layout.addWidget(self.target, 1, 1)
self.layout.addWidget(self.reg, 2, 0, 1, -1) self.layout.addWidget(self.reg, 2, 0, 1, -1)
self.main.setLayout(self.layout) self.main.setLayout(self.layout)
self.setWindowTitle("Alignment Manager") self.setWindowTitle("Registration Manager")
self.getNames() self.getNames()
def getNames(self): def getNames(self):
...@@ -402,6 +460,7 @@ class RegistrationControls(QMainWindow): ...@@ -402,6 +460,7 @@ class RegistrationControls(QMainWindow):
if __name__ == "__main__": if __name__ == "__main__":
app = QApplication(sys.argv) app = QApplication(sys.argv)
# mainWin = AlignControls([''])
mainWin = AmpScanGUI() mainWin = AmpScanGUI()
mainWin.show() mainWin.show()
sys.exit(app.exec_()) sys.exit(app.exec_())
\ No newline at end of file
docs/AmpScanlogo.ico

1.12 KiB

...@@ -21,7 +21,7 @@ sys.path.insert(0, os.path.abspath('.')) ...@@ -21,7 +21,7 @@ sys.path.insert(0, os.path.abspath('.'))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = 'AmpScan' project = 'AmpScan'
copyright = '2018, Joshua Steer' copyright = '2018, AmpScan developers'
author = 'Oliver Stocks' author = 'Oliver Stocks'
# The short X.Y version # The short X.Y version
...@@ -65,6 +65,8 @@ nbsphinx_kernel_name = 'python3' ...@@ -65,6 +65,8 @@ nbsphinx_kernel_name = 'python3'
html_logo = "AmpScanlogosmall.svg" html_logo = "AmpScanlogosmall.svg"
html_favicon = "AmpScanlogo.ico"
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
......
...@@ -16,5 +16,4 @@ via ``import AmpScan`` by navigating to the root directory and running ...@@ -16,5 +16,4 @@ via ``import AmpScan`` by navigating to the root directory and running
examples/TESTnb examples/TESTnb
examples/Workflow1-Importstl examples/Workflow1-Importstl
examples/Workflow2-ImportTetMesh examples/Workflow2-ImportTetMesh
examples/Workflow3-AnalyseAmpObject examples/WorkFlow3-AnalyseAmpObject
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python [conda env:python3]", "display_name": "Python [conda env:py3]",
"language": "python", "language": "python",
"name": "conda-env-python3-py" "name": "conda-env-py3-py"
}, },
"language_info": { "language_info": {
"codemirror_mode": { "codemirror_mode": {
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.4" "version": "3.5.5"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment