Index: experimental/distortionNG/DistortionManipulator.cpp
===================================================================
--- experimental/distortionNG/DistortionManipulator.cpp	(revision 355)
+++ experimental/distortionNG/DistortionManipulator.cpp	(revision 356)
@@ -37,4 +37,5 @@
 	
 	createVertexHighlighter();
+	createHUD();
 
 	_camera = 0;
@@ -48,11 +49,12 @@
 void DistortionManipulator::getUsage(osg::ApplicationUsage& usage) const
 {
-    usage.addKeyboardMouseBinding("Keypad 7","Show distortion mesh / intensity map / none.");
-	usage.addKeyboardMouseBinding("Keypad 8","Save distortion set.");	// via plugin
+	usage.addKeyboardMouseBinding("Keypad 0","Show/Hide distortion HUD.");
+	usage.addKeyboardMouseBinding("Keypad 1","Reset distortion.");
+	usage.addKeyboardMouseBinding("Keypad 2","Reset intensity blending.");
 	usage.addKeyboardMouseBinding("Keypad 4","Toggles Setup Mode between DISABLED, MANUAL & DELEGATED.");
  	usage.addKeyboardMouseBinding("Keypad 5","MANUAL Mode: Toggle between blending & distortion setup.");
-	usage.addKeyboardMouseBinding("Keypad 6","MANUAL Mode: Toggle if distortion drags affect mesh or rtt texture coordinates.");	// Defaults to Mesh
-	usage.addKeyboardMouseBinding("Keypad 1","Reset distortion.");
-	usage.addKeyboardMouseBinding("Keypad 2","Reset intensity blending.");
+    usage.addKeyboardMouseBinding("Keypad 6","MANUAL Mode: Toggle if distortion drags affect mesh or rtt texture coordinates.");	// Defaults to Mesh
+	usage.addKeyboardMouseBinding("Keypad 7","Show distortion mesh / intensity map / none.");
+	usage.addKeyboardMouseBinding("Keypad 8","Save distortion set.");	// via plugin
 }
 
@@ -84,5 +86,5 @@
 		{
 			OSG_ALWAYS<<"mouse click!"<<std::endl;
-			if ( activeSetupMode == MANUAL && ea.getModKeyMask()&osgGA::GUIEventAdapter::MODKEY_CTRL && ea.getButton() == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
+			if ( activeSetupMode == MANUAL /*&& ea.getModKeyMask()&osgGA::GUIEventAdapter::MODKEY_CTRL*/ && ea.getButton() == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
 			{
 				osgViewer::View* viewer = dynamic_cast<osgViewer::View*>(&aa);
@@ -107,4 +109,10 @@
         case(osgGA::GUIEventAdapter::KEYDOWN):
 		{
+			if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Insert)	// KP 0: Show/Hide HUD   // definition: child #0 = mesh, #1 = highlighter, #2 HUD
+			{
+				bool oldValue = _distortionSet->getDistortionInternals()->getValue(2);
+				_distortionSet->getDistortionInternals()->setValue(2, !oldValue);
+				return(true);
+			}
 			if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_End)	// KP 1: reset distortion
 			{
@@ -124,6 +132,6 @@
 					{
 						activeSetupMode = MANUAL;
-						OSG_ALWAYS<<"SetupMode MANUAL activated"<<std::endl;
-						_distortionSet->getDistortionInternals()->setValue(1, true); // per definition #0 = mesh, #1 = highlighter
+						OSG_NOTICE<<"SetupMode MANUAL activated"<<std::endl;
+						_distortionSet->getDistortionInternals()->setValue(1, true); // definition: child #0 = mesh, #1 = highlighter, #2 HUD
 						break;
 					}
@@ -131,6 +139,6 @@
 					{
 						activeSetupMode = DELEGATED;
-						_distortionSet->getDistortionInternals()->setValue(1, false); // per definition #0 = mesh, #1 = highlighter
-						OSG_ALWAYS<<"SetupMode DELEGATED activated"<<std::endl;
+						_distortionSet->getDistortionInternals()->setValue(1, false); // definition: child #0 = mesh, #1 = highlighter, #2 HUD
+						OSG_NOTICE<<"SetupMode DELEGATED activated"<<std::endl;
 						break;
 					}
@@ -138,10 +146,10 @@
 					{
 						activeSetupMode = DISABLED;
-						_distortionSet->getDistortionInternals()->setValue(1, false); // per definition #0 = mesh, #1 = highlighter
-						OSG_ALWAYS<<"SetupMode DISABLED activated"<<std::endl;
+						_distortionSet->getDistortionInternals()->setValue(1, false); // definition: child #0 = mesh, #1 = highlighter, #2 HUD
+						OSG_NOTICE<<"SetupMode DISABLED activated"<<std::endl;
 						break;
 					}
 				}
-
+				updateHUD();
 				return(true);
 			}
@@ -150,5 +158,5 @@
 
 				activeManualSetupMode = (activeManualSetupMode==DISTORTION?BLENDING:DISTORTION);
-				OSG_ALWAYS<<"KEY_KP_5 : activeManualSetupMode is now "<<activeManualSetupMode<<std::endl;
+				updateHUD();
 				return(true);
 			}
@@ -156,5 +164,5 @@
 			{
 				activeDistortionMode = (activeDistortionMode==MESH?TEXCOORDINATES:MESH);
-				OSG_ALWAYS<<"KEY_KP_6 : activeDistortionMode is now "<<activeDistortionMode<<std::endl;
+				updateHUD();
 				return(true);
 			}
@@ -186,6 +194,5 @@
 				}
 
