Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 rock-master-20.01-gui-osgviz (0.20190726-1~buster) unstable; urgency=low
 .
   * Package automatically built using 'apaka'
   * repository: github:/rock-core/gui-osgviz.git
   * branch: refs/heads/master
   * commit: 721e38ab2ce3f1f43cbe2d05ef99d7cd4e6ecfb7
   * tag:
Author: Rock Packaging Daemon (based on apaka) <rock-dev@dfki.de>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2020-02-10

--- rock-master-20.01-gui-osgviz-0.20190726.orig/src/Main.cpp
+++ rock-master-20.01-gui-osgviz-0.20190726/src/Main.cpp
@@ -18,91 +18,80 @@
 
 
 class Output : public osgviz::Clickable{
-    virtual bool clicked(const int &buttonMask, const osg::Vec2d &cursor,
-        const osg::Vec3d &world, const osg::Vec3d &local,
-        Clickable* object, const int modifierMask,
-        osgviz::WindowInterface* window = NULL){
-            osgviz::Object* osgvizObject = dynamic_cast<osgviz::Object*> (object);
-            if (osgvizObject){
-                printf("clicked %s (%.2f %.2f %.2f)\n",osgvizObject->getName().c_str(),world.x(),world.y(),world.z());
-                return true;
-            }else{
-                printf("clicked (%.2f %.2f %.2f)\n",world.x(),world.y(),world.z());
-                return false;
-            }
-    }
+	virtual bool clicked(const int &buttonMask, const osg::Vec2d &cursor,
+                       const osg::Vec3d &world, const osg::Vec3d &local,
+                       Clickable* object, const int modifierMask,
+                       osgviz::WindowInterface* window = NULL){
+		osgviz::Object* osgvizObject = dynamic_cast<osgviz::Object*> (object);
+		if (osgvizObject){
+			printf("clicked %s (%.2f %.2f %.2f)\n",osgvizObject->getName().c_str(),world.x(),world.y(),world.z());
+			return true;
+		}else{
+			printf("clicked (%.2f %.2f %.2f)\n",world.x(),world.y(),world.z());
+			return false;
+		}
+	}
 };
 
 
 int main(int argc, char** argv)
 {
-    printf("getting instance\n");
-    fflush(stdout);
-    osg::ref_ptr<osgviz::OsgViz> osgViz = osgviz::OsgViz::getInstance();
-
-    //load lib with some helpful primitives
-    printf("load plugin\n");	fflush(stdout);
-    //osgviz::PrimitivesFactory *primitivesfactory = new osgviz::PrimitivesFactory(NULL);
-    std::shared_ptr<osgviz::PrimitivesFactory> primitivesfactory = osgviz::OsgViz::getModuleInstance<osgviz::PrimitivesFactory>("PrimitivesFactory");
+	printf("getting instance\n");
+	fflush(stdout);
+	osgviz::OsgViz *osgViz = osgviz::OsgViz::getInstance();
 
-    std::shared_ptr<osgviz::PrimitivesFactory> primitivesfactory2 = osgviz::OsgViz::getModuleInstance<osgviz::PrimitivesFactory>("PrimitivesFactory");
+	//load lib with some helpful primitives
+	printf("load plugin\n");	fflush(stdout);
+	//osgviz::PrimitivesFactory *primitivesfactory = new osgviz::PrimitivesFactory(NULL);
+	std::shared_ptr<osgviz::PrimitivesFactory> primitivesfactory = osgviz::OsgViz::getModuleInstance<osgviz::PrimitivesFactory>("PrimitivesFactory");
 
-    std::shared_ptr<osgviz::PrimitivesFactory> primitivesfactory3 = osgviz::OsgViz::getModuleInstance<osgviz::PrimitivesFactory>("PrimitivesFactory2");
+	std::shared_ptr<osgviz::PrimitivesFactory> primitivesfactory2 = osgviz::OsgViz::getModuleInstance<osgviz::PrimitivesFactory>("PrimitivesFactory");
 
-    try {
-        std::shared_ptr<osgviz::ModelLoader> primitivesfactory3 = osgviz::OsgViz::getModuleInstance<osgviz::ModelLoader>("PrimitivesFactory2");
+	std::shared_ptr<osgviz::PrimitivesFactory> primitivesfactory3 = osgviz::OsgViz::getModuleInstance<osgviz::PrimitivesFactory>("PrimitivesFactory2");
 
-    } catch (std::exception& e){
-        printf("ERROR: %s\n", e.what());
-    }
+        try {
+            std::shared_ptr<osgviz::ModelLoader> primitivesfactory3 = osgviz::OsgViz::getModuleInstance<osgviz::ModelLoader>("PrimitivesFactory2");
 
+        } catch (std::runtime_error e){
+            printf("%s\n", e.what());
+        }
 
-    osgviz::OsgViz::printModules();
 
-    printf("PF \n\t%p \n\t%p\n\t%p\n",primitivesfactory,primitivesfactory2,primitivesfactory3);
+	osgviz::OsgViz::printModules();
 
-    if (!primitivesfactory){
-        printf("plugin not found\n");	fflush(stdout);
-    }
+	printf("PF \n\t%p \n\t%p\n\t%p\n",primitivesfactory.get(),primitivesfactory2.get(),primitivesfactory3.get());
 
-    osg::ref_ptr<osgviz::Object> grid = primitivesfactory->createGrid();
-    osgViz->addChild(grid);
+	if (!primitivesfactory){
+		printf("plugin not found\n");	fflush(stdout);
+	}
 
-    osg::ref_ptr<osgviz::Object> arrow = primitivesfactory->createArrow();
-    arrow->rotate(M_PI/2.0,osg::Vec3d(0,1,0));
-    arrow->setName("Arrow");
-    osgViz->addChild(arrow);
+	osg::ref_ptr<osgviz::Object> grid = primitivesfactory->createGrid();
+	osgViz->addChild(grid);
 
-    osg::ref_ptr<osgviz::Object> axes = primitivesfactory->createAxes();
-    osgViz->addChild(axes);
+	osg::ref_ptr<osgviz::Object> arrow = primitivesfactory->createArrow();
+	arrow->rotate(M_PI/2.0,osg::Vec3d(0,1,0));
+	arrow->setName("Arrow");
+	osgViz->addChild(arrow);
 
-    printf("creating window\n");fflush(stdout);
+	osg::ref_ptr<osgviz::Object> axes = primitivesfactory->createAxes();
+	osgViz->addChild(axes);
 
-    int winid = 0;
-	if (argc >= 2){
-		if (strcmp(argv[1],"fullscreen")==0){
-            osgviz::WindowConfig windowConf;
-            windowConf.fullScreen = true;
+	printf("creating window\n");fflush(stdout);
 
+	int winid = osgViz->createWindow();
 
-            winid = osgViz->createWindow(windowConf);
-		}
-	}else{
-        winid = osgViz->createWindow();
-    }
-
-    osg::ref_ptr<osgviz::Window> window = osgViz->getWindowManager()->getWindowByID(winid);
+	osg::ref_ptr<osgviz::Window> window = osgViz->getWindowManager()->getWindowByID(winid);
 
-    osg::ref_ptr<osgviz::HUD> hud = window->addHUD(1920,1080,osg::Camera::ProjectionResizePolicy::FIXED);
+	osgviz::HUD* hud = window->addHUD(1920,1080,osg::Camera::ProjectionResizePolicy::FIXED);
 
-    //osg::ref_ptr<osgviz::Object> hudarrow = primitivesfactory->createArrow();
-    //hudarrow->setPosition(100,100,0);
-    //hudarrow->setScale(200,200,200);
-    //hud->addHudObject(hudarrow);
+//	osg::ref_ptr<osgviz::Object> hudarrow = primitivesfactory->createArrow();
+//	hudarrow->setPosition(100,100,0);
+//	hudarrow->setScale(200,200,200);
+//	hud->addHudObject(hudarrow);
 
 
-    osg::ref_ptr<osg::Geode> geode = new osg::Geode();
-    osg::ref_ptr<osgText::Text> text = new  osgText::Text;
+    osg::Geode* geode = new osg::Geode();
+    osgText::Text* text = new  osgText::Text;
     geode->addDrawable( text );
     osg::Vec3 position(150.0f,800.0f,0.0f);
     text->setPosition(position);
@@ -144,7 +133,7 @@ int main(int argc, char** argv)
 
     //test 2nd HUD
 
-    osg::ref_ptr<osgviz::HUD> hud2 = osgViz->getWindowManager()->getWindowByID(winid)->getSuperView(0)->addHUD(1920,1080);
+    osgviz::HUD* hud2 = osgViz->getWindowManager()->getWindowByID(winid)->getSuperView(0)->addHUD(1920,1080);
     osg::ref_ptr<osgviz::PrimitivesFactory::Shape> cone = primitivesfactory->createShape(osgviz::PrimitivesFactory::CONE,100,100,0);
     cone->setPosition(700,500,0);
     //shape->setScale(100,100,100);
@@ -155,42 +144,46 @@ int main(int argc, char** argv)
     hud2->addHudObject(cone);
 
 
-    //osg::ref_ptr<osgviz::Object> image = primitivesfactory->loadImage("test.png");
-    ////shape1->setPosition(0.5,0.5,0.5);
-    //image->setPosition(1000,500,0);
-    //hud->addHudObject(image);
-
-    //sleep(1);
-    //you can create multiple windows and views ones:
-    //	int win2 = osgViz->createWindow();
-    //	osg::ref_ptr<osgviz::Window> window2 = osgViz->getWindowManager()->getWindowByID(win2);
-    //	osgviz::ViewConfig view(0,0,0.3,0.3);
-    //	window2->addView(view);
-    
-    //this starts a update thread for the visualisation, requires locking in the other threads:
-    //osgViz->lockThread();
-    //do updates
-    //osgViz->unlockThread();
-    //printf("startThread\n");fflush(stdout);
-    //osgViz->startThread();
-
-    //or don't start the thread and update manually using osgViz->update();
-
-    while (!osgViz->done()){
-        //osgViz->lockThread();
-        //do updates
-        //osgViz->unlockThread();
-        osgViz->update();
-        //printf("sleep\n");fflush(stdout);
-
-        //sleep(5);
-        //osgViz->getWindowManager()->getWindowByID(0)->setFullscreen(true);
-        //sleep(5);
-        //osgViz->getWindowManager()->getWindowByID(0)->setFullscreen(false);
-        //sleep(5);
-        //osgViz->getWindowManager()->getWindowByID(0)->setWindowGeometry(150,150,1240,768);
-        //sleep(5);
-    }
+//    osg::ref_ptr<osgviz::Object> image = primitivesfactory->loadImage("test.png");
+//    //shape1->setPosition(0.5,0.5,0.5);
+//    image->setPosition(1000,500,0);
+//    hud->addHudObject(image);
+
+	//sleep(1);
+	//you can create multiple windows and views ones:
+//	int win2 = osgViz->createWindow();
+//	osg::ref_ptr<osgviz::Window> window2 = osgViz->getWindowManager()->getWindowByID(win2);
+//	osgviz::ViewConfig view(0,0,0.3,0.3);
+//	window2->addView(view);
+
+
+
+	//this starts a update thread for the visualisation, requires locking in the other threads:
+	//osgViz->lockThread();
+	//do updates
+	//osgViz->unlockThread();
+	//printf("startThread\n");fflush(stdout);
+	//osgViz->startThread();
+
+	//or don't start the thread and update manually using osgViz->update();
+
+
+	while (true){
+		//osgViz->lockThread();
+		//do updates
+		//osgViz->unlockThread();
+		osgViz->update();
+		//printf("sleep\n");fflush(stdout);
+
+		//sleep(5);
+//		osgViz->getWindowManager()->getWindowByID(0)->setFullscreen(true);
+//		sleep(5);
+//		osgViz->getWindowManager()->getWindowByID(0)->setFullscreen(false);
+//		sleep(5);
+//		osgViz->getWindowManager()->getWindowByID(0)->setWindowGeometry(150,150,1240,768);
+//		sleep(5);
+
+	}
 
-    return 0;
+	return 0;
 }
