diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2019-06-17 18:25:15 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2019-06-17 18:25:15 +0200 |
commit | 30a8d019417f59ce825ccdf44b16e0a51bdda3f2 (patch) | |
tree | c7b05d11c1b243024a48f7722b0ec525eb780c4f | |
parent | db132a783c70908e4a9666307f24b34db29b6560 (diff) |
Nuke Jones
-rw-r--r-- | jones.jpg | bin | 32066 -> 0 bytes | |||
-rw-r--r-- | src/ui.py | 8 | ||||
-rw-r--r-- | src/ui_widgets.py | 39 |
3 files changed, 8 insertions, 39 deletions
diff --git a/jones.jpg b/jones.jpg Binary files differdeleted file mode 100644 index c5f06c8..0000000 --- a/jones.jpg +++ /dev/null @@ -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))) |