[264] | 1 | #pragma once |
---|
[262] | 2 | #include <osg/Referenced> |
---|
| 3 | #include <osgTerrain/GeometryTechnique> |
---|
[264] | 4 | #include <osgTerrain/TerrainTile> |
---|
[262] | 5 | |
---|
| 6 | |
---|
| 7 | /** |
---|
[269] | 8 | * \brief This class defines the extends of a region. This region is a square and is defined by the latitude and longitude range |
---|
| 9 | * |
---|
| 10 | * @author Torben Dannhauer |
---|
| 11 | * @date Mrz 2011 |
---|
| 12 | */ |
---|
| 13 | class region : public osg::Referenced |
---|
| 14 | { |
---|
| 15 | public: |
---|
| 16 | region(); |
---|
| 17 | ~region(){}; |
---|
| 18 | region( double lat_min, double lat_max, double lon_min, double lon_max); |
---|
| 19 | bool isInside(region& outsider); |
---|
| 20 | bool isFullOrPartiallyInside(region& outsider); |
---|
| 21 | double delta_lat(){return(_lat_max-_lat_max);} |
---|
| 22 | double delta_lon(){return(_lon_max-_lon_max);} |
---|
| 23 | double _lat_min; |
---|
| 24 | double _lat_max; |
---|
| 25 | double _lon_min; |
---|
| 26 | double _lon_max; |
---|
| 27 | } ; |
---|
| 28 | |
---|
| 29 | /** |
---|
[262] | 30 | * \brief This class is the interface definition class for modifying terrain data. Must be subclassed to implement own terrain modification techniques. |
---|
| 31 | * |
---|
| 32 | * @author Torben Dannhauer |
---|
| 33 | * @date Feb 2011 |
---|
| 34 | */ |
---|
| 35 | class terrainModificationTechnique : public osg::Referenced |
---|
| 36 | { |
---|
| 37 | public: |
---|
| 38 | terrainModificationTechnique(); |
---|
| 39 | virtual ~terrainModificationTechnique(); |
---|
| 40 | |
---|
| 41 | /** |
---|
| 42 | * \brief This function performs the terrain data modification. Must be subclassed. |
---|
| 43 | * |
---|
[266] | 44 | * @param modificationROI This vector contains the extents of the region of interest which should be modified: lat_min, lat_max, long_min, long_max |
---|
[262] | 45 | * @param h : Heightfield of the tile which should be modified |
---|
[265] | 46 | * @param tileExtends : This vector contains the extents of the tile: lat_min, lat_max, long_min, long_max |
---|
[262] | 47 | */ |
---|
[269] | 48 | virtual void modifyHeightfield(region& modificationROI, osg::HeightField* h, region tileExtends)=0; |
---|
[262] | 49 | |
---|
[265] | 50 | protected: |
---|
| 51 | void clampValue(double& value, double min, double max){if(value<min)value=min;if(value>max)value=max;} |
---|
| 52 | void clampValue(int& value, int min, int max){if(value<min)value=min;if(value>max)value=max;} |
---|
[262] | 53 | }; |
---|