Today we introduce the Data Visualization module, and the Qt Charts module was explained in the previous issue. If Qt Charts is a 2D interface, then the Data Visualization module we will talk about this time is a 3D Data Visualization interface. Data Visualization is a Qt module for 3d display of Data, available for free after Qt5.7. Data Visualization is used for 3d display of Data, including 3D histogram, 3D spatial scatter, etc. Data Visualization, like Qt Charts, is also a Qt-based graphical view framework.

The 3D display function of Data Visualization is mainly realized by three 3D graphics classes: 3D histogram Q3Dbars, 3D space scatter Q3DScatter and 3D surface Q3DSuface. The parent class of these three graphics classes is QAbstract3DGraph, which is inherited from Qwindow.

Data Visualization is similar to Qt Charts in that both are based on Qt’s graphical view structure, so a 3D graph is also composed of diagrams, sequences, coordinate axes, and other elements. Q3DBars, Q3DScatter and Q3DSurface are equivalent to QChart in Qt Charts, and each 3d figure corresponds to one 3D sequence.A sequence class can only be used for some 3d graphics classes, for example, QBar3DSeries can only be used as the sequence of 3D bar graph Q33DBars, but not as the sequence of 3D scatter graph. And a graph can have multiple sequences of the same type, used to display different surfaces. Just like QChart has an axis class, 3d graphics also has an axis class. Including: QValue3DAxis (for numeric axis), QCategory3DAxis (for literal axis), and both inherit from QAbstract3DAxis.There are Data broker classes in the Data Visualization model, which are the classes that correspond to the sequence and store the Data for the sequence. Due to the different types of 3D graphics, the structure of stored data is also different. To this end, for each of these sequences, there is a data proxy class that inherits from QAbstractDataProxy, and each data proxy class also has a data proxy subclass based on the item data model, as shown below:Sequence for 3 d surface QSurface3DSeries and there is a dedicated to display map elevation data of the proxy class, namely QHeightMapSurfaceDataProxy, it can be a picture says elevation data show that as the three-dimensional curved surface, Users can also customize the data proxy class according to their own needs.

To use the Data Visualization module in a project, add one line of statements to the project configuration file: Qt += datavisualization And add the following two lines to the header file or source file of the class using the module:

#include using namespace QtDataVisualization

PS: This article is from the book “Qt5.9 Development Guide”, if necessary, you can go to understand.

  • End –

With the rapid development of technology, AMu Lab will keep up with the pace of technology and constantly recommend the latest technology and hardware in the robot industry to everyone. The greatest value of our training is to see our trainees make rapid progress in technology. If you are in the robotics industry, please follow our official account, we will continue to publish the most valuable information and technology in the robotics industry. Amu Lab is committed to providing open source software and hardware tools and course services for robot r&d to make r&d more efficient!