Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Tutorial 01 - Hello

There are three major components of Sceneview:

This first tutorial describes how to use one of the Sceneview Qt widgets to create a GUI. Later tutorials will introduce the other components.

#include <QApplication>
#include <sceneview/sceneview.hpp>
int main(int argc, char** argv)
{
QApplication app(argc, argv);
// Create a sv::Viewer. This is a convenience widget that extends QMainWindow
// and creates a "stock" application with the following contained widgets:
// - sv::Viewport
// - sv::RendererWidgetStack
// - sv::InputHandlerWidgetStack
sv::Viewer viewer;
// Show the stock viewer.
viewer.show();
// Run the Qt event loop
return app.exec();
}

If you build and run this example, you would hopefully see something like:

tutorial_01.png
tutorial_01_hello

This first snippet of code is our version of "Hello, world." sv::Viewer is a QMainWindow that bundles together a few commonly used widgets:

There's nothing much to see yet other than the widgets showing up. We'll get to those in later tutorials.

In advanced usage, you don't need to use sv::Viewer, and you can create your own QMainWindow and mix-and-match Sceneview widgets however you like. However, sv::Viewer can be useful for prototyping and for throwing together something quick-and-dirty.