Skip to content

This is a learning project of myself to explore how to integrate OpenSceneGraphinto Qt6 for visualization purposes in computer vision research.

License

Notifications You must be signed in to change notification settings

hobbeshunter/ConanQtOSGDemo

Repository files navigation

ConanQtOSGDemo

This is a learning project of myself to explore how to integrate OpenSceneGraph into Qt6 for visualization purposes in computer vision research.

Setup

The project uses conan and CMake for dependency and build management, respectively.

Right now it is only tested on Ubuntu 20.04.

Starting in the root folder run the following commands:

conan create ./fontconfig_conanfile.py fontconfig/system@mwudenka/snapshot
mkdir -p build
cd build
conan install .. --build=missing
cmake ..
cmake --build .
cd ..

Why creating a system fontconfig package?

As of writing the conan center recipe of fontconfig hardcodes the sysconfdir to a path on the conan build server (see line 61). One way around that issue is to set the environment variable FONTCONFIG_PATH. But that means that every user needs to know where fonts are stored on his machine. That's why I created a recipe that installs (if not already available) fontconfig using the system package manager (apt in that case) and provides conan all paths important for linkage.

Run

To execute the build result enter:

./build/bin/ConanQtOSGDemoExe

You should see a window appearing:

resulting graphical user interface

What does it do

First, it demonstrates one possible integration of OSG into the Qt6 Model-View-Delegate pattern. Have a look at src/models/QPointCloudModel.(h|cpp) and src/models/QPointCloudView.(h|cpp). Some generic parts are extracted to src/utils/QOSGWidget.(h|cpp), src/views/QAbstractOSGView.(h|cpp), src/utils/QPickHandler.(h|cpp) and src/utils/PickableGeode.(h|cpp) in the hope that they can be reused. Sticking to the MVD standards makes it easy to use generic classes as the QTableView and QItemSelectionModel.

It also demonstrates how a UI can be modularized using widget promotion. That way ui/PointFactoryControl.ui is imported into ui/MainWindow.ui.

Such an ui file can be edited using the Qt Designer:

Screenshot of Qt Designer

Development

I recommend using CLion with the conan addon.

About

This is a learning project of myself to explore how to integrate OpenSceneGraphinto Qt6 for visualization purposes in computer vision research.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published