LibMini
Most Simple CMake Example
← CMake Example | ● | Resumee →
The most simple usage of the qt viewer is to just derive from the QtViewer class provided in the <mini/qt_viewer.h> header and override the timer event and the ecef geometry construction pure virtual methods. Source code for this use case is given in the simple.cmake folder. To start, just have a look at the qt_viewer.h header, which contains the complete definition of the QtViewer base class that can be subclassed as follows:
#include <mini/qt_viewer.h>
class MyQtViewer: public QtViewer
{
public:
MyQtViewer() {}
~MyQtViewer() {}
protected:
virtual mininode_group *build_ecef_geometry()
{
// return empty group node
// append nodes at your pleasure
mininode_group *group = new mininode_group();
return(group);
}
virtual void timerEvent(QTimerEvent *)
{
// rotate camera left so that earth rotates right
getCamera()->move_left(10000.0);
repaint();
}
};
class MyQtViewer: public QtViewer
{
public:
MyQtViewer() {}
~MyQtViewer() {}
protected:
virtual mininode_group *build_ecef_geometry()
{
// return empty group node
// append nodes at your pleasure
mininode_group *group = new mininode_group();
return(group);
}
virtual void timerEvent(QTimerEvent *)
{
// rotate camera left so that earth rotates right
getCamera()->move_left(10000.0);
repaint();
}
};
That’s it!
← CMake Example | ● | Resumee →