-
-				OSG_ALWAYS<<"KEY_KP_7 : activeVisualizationMode is now "<<activeVisualizationMode<<std::endl<<std::endl;
+				updateHUD();
 				return(true);
 			}
@@ -196,5 +203,4 @@
 			}
 			
-
 			return false;	// Event ignored
 		}
@@ -202,5 +208,8 @@
 		case(osgGA::GUIEventAdapter::FRAME):
 		{
-			//OSG_ALWAYS<<"FRAME!"<<std::endl;
+			if ( activeSetupMode == DELEGATED)
+			{
+				OSG_ALWAYS<<"Todo: Calling delegated class!"<<std::endl;
+			}
 			break;
 		}
@@ -297,5 +306,99 @@
 	geode->setCullingActive(false);	// disable the culling for the selector, otherwise the selector is culled away on the edge.
 
-	_distortionSet->getDistortionInternals()->addChild(geode, false);
+	_distortionSet->getDistortionInternals()->addChild(geode, false);	//  = child #1  :definition: child #0 = mesh, #1 = highlighter, #2 HUD
+}
+
+void DistortionManipulator::createHUD()
+{
+	osg::ref_ptr<osg::Geode> geode = new osg::Geode;
+	
+	osg::StateSet* stateSet = geode->getOrCreateStateSet();
+	stateSet->setRenderBinDetails( 99, "RenderBin");
+	// disable depth test to ensure that it is always drawn.
+	stateSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
+	stateSet->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
+
+	// Add Text: 
+	osg::Vec3 position(20.0f,120.0f,0.0f);
+	osg::Vec3 delta(0.0f,-25.0f,0.0f);
+	std::string timesFont("fonts/arial.ttf");
+	{
+		osg::ref_ptr<osgText::Text> textHeader = new osgText::Text;
+		textHeader->setText("Distortion Setup:");
+		textHeader->setFont(timesFont);
+		textHeader->setPosition(position);
+		textHeader->setCharacterSize(21);
+		textHeader->setDataVariance(osg::Object::STATIC); 
+		geode->addDrawable( textHeader );
+
+		position += delta;
+
+		hudSetupMode = new osgText::Text;
+		hudSetupMode->setFont(timesFont);
+		hudSetupMode->setPosition(position);
+		hudSetupMode->setCharacterSize(21);
+		hudSetupMode->setDataVariance(osg::Object::DYNAMIC); 
+		geode->addDrawable( hudSetupMode );
+
+		position += delta;
+
+		hudDistortionMode = new osgText::Text;
+		hudDistortionMode->setFont(timesFont);
+		hudDistortionMode->setPosition(position);
+		hudDistortionMode->setCharacterSize(21);
+		hudDistortionMode->setDataVariance(osg::Object::DYNAMIC); 
+		geode->addDrawable( hudDistortionMode );
+
+		position += delta;
+
+		hudManualSetupMode = new osgText::Text;
+		hudManualSetupMode->setFont(timesFont);
+		hudManualSetupMode->setPosition(position);
+		hudManualSetupMode->setCharacterSize(21);
+		hudManualSetupMode->setDataVariance(osg::Object::DYNAMIC); 
+		geode->addDrawable( hudManualSetupMode );
+
+		position += delta;
+
+		hudVisualizationMode = new osgText::Text;
+		hudVisualizationMode->setFont(timesFont);
+		hudVisualizationMode->setPosition(position);
+		hudVisualizationMode->setCharacterSize(21);
+		hudVisualizationMode->setDataVariance(osg::Object::DYNAMIC); 
+		geode->addDrawable( hudVisualizationMode );
+	}
+	
+	updateHUD();
+	_distortionSet->getDistortionInternals()->addChild(geode, false);	//  = child #2  :definition: child #0 = mesh, #1 = highlighter, #2 HUD
+}
+
+void DistortionManipulator::updateHUD()
+{
+	switch(activeSetupMode)
+	{
+		case DISABLED : hudSetupMode->setText("Setup Mode : DISABLED"); break;
+		case MANUAL : hudSetupMode->setText("Setup Mode : MANUAL"); break;
+		case DELEGATED : hudSetupMode->setText("Setup Mode : DELEGATED"); break;
+		default: hudSetupMode->setText("");
+	};
+	switch(activeDistortionMode)
+	{
+		case MESH : hudDistortionMode->setText("Distortion Mode : MESH"); break;
+		case TEXCOORDINATES : hudDistortionMode->setText("Distortion Mode : TEXCOORDINATES"); break;
+		default: hudDistortionMode->setText("");
+	};
+	switch(activeManualSetupMode)
+	{
+		case DISTORTION : hudManualSetupMode->setText("Manual Setup Mode : DISTORTION"); break;
+		case BLENDING : hudManualSetupMode->setText("Manual Setup Mode : BLENDING"); break;
+		default: hudManualSetupMode->setText("");
+	};
+	switch(activeVisualizationMode)
+	{
+		case DISTORTION_MESH : hudVisualizationMode->setText("Visualization Mode : DISTORTION_MESH"); break;
+		case INTENSITY_MAP : hudVisualizationMode->setText("Visualization Mode : INTENSITY_MAP"); break;
+		case NONE : hudVisualizationMode->setText("Visualization Mode : NONE"); break;
+		default: hudVisualizationMode->setText("");
+	};
 }
 
