Esempio n. 1
0
    def load_ui(self):
        loader = QUiLoader()
        path = os.path.join(os.path.dirname(__file__), "form.ui")
        ui_file = QFile(path)
        ui_file.open(QFile.ReadOnly)
        self.ui = loader.load(ui_file, self)
        ui_file.close()

        #        self.chartView = QtCharts.QChartView()
        #        self.chartView.setMinimumWidth(450)
        #        self.graphicsView = self.ui.findChild(QGraphicsView, "graphicsView")

        # graphics
        self.tab_summary = self.ui.findChild(QWidget, "tab_summary")

        #        QtDataVisualization.QAbstract3DGraph

        self.scatter3d = QtDataVisualization.Q3DScatter()
        self.container = QWidget.createWindowContainer(self.scatter3d)
        self.container.setMinimumWidth(450)

        self.scatterProxy = QtDataVisualization.QScatterDataProxy()
        self.scatterSeries = QtDataVisualization.QScatter3DSeries(
            self.scatterProxy)

        self.scatter3d.axisX().setTitle("x")
        self.scatter3d.axisY().setTitle("y")
        self.scatter3d.axisZ().setTitle("z")

        self.scatter3d.addSeries(self.scatterSeries)

        self.find_widgets()
Esempio n. 2
0
 def __init__(self, data=None, path=None):
     self.scatter_graph = QtDataVisualization.Q3DScatter()
     self.scatter_graph.activeTheme().setType(
         QtDataVisualization.Q3DTheme.ThemeEbony)
     self.scatter_graph.setShadowQuality(
         QtDataVisualization.QAbstract3DGraph.ShadowQualitySoftHigh)
     self.scatter_graph.scene().activeCamera().setCameraPreset(
         QtDataVisualization.Q3DCamera.CameraPresetNone)
     # self.scatter_graph.scene().activeCamera().setXRotation(180)
     # self.scatter_graph.scene().activeCamera().setYRotation(100)
     self.proxy = QtDataVisualization.QScatterDataProxy()
     self.series = QtDataVisualization.QScatter3DSeries(self.proxy)
     self.series.setItemLabelFormat(
         '@xTitle: @xLabel @yTitle: @yLabel @zTitle: @zLabel')
     self.series.setMeshSmooth(True)
     self.scatter_graph.addSeries(self.series)
     self.scatter_graph.axisX().setTitle('X')
     self.scatter_graph.axisY().setTitle('Y')
     self.scatter_graph.axisZ().setTitle('Z')
     self.scatter_graph.axisX().setReversed(True)
     self.scatter_graph.axisY().setReversed(True)
     self.scatter_graph.axisZ().setReversed(True)
     if path is not None:
         data = np.load(path)
     if data is not None:
         self.refresh(data)
Esempio n. 3
0
    def __init__(self, scatter, s_data):
        self.scatter = scatter
        self._s_data = s_data
        self.timer = QTimer()

        self.series = QtDataVisualization.QScatter3DSeries()
        self.data = [
            QVector3D(0.5, 0.5, 0.5),
            QVector3D(-0.3, -0.5, -0.4),
            QVector3D(0.0, -0.3, 0.2)
        ]
        self.series.dataProxy().addItems(self.data)
        self.series.setItemSize(0.5)
        self.series.setMeshSmooth(True)

        self.scatter.addSeries(self.series)
        self.scatter.setAspectRatio(1.0)
        self.scatter.setHorizontalAspectRatio(1.0)

        # Setting of plot limits
        self.scatter.axisX().setRange(0, s_data.getBoxWidth())
        self.scatter.axisY().setRange(0, s_data.getBoxWidth())
        self.scatter.axisZ().setRange(0, s_data.getBoxWidth())

        self._time_step = s_data.getTimeStep() * 1000
        self.timer.timeout.connect(self.makeStep)
        # Drowing of the data and starting of the timer
        self.drawData()
        self.timer.start(self._time_step)