source: experimental/TerrainTest/terrainModificationTechnique.h @ 272

Last change on this file since 272 was 272, checked in by Torben Dannhauer, 13 years ago
File size: 2.0 KB
Line 
1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer
3 *
4 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
10 * You have to aquire licenses for all used proprietary modules.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * OpenSceneGraph Public License for more details.
16*/
17
18#include <osg/Referenced>
19#include <osgTerrain/GeometryTechnique>
20#include <osgTerrain/TerrainTile>
21#include "region.h"
22
23
24/**
25 * \brief This class is the interface definition class for modifying terrain data. Must be subclassed to implement own terrain modification techniques.
26 *
27 * @author Torben Dannhauer
28 * @date  Feb 2011
29 */ 
30class terrainModificationTechnique : public osg::Referenced
31{
32public:
33        terrainModificationTechnique();
34        virtual ~terrainModificationTechnique();
35
36        /**
37         * \brief This function performs the terrain data modification. Must be subclassed.
38         *
39         * @param modificationROI This vector contains the extents of the region of interest which should be modified: lat_min, lat_max, long_min, long_max
40         * @param h : Heightfield of the tile which should be modified
41         * @param tileExtends : This vector contains the extents of the tile: lat_min, lat_max, long_min, long_max
42         */ 
43        virtual void modifyHeightfield(region& modificationROI, osg::HeightField* h, region tileExtends)=0;
44
45protected:
46        void clampValue(double& value, double min, double max){if(value<min)value=min;if(value>max)value=max;}
47        void clampValue(int& value, int min, int max){if(value<min)value=min;if(value>max)value=max;}
48};
Note: See TracBrowser for help on using the repository browser.