Index: experimental/distortionNG/distortionNG.cpp
===================================================================
--- experimental/distortionNG/distortionNG.cpp	(revision 353)
+++ 	(revision )
@@ -1,117 +1,0 @@
-#include "distortionNG.h"
-
-#include<osg/Point>
-
-
-#include<osgViewer/Viewer>
-
-
-
-osg::Geode* distortionHandler::createVertexHighlighter()
-{
-	osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array(1);
-	(*colors)[0] = _highlightColor;
-
-	_highlighter = new osg::Geometry;
-	_highlighter->setDataVariance( osg::Object::DYNAMIC );
-	_highlighter->setUseDisplayList( false );
-	_highlighter->setUseVertexBufferObjects( true );
-	_highlighter->setVertexArray( new osg::Vec3Array(1) );	// The highlighter vertex is updated by computeSelectedVertex(..)
-	_highlighter->setColorArray( colors.get() );
-	_highlighter->setColorBinding( osg::Geometry::BIND_OVERALL );
-	_highlighter->addPrimitiveSet( new osg::DrawArrays(GL_POINTS, 0, 1) );
-
-	osg::ref_ptr<osg::Geode> geode = new osg::Geode;
-	geode->addDrawable( _highlighter.get() );
-	geode->getOrCreateStateSet()->setAttributeAndModes( new osg::Point(8.0f) );
-	geode->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
-
-	return geode.release();
-}
-
-bool distortionHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa )
-{
-	// Only pressing CTRL activates distortion editing
-	if ( !(ea.getModKeyMask()&osgGA::GUIEventAdapter::MODKEY_CTRL) )
-		return false;	// False means not handled.
-
-
-    if ( ea.getEventType() == osgGA::GUIEventAdapter::PUSH && ea.getButton() == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
-	{
-		osgViewer::View* viewer = dynamic_cast<osgViewer::View*>(&aa);
-		if ( viewer )
-		{
-			osg::notify(osg::ALWAYS)<<std::endl<<"Intersection:"<<std::endl<<"ea.getX()="<<ea.getX()<<std::endl;
-			osg::notify(osg::ALWAYS)<<"ea.getY()="<<ea.getY()<<std::endl;
-			osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::PROJECTION, ea.getX(), ea.getY());
-			osgUtil::IntersectionVisitor iv( intersector.get() );
-			//viewer->getCamera()->accept( iv );
-			_camera->accept( iv );
-	        
-			if ( intersector->containsIntersections() )
-			{
-				osgUtil::LineSegmentIntersector::Intersection& result = *(intersector->getIntersections().begin());
-				computeSelectedVertex( result );
-			}
-		}
-	}
-
-	if ( ea.getEventType() == osgGA::GUIEventAdapter::DRAG  )
-	{
-		osg::notify(osg::ALWAYS)<<std::endl<<"Drag:"<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getXnormalized()="<<ea.getXnormalized()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getYnormalized()="<<ea.getYnormalized()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getX()="<<ea.getX()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getXin()="<<ea.getXmin()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getXmax()="<<ea.getXmax()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getY()="<<ea.getY()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getYin()="<<ea.getYmin()<<std::endl;
-        osg::notify(osg::ALWAYS)<<"ea.getYmax()="<<ea.getYmax()<<std::endl;
-
-		return true;	// true means event handled: not forwarded to the camera manipulator;
-	}
-
-
-    return false;	// False means not handled.
-}
-
-void distortionHandler::computeSelectedVertex( osgUtil::LineSegmentIntersector::Intersection& result )
-{
-	osg::Geometry* geom = dynamic_cast<osg::Geometry*>( result.drawable.get() );
-	if ( !geom || !_highlighter || geom==_highlighter )
-		return;
-
-	osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>( geom->getVertexArray() );
-	osg::Vec3Array* selVertices = dynamic_cast<osg::Vec3Array*>( _highlighter->getVertexArray() );
-	if ( !vertices || !selVertices )
-		return;
-	
-	OSG_NOTIFY(osg::ALWAYS)<<"size of vertices="<<vertices->size()<<std::endl;
-	OSG_NOTIFY(osg::ALWAYS)<<"size of selVertices="<<selVertices->size()<<std::endl;
-
-	osg::Vec3 point = result.getWorldIntersectPoint();
-	osg::Matrix matrix = osg::computeLocalToWorld( result.nodePath );	// To compute the intersection vertices in world coordinates not in model coordinates
-	OSG_NOTIFY(osg::ALWAYS) << "Intersection-indices: Size=" << result.indexList.size() << std::endl;
-	const std::vector<unsigned int>& selIndices = result.indexList;
-	{
-		double maxRatio = 0.0;
-		int closestVertexIndex = 0;
-		for ( unsigned int i=0; i<3 && i<result.ratioList.size(); i++ )	//iterate through rations and search for maxRation=nearestVertex
-		{
-			if(result.ratioList[i] > maxRatio)
-			{
-				maxRatio = result.ratioList[i];
-				closestVertexIndex = result.indexList[i];
-			}
-			OSG_NOTIFY(osg::ALWAYS)<<"maxRatio="<<maxRatio<<std::endl;
-			OSG_NOTIFY(osg::ALWAYS)<<"closestVertexIndex="<<closestVertexIndex<<std::endl;
-		}
-		OSG_NOTIFY(osg::ALWAYS)<<"nearest vertex: X="<<(*vertices)[closestVertexIndex].x()<<" Y="<<(*vertices)[closestVertexIndex].y()<<" Z="<<(*vertices)[closestVertexIndex].z()<<std::endl;
-		osg::Vec3 vertex = (*vertices)[closestVertexIndex] * matrix;
-
-		selVertices->front() = vertex;		
-		OSG_NOTIFY(osg::ALWAYS)<<"selected vertice: X="<<vertex.x()<<" Y="<<vertex.y()<<" Z="<<vertex.z()<<std::endl;
-	}
-	selVertices->dirty();
-	_highlighter->dirtyBound(); 
-}
Index: experimental/distortionNG/distortionNG.h
===================================================================
--- experimental/distortionNG/distortionNG.h	(revision 353)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#pragma once
-
-#include<osg/Referenced>
-#include<osg/Geometry>
-#include<osg/MatrixTransform>
-
-#include<osgGA/GUIEventHandler>
-
-#include<osgViewer/Viewer>
-
-
-
-
-class distortionHandler : public osgGA::GUIEventHandler
-{
-
-public:
-	distortionHandler( osg::Camera* camera, osg::Geometry* distortionMesh )
-    : _highlighter(0), _camera(camera), _distortionMesh(distortionMesh), _highlightColor( osg::Vec4(1.0f, 1.0f, 0.0f, 1.0f) ) {}
-
-    void computeSelectedVertex( osgUtil::LineSegmentIntersector::Intersection& result );
-    bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );
-
-	osg::Geode* createVertexHighlighter();
-
-protected:
-	osg::ref_ptr<osg::Geometry> _highlighter;
-    osg::observer_ptr<osg::Camera> _camera;
-	osg::Geometry* _distortionMesh;
-	const osg::Vec4 _highlightColor;
-};
