MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTerrainVSInputArray Class Reference
Inheritance diagram for TSLTerrainVSInputArray:

Detailed Description

An input data object, which stores terrain data in a 2-dimensional array.

Public Member Functions

 TSLTerrainVSInputArray (unsigned int width, unsigned int height, TSLMUExtent extent, TSLCoordinateSystem *coordinateSystem, double nullValue=-(std::numeric_limits< double >::max)(), double *data=NULL)
 
virtual bool getData (unsigned int x, unsigned int y, double &value, const TSLTerrainVSAlgorithm::Parameters &params)
 
bool setData (unsigned int x, unsigned int y, double value)
 
virtual bool valid (const TSLTerrainVSAlgorithm::Parameters &params) const
 
virtual void processFinished ()
 
- Public Member Functions inherited from TSLTerrainVSInput
virtual TSLMUExtent queryExtent () const
 
virtual unsigned int width () const
 
virtual unsigned int height () const
 
void inc ()
 
void dec ()
 
virtual const TSLCoordinateSystemcoordinateSystem ()
 
virtual bool offsetToLatLong (unsigned int x, unsigned int y, double &lat, double &lon)
 
virtual bool offsetToMU (unsigned int x, unsigned int y, double &muX, double &muY)
 
virtual bool MUToOffset (double muX, double muY, unsigned int &x, unsigned int &y)
 
virtual bool LatLongToOffset (double lat, double lon, unsigned int &x, unsigned int &y)
 
virtual double postDistanceX ()
 
virtual double postDistanceY ()
 

Additional Inherited Members

- Protected Member Functions inherited from TSLTerrainVSInput
 TSLTerrainVSInput (unsigned int width, unsigned int height, TSLMUExtent extent, TSLCoordinateSystem *coordinateSystem)
 
 TSLTerrainVSInput ()
 
 TSLTerrainVSInput (const TSLTerrainVSInput &other)
 
virtual ~TSLTerrainVSInput ()
 
- Protected Attributes inherited from TSLTerrainVSInput
unsigned int m_width
 
unsigned int m_height
 
TSLCoordinateSystemm_coordinateSystem
 
double m_postDistanceX
 
double m_postDistanceY
 
TSLMUExtent m_extent
 

Constructor & Destructor Documentation

◆ TSLTerrainVSInputArray()

TSLTerrainVSInputArray::TSLTerrainVSInputArray ( unsigned int width,
unsigned int height,
TSLMUExtent extent,
TSLCoordinateSystem * coordinateSystem,
double nullValue = -(std::numeric_limits< double >::max)(),
double * data = NULL )

Initialise the basic input object parameters, and setup the data array.

The nullValue will be used by the getData method, in order to identify areas of no data. The input data aray will be initialised to this value.

This object will use the provided data pointer if provided, and will not perform any initialisation on the array. The application is responsible for deleting this array, and ensuring that it is of a sufficient size.

Parameters
widthThe number of horizontal elements in the input data array.
heightThe number of vertical elements in the input data array.
extentThe data extent, in map units.
coordinateSystemThe coordinate system of the data.
nullValueThe value which represents a lack of data.
dataA pointer to an existing double array.

Member Function Documentation

◆ getData()

virtual bool TSLTerrainVSInputArray::getData ( unsigned int x,
unsigned int y,
double & value,
const TSLTerrainVSAlgorithm::Parameters & params )
virtual

Query a height value from the input data.

If the valid() method has returned false, this method will never be called by the viewshed algorithm.

The location given to this method is specified as an offset, from the bottom-left of the data.

If the provided location is valid, the height value will be populated, and this method will return true. If the height value is equal to the 'nullValue', or the input location is invalid, then this method will return false.

Parameters
xThe x offset to query
yThe y offset to query
valueStorage for the height value
paramsThe viewshed operation parameters

Implements TSLTerrainVSInput.

◆ processFinished()

virtual void TSLTerrainVSInputArray::processFinished ( )
virtual

This method will be called by the viewshed algorithm when the viewshed calculation has finished. If the viewshed algorithm is multithreaded, this method will be called for each of the calculation threads.

For this class no cleanup or reinitialisation is required.

Implements TSLTerrainVSInput.

◆ setData()

bool TSLTerrainVSInputArray::setData ( unsigned int x,
unsigned int y,
double value )

Set a height value in the array.

The location given to this method is specified as an offset, from the bottom-left of the data.

The array is iniitialised to the constructor's 'nullValue' parameter, meaning that only valid data needs to be set into the array.

Parameters
xThe x offset in the array
yThe y offset in the array
valueThe value to set.

This method will return true if the data was set, or false if the location was invalid.

◆ valid()

virtual bool TSLTerrainVSInputArray::valid ( const TSLTerrainVSAlgorithm::Parameters & params) const
virtual

This method will be called by the viewshed algorithm, to provide the input object with a mechanism for initialisation, and an opportunity to terminate the viewshed calculation if required.

The extent provided by params.m_viewShedMUExtent should not be considered valid during this call, as it will not have been fully calculated.

The TSLTerrianVSInputArray object is considered valid if it has a non-zero extent, width and height.

Parameters
paramsThe parameters of the viewshed operation.
Returns
true if the input array object is valid, or false otherwise.

Implements TSLTerrainVSInput.