예제 #1
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)
예제 #2
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()