34 lines
795 B
Python
34 lines
795 B
Python
from PySide6.QtGui import QPainter
|
|
from PySide6.QtWidgets import (
|
|
QGraphicsScene,
|
|
QGraphicsView,
|
|
QHBoxLayout,
|
|
QWidget,
|
|
)
|
|
|
|
from grid.ui.pattern import LargeUltimaPattern, SmallZPattern
|
|
|
|
|
|
class Window(QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setWindowTitle("sphere grid")
|
|
self.setGeometry(0, 0, 800, 600)
|
|
|
|
self.scene = QGraphicsScene(0, 0, 400, 400)
|
|
|
|
pp1 = LargeUltimaPattern(0, 0)
|
|
pp2 = SmallZPattern(351, 0)
|
|
pp1.connect(pp2)
|
|
self.scene.addItem(pp1)
|
|
self.scene.addItem(pp2)
|
|
|
|
view = QGraphicsView(self.scene)
|
|
view.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
|
|
vbox = QHBoxLayout(self)
|
|
vbox.addWidget(view)
|
|
|
|
self.setLayout(vbox)
|
|
self.show()
|