source: experimental/TerrainTest/terrainModificationTechnique.h @ 265

Last change on this file since 265 was 265, checked in by Torben Dannhauer, 14 years ago

Prototype of rampedEllipsoidFunction works.

File size: 1.2 KB
Line 
1#pragma once
2#include <osg/Referenced>
3#include <osgTerrain/GeometryTechnique>
4#include <osg/Vec4d>
5#include <osgTerrain/TerrainTile>
6
7
8/**
9 * \brief This class is the interface definition class for modifying terrain data. Must be subclassed to implement own terrain modification techniques.
10 *
11 * @author Torben Dannhauer
12 * @date  Feb 2011
13 */ 
14class terrainModificationTechnique : public osg::Referenced
15{
16public:
17        terrainModificationTechnique();
18        virtual ~terrainModificationTechnique();
19
20        /**
21         * \brief This function performs the terrain data modification. Must be subclassed.
22         *
23         * @param modificationROI This vector contains the extents of the region of interest which should be modified: lat min, lat_max, long_min, long_max
24         * @param h : Heightfield of the tile which should be modified
25         * @param tileExtends : This vector contains the extents of the tile: lat_min, lat_max, long_min, long_max
26         */ 
27        virtual void modifyHeightfield(osg::Vec4d& modificationROI, osg::HeightField* h, osg::Vec4d tileExtends)=0;
28
29protected:
30        void clampValue(double& value, double min, double max){if(value<min)value=min;if(value>max)value=max;}
31        void clampValue(int& value, int min, int max){if(value<min)value=min;if(value>max)value=max;}
32};
Note: See TracBrowser for help on using the repository browser.