Home  *  FAQ  *  About

OSGUIsh

GUI-like events for Open Scene Graph nodes

OSGUIsh is a library that generates GUI-like events for nodes in an OSG scene graph. So, a programmer can install callbacks that are executed when the mouse moves over a node, or when it is clicked, or double-clicked, or the mouse wheel moves, or… you got the idea. The following snippet gives a taste of OSGUIsh:

// First you define a callback
void HandleClick(OSGUIsh::HandlerParams& params)
{
   std::cout << "Click on node '" << params.node << "'!\n";
}
 
// Later, you connect the events to the callbacks
osgViewer::Viewer viewer;
 
osg::ref_ptr<OSGUIsh::EventHandler> guishEH(
   new OSGUIsh::EventHandler());
 
viewer.addEventHandler(guishEH);
 
osg::ref_ptr<osg::Node> loadedModel =
   osgDB::readNodeFile("Some3DModel.obj");
 
guishEH->addNode(loadedModel);
guishEH->getSignal(loadedModel, "Click")->connect(&HandleClick);

Some OSGUIsh features are:

  • Support for the following events: “mouse enter”, “mouse leave”, “mouse move”, “mouse down”, “mouse up”, “click”, “double click”, “mouse wheel up”, “mouse wheel down”, “key up” and “key down”
  • Supports differents policies to determine which node gets mouse wheel and keyboard events.
  • Works even when using HUDs (node masks need to be used in this case).

Assorted facts about OSGUIsh

OSGUIsh…

  • Is somewhat documented, but there is no user's guide yet. Take a look on the demos on the source distribution for some working examples.
  • Is still in the early stages of development. I used it in a couple of small projects only, so it tends to not be updated very regularly. Anyway, the codebase is small, and should not be hard to understand.
  • Was tested both under Linux with GCC 4.x and under Windows with Visual Studio 2008.
  • Depends on the Open Scene Graph and Boost (it is based on Boost.Signals).
  • Has a build system based on CMake, but I strongly recommend to add OSUIsh source files directly to your own projects.
  • Is distributed under the OSGPL license (the same as the Open Scene Graph).
  • Has one of the worst names I could think.

Downloads

Latest release is 0.4.1, released in 02011-11-10. It can be downloaded here: OSGUIsh-0.4.1.tar.gz. This is a very boring release, that brings just little performance improvement and removes all warnings from the code.

If you ever need an old release, they are available in the changelog page.

Source code repository

OSGUIsh's Mercurial source code repository is available at Bitbucket: http://bitbucket.org/lmb/osguish.

(I also have set up a Git mirror of the repository at GitHub: https://github.com/lmbarros/OSGUIsh.)

Liked OSGUIsh? What about a tip? Any amount will make my day. Donation is handled by PayPal. It is safe and you don't need a PayPal account.


Contact

OSGUIsh is developed by Leandro Motta Barros. You can view my contact information in the About page.