#pragma once #include #include #include /** * \brief This class defines the extends of a region. This region is a square and is defined by the latitude and longitude range * * @author Torben Dannhauer * @date Mrz 2011 */ class region : public osg::Referenced { public: //! Constructor: Plain constructor, you have to set the extend manually. region() : _lat_min(0.0), _lat_max(0.0), _lon_min(0.0), _lon_max(0.0) {}; //! Destructor: Empty ~region(){}; //! Constructor: Constructed with the specified extend region( double lat_min, double lat_max, double lon_min, double lon_max) : _lat_min(lat_min), _lat_max(lat_max), _lon_min(lon_min), _lon_max(lon_max) {}; region( osg::HeightField& h ); bool isInside(region& outsider); bool isFullOrPartiallyInside(region& outsider); double delta_lat(){return(_lat_max-_lat_min);} double delta_lon(){return(_lon_max-_lon_min);} double _lat_min; double _lat_max; double _lon_min; double _lon_max; } ; /** * \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;} };