summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jones.jpgbin32066 -> 0 bytes
-rw-r--r--src/ui.py8
-rw-r--r--src/ui_widgets.py39
3 files changed, 8 insertions, 39 deletions
diff --git a/jones.jpg b/jones.jpg
deleted file mode 100644
index c5f06c8..0000000
--- a/jones.jpg
+++ /dev/null
Binary files differ
diff --git a/src/ui.py b/src/ui.py
index 60f2fac..22ae436 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -69,8 +69,7 @@ def update():
row.stokes[4].setText("%g°" % (ellipse.alpha * 180 / np.pi))
row.stokes[5].setText("%g°" % (ellipse.theta * 180 / np.pi))
- GUI.widok.intensity = I
- GUI.widok.repaint()
+ GUI.poincare.repaint()
#if GUI.auto_optimize.isChecked():
# optimize()
@@ -144,9 +143,8 @@ class MainWindow(QMainWindow):
rhs = QVBoxLayout()
split.addWidget(LayoutWrapper(rhs))
- Widocques.image = QImage("jones.jpg")
- GUI.widok = Widocques()
- rhs.addWidget(GUI.widok)
+ GUI.poincare = PoincareWidget()
+ rhs.addWidget(GUI.poincare)
GUI.table.populate(system)
update()
diff --git a/src/ui_widgets.py b/src/ui_widgets.py
index 07b0369..291324f 100644
--- a/src/ui_widgets.py
+++ b/src/ui_widgets.py
@@ -227,41 +227,12 @@ class AngleSlider(QHBoxLayout):
-class Widocques(QWidget):
- image = None
-
- def __init__(self):
+class PoincareWidget(QWidget):
+ def __init__(self,):
QWidget.__init__(self)
- self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding))
- self.intensity = 1
-
- def minimumSizeHint(self):
- return QSize(100, 100)
+ self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, \
+ QSizePolicy.Expanding))
def paintEvent(self, event):
- P = QPainter(self)
-
- w, h = self.frameSize().width(), self.frameSize().height()
+ pass
- ar = Widocques.image.width() \
- / Widocques.image.height()
-
- if w / h > ar:
- # pad left/right
- w2 = h * ar
- pad = (w - w2) / 2
- rect = QRect(pad, 0, w2, h)
- else:
- # pad top/bottom
- h2 = w / ar
- pad = (h - h2) / 2
- rect = QRect(0, pad, w, h2)
-
- w2 = rect.width()
- h2 = rect.height()
- rect2 = QRect(rect.left() + 0.1 * w2, rect.top() + 0.1 * h2, \
- w2 * 0.8, h2 * 0.8)
-
- P.fillRect(QRect(0, 0, w, h), Qt.black)
- P.drawImage(rect2, Widocques.image)
- P.fillRect(rect2, QColor(0, 0, 0, 255 * (1 - self.intensity)))