Index: experimental/TerrainTest/ModificationVisitor.cpp
===================================================================
--- experimental/TerrainTest/ModificationVisitor.cpp	(revision 261)
+++ experimental/TerrainTest/ModificationVisitor.cpp	(revision 262)
@@ -6,5 +6,8 @@
 {
 	setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN );
-	technique = new ellipsoidTechnique();
+	_technique = new ellipsoidTechnique();
+
+	// Set ROI to flatten and estimated height after correction
+	_technique->setModifiedHeight(450);
 }
 
@@ -49,8 +52,5 @@
 
 	// ROI to flatten
-	double roi_lat_min = 48.336808;
-	double roi_lat_max = 48.370467;
-	double roi_lon_min = 11.736750;
-	double roi_lon_max = 11.835322;
+	osg::Vec4d modificationROI = osg::Vec4d( 48.336808, 48.370467, 11.736750, 11.835322 );		// roi_lat_min, roi_lat_max, roi_lon_min, roi_lon_max
 
 	// Determine extend of the tile.
@@ -61,8 +61,8 @@
 
 	// Check if tile is fully or partially inside ROI:
-	if(lat_max>roi_lat_min && lat_min<roi_lat_max			// lat inside ROI
-		&& lon_max>roi_lon_min && lon_min<roi_lon_max )	// lon inside ROI
+	if(lat_max>modificationROI[0] && lat_min<modificationROI[1]			// lat inside ROI?
+		&& lon_max>modificationROI[2] && lon_min<modificationROI[3] )	// lon inside ROI?
 	{
-		technique->modifyHeightfield(h, lat_min, lat_max, lon_min, lon_max);
+		_technique->modifyHeightfield( modificationROI, h, osg::Vec4d(lat_min, lat_max, lon_min, lon_max) );
 	}
 }
Index: experimental/TerrainTest/ModificationVisitor.h
===================================================================
--- experimental/TerrainTest/ModificationVisitor.h	(revision 261)
+++ experimental/TerrainTest/ModificationVisitor.h	(revision 262)
@@ -20,5 +20,5 @@
 	void modifyTile(osgTerrain::TerrainTile* tile);
 	std::string _extensionToSet;
+	osg::ref_ptr<ellipsoidTechnique> _technique;
 
-	ellipsoidTechnique* technique;
 };
Index: experimental/TerrainTest/Plugins terrainmod/Plugins terrainmod.vcproj
===================================================================
--- experimental/TerrainTest/Plugins terrainmod/Plugins terrainmod.vcproj	(revision 261)
+++ experimental/TerrainTest/Plugins terrainmod/Plugins terrainmod.vcproj	(revision 262)
@@ -191,4 +191,8 @@
 				>
 			</File>
+			<File
+				RelativePath="..\terrainModificationTechnique.cpp"
+				>
+			</File>
 		</Filter>
 		<Filter
@@ -209,4 +213,8 @@
 				>
 			</File>
+			<File
+				RelativePath="..\terrainModificationTechnique.h"
+				>
+			</File>
 		</Filter>
 		<Filter
Index: experimental/TerrainTest/ellipsoidTechnique.cpp
===================================================================
--- experimental/TerrainTest/ellipsoidTechnique.cpp	(revision 261)
+++ experimental/TerrainTest/ellipsoidTechnique.cpp	(revision 262)
@@ -5,4 +5,5 @@
 ellipsoidTechnique::ellipsoidTechnique()
 {
+	_height = 0.0;
 }
 
@@ -11,42 +12,34 @@
 }
 
-void ellipsoidTechnique::modifyHeightfield(osg::HeightField* h, double lat_min, double lat_max, double lon_min, double lon_max)
+void ellipsoidTechnique::modifyHeightfield(osg::Vec4d& modificationROI, osg::HeightField* h, osg::Vec4d tileExtends)
 {
 	OSG_NOTIFY( osg::ALWAYS ) << "ellipsoidTechnique::modifyHeightfield()" << std::endl;
-	OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << lat_min << " | " << lat_max << std::endl;
-	OSG_NOTIFY( osg::ALWAYS ) << "LON: " << lon_min << " | " << lon_max << std::endl;
-
-	int rows = h->getNumRows();
-	int cols = h->getNumColumns();
+	OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << tileExtends[0] << " | " << tileExtends[1] << std::endl;
+	OSG_NOTIFY( osg::ALWAYS ) << "LON: " << tileExtends[2] << " | " << tileExtends[3] << std::endl;
 
 	// calculate colum start/end and row start/end of affected vertices
-	int startX=0,startY=0,endX=cols,endY=rows;
+	int startX=0, startY=0, endX=h->getNumColumns(), endY=h->getNumRows();
 
-	double roi_lat_min = 48.336808;
-	double roi_lat_max = 48.370467;
-	double roi_lon_min = 11.736750;
-	double roi_lon_max = 11.835322;
+	
+	// Dertermine loop variables..
+	if(tileExtends[0]<modificationROI[0])
+		startY = (modificationROI[0] - tileExtends[0]) / h->getYInterval();
+	if(tileExtends[1]>modificationROI[1])
+		endY = (modificationROI[1] - tileExtends[0]) / h->getYInterval();
 
-	// dertermining loop variables
-	if(lat_min<roi_lat_min)
-		startY = (roi_lat_min - lat_min) / h->getYInterval();
-	if(lat_max>roi_lat_max)
-		endY = (roi_lat_max - lat_min) / h->getYInterval();
-
-	if(lon_min<roi_lon_min)
-		startX = (roi_lon_min - lon_min) / h->getXInterval();
-	if(lon_max>roi_lon_max)
-		endX = (roi_lon_max - lon_min) / h->getXInterval();
+	if(tileExtends[2]<modificationROI[2])
+		startX = (modificationROI[2] - tileExtends[2]) / h->getXInterval();
+	if(tileExtends[3]>modificationROI[3])
+		endX = (modificationROI[3] - tileExtends[2]) / h->getXInterval();
 
 
-	// modify height value of affected vertices
+	// Modify height value of affected vertices
 	for(int x=startX;x<endX;x++)
 	{
 		for(int y=startY;y<endY;y++)
 		{
-			h->setHeight( x, y, 550);
+			h->setHeight( x, y, _height);
 		}
 	}
-
 }
 
Index: experimental/TerrainTest/ellipsoidTechnique.h
===================================================================
--- experimental/TerrainTest/ellipsoidTechnique.h	(revision 261)
+++ experimental/TerrainTest/ellipsoidTechnique.h	(revision 262)
@@ -1,8 +1,8 @@
 #pragma once
 
-#include <osgTerrain/GeometryTechnique>
-#include <osg/Image>
+#include "terrainModificationTechnique.h"
 
-class ellipsoidTechnique
+
+class ellipsoidTechnique : public terrainModificationTechnique
 {
 public:
@@ -10,5 +10,9 @@
 	~ellipsoidTechnique();
 
-	void modifyHeightfield(osg::HeightField* h, double lat_min, double lat_max, double lon_min, double lon_max);
+	void modifyHeightfield(osg::Vec4d& modificationROI, osg::HeightField* h, osg::Vec4d tileExtends);
+	void setModifiedHeight(double height) {_height=height;}
+
+private:
+	double _height;
 };
 
Index: experimental/TerrainTest/terrainModificationTechnique.cpp
===================================================================
--- experimental/TerrainTest/terrainModificationTechnique.cpp	(revision 262)
+++ experimental/TerrainTest/terrainModificationTechnique.cpp	(revision 262)
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "terrainModificationTechnique.h"
+
+
+terrainModificationTechnique::terrainModificationTechnique()
+{
+
+}
+
+terrainModificationTechnique::~terrainModificationTechnique()
+{
+
+}
+
Index: experimental/TerrainTest/terrainModificationTechnique.h
===================================================================
--- experimental/TerrainTest/terrainModificationTechnique.h	(revision 262)
+++ experimental/TerrainTest/terrainModificationTechnique.h	(revision 262)
@@ -0,0 +1,27 @@
+#include <osg/Referenced>
+#include <osgTerrain/GeometryTechnique>
+#include <osg/Vec4d>
+
+
+/**
+ * \brief This class is the interface definition class for modifying terrain data. Must be subclassed to implement own terrain modification techniques.
+ * 
+ * @author Torben Dannhauer
+ * @date  Feb 2011
+ */ 
+class terrainModificationTechnique : public osg::Referenced
+{
+public:
+	terrainModificationTechnique();
+	virtual ~terrainModificationTechnique();
+
+	/**
+	 * \brief This function performs the terrain data modification. Must be subclassed.
+	 * 
+	 * @param modificationROI This vector contains the extents of the regoin of interest which should be modified: lat min, lat_max, long_min, long_max
+	 * @param h : Heightfield of the tile which should be modified
+	 * @param tileExtends : This vector contains the extents of the tile: lat min, lat_max, long_min, long_max
+	 */ 
+	virtual void modifyHeightfield(osg::Vec4d& modificationROI, osg::HeightField* h, osg::Vec4d tileExtends)=0;
+
+};
