LibMini

Extension

Navigation | | Programming Example

Extension

The QTViewer can be extended to display additional geometry (such as buildings, GPS paths etc.) in a georeferenced ECEF context by deriving a Renderer class from QTViewer’s Viewer class. In that class, we overload the build_ecef_geometry() method, which constructs a scene graph using libMini’s mininode class as a basis.

For example, we can add a cylinder as the north pole by specifying its georeferenced position (mininode_coord), color (mininode_color) and geometry (mininode_geometry_tube) and linking those node components together as a simple scene graph. The so defined scene graph is rendered on top of the earth and on top of any loaded libGrid or VTBuilder tilesets:

class Renderer: public Viewer
{
   protected:

   mininode_group *Renderer::build_ecef_geometry()
   {
      mininode_group *scene =
         new mininode_coord(minicoord(miniv3d(0, 90*3600, 0),
                            minicoord::MINICOORD_LLH))->
            append_child(new mininode_color(miniv3d(0.0, 0.0, 1.0)))->
            append_child(new mininode_geometry_tube(10000, 500000));

      return(scene);
   }
};

Detailed information about libMini’s node classes can be found in the scene graph node list and the mini/mininodes.h header.

Navigation | | Programming Example

Options: