#pragma once /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer * * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. * You have to aquire licenses for all used proprietary modules. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include #include #include #include "region.h" #include /** * \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 region 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(region& modificationROI, osg::HeightField* h, region tileExtends)=0; protected: void clampValue(double& value, double min, double max){if(valuemax)value=max;} void clampValue(int& value, int min, int max){if(valuemax)value=max;} double round(double x) {return (x > 0.5) ? ceil(x) : floor(x);} };