-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASUI.py
65 lines (51 loc) · 1.83 KB
/
ASUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ASUI
# http://noobtuts.com/python/opengl-introduction
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import main
import settings
class sliderdemo(QWidget):
def __init__(self, parent = None):
super(sliderdemo, self).__init__(parent)
self.button = QPushButton('Toggle Curve Split', self)
self.button.clicked.connect(self.handleButton)
self.clearButton = QPushButton('Clear', self)
self.clearButton.clicked.connect(self.handleClearButton)
layout = QVBoxLayout()
self.l1 = QLabel("t = 0.5")
self.l1.setAlignment(Qt.AlignCenter)
layout.addWidget(self.l1)
layout.addWidget(self.clearButton)
layout.addWidget(self.button)
self.sl = QSlider(Qt.Horizontal)
self.sl.setMinimum(0)
self.sl.setMaximum(1000)
self.sl.setValue(500)
self.sl.setTickPosition(QSlider.TicksBelow)
self.sl.setTickInterval(5)
layout.addWidget(self.sl)
self.sl.valueChanged.connect(self.valuechange)
self.ipSlider = QSlider(Qt.Horizontal)
self.ipSlider.setMinimum(10)
self.ipSlider.setMaximum(1000)
self.ipSlider.setValue(50)
self.ipSlider.setTickPosition(QSlider.TicksBelow)
self.ipSlider.setTickInterval(5)
layout.addWidget(self.ipSlider)
self.ipSlider.valueChanged.connect(self.ipSliderValueChange)
self.setLayout(layout)
# self.setWindowTitle("SpinBox demo")
def handleButton(self):
settings.splitLine = not splitLine
main.draw()
def handleClearButton(self):
settings.points = []
main.draw()
def valuechange(self):
value = float(self.sl.value())/1000
self.l1.setText("t = " + str(value))
settings.selectedT = value
main.draw()
def ipSliderValueChange(self):
settings.interpolationNumber = self.ipSlider.value()
main.draw()