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

Detailed Description

The interface to an input data object, for use by the TSLTerrainVSAlgorithm class.

An application may inherit from this object, in order to use application-specfic input data.

This object is reference counted. If the application is finished with it, the dec() method should be called.

Public Member Functions

virtual TSLMUExtent queryExtent () const
 
virtual bool getData (unsigned int x, unsigned int y, double &value, const TSLTerrainVSAlgorithm::Parameters &params)=0
 
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 ()
 
virtual bool valid (const TSLTerrainVSAlgorithm::Parameters &params) const =0
 
virtual void processFinished ()=0
 

Protected Member Functions

 TSLTerrainVSInput (unsigned int width, unsigned int height, TSLMUExtent extent, TSLCoordinateSystem *coordinateSystem)
 
 TSLTerrainVSInput ()
 
 TSLTerrainVSInput (const TSLTerrainVSInput &other)
 
virtual ~TSLTerrainVSInput ()
 

Protected Attributes

unsigned int m_width
 
unsigned int m_height
 
TSLCoordinateSystemm_coordinateSystem
 
double m_postDistanceX
 
double m_postDistanceY
 
TSLMUExtent m_extent
 

Constructor & Destructor Documentation

◆ TSLTerrainVSInput() [1/3]

TSLTerrainVSInput::TSLTerrainVSInput ( unsigned int width,
unsigned int height,
TSLMUExtent extent,
TSLCoordinateSystem * coordinateSystem )
protected

Constructor.

Initialises the base parameters of the input object.

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.

◆ TSLTerrainVSInput() [2/3]

TSLTerrainVSInput::TSLTerrainVSInput ( )
protected

◆ TSLTerrainVSInput() [3/3]

TSLTerrainVSInput::TSLTerrainVSInput ( const TSLTerrainVSInput & other)
protected

◆ ~TSLTerrainVSInput()

virtual TSLTerrainVSInput::~TSLTerrainVSInput ( )
protectedvirtual

Member Function Documentation

◆ coordinateSystem()

virtual const TSLCoordinateSystem * TSLTerrainVSInput::coordinateSystem ( )
virtual

Query the coordinate system of the input data.

This object must provide a coordinate system in order for viewshed operations, and any height adjustment calculations to be valid.

Reimplemented in TSLTerrainVSInputEarthCurvature, and TSLTerrainVSInputTerrainDatabase.

◆ dec()

void TSLTerrainVSInput::dec ( )

Decrement this object's reference count.

◆ getData()

virtual bool TSLTerrainVSInput::getData ( unsigned int x,
unsigned int y,
double & value,
const TSLTerrainVSAlgorithm::Parameters & params )
pure 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.

This method should set the value parameter to the requested height value, and return true. If there is no height data available for the requested location this method should return false.

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

Implemented in TSLTerrainVSInputArray, TSLTerrainVSInputEarthCurvature, and TSLTerrainVSInputTerrainDatabase.

◆ height()

virtual unsigned int TSLTerrainVSInput::height ( ) const
virtual

Query the height of the input data

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ inc()

void TSLTerrainVSInput::inc ( )

Increment this object's reference count.

◆ LatLongToOffset()

virtual bool TSLTerrainVSInput::LatLongToOffset ( double lat,
double lon,
unsigned int & x,
unsigned int & y )
virtual

Query the X/Y offset which corresponds to the provided Latitude/Longitude.

The base-class implementation of this method will call LatLongToMU on the input object's coordinate system.

Parameters
latThe latitude of the point to convert
lonThe logitude of the point to convert
xStorage for the returned x offset
yStorage for the returned y offset
Returns
true if the point was converted, or false if an error occurred. false will be returned if the calculated offset is outside the input objects extent.

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ MUToOffset()

virtual bool TSLTerrainVSInput::MUToOffset ( double muX,
double muY,
unsigned int & x,
unsigned int & y )
virtual

Query the X/Y offset which corresponds to the provided map unit location

Parameters
muXThe MU X coordinate of the point to convert
muYThe MU Y coordinate of the point to convert
xStorage for the returned x offset
yStorage for the returned y offset
Returns
true if the point was converted, or false if an error occurred. false will be returned if the calculated offset is outside the input objects extent.

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ offsetToLatLong()

virtual bool TSLTerrainVSInput::offsetToLatLong ( unsigned int x,
unsigned int y,
double & lat,
double & lon )
virtual

Query the geographic location of the provided X/Y offset, in Latitude/Longitude.

The base-class implementation of this method will call MUToLatLong on the input object's coordinate system.

Parameters
xThe X coordinate of the point to convert
yThe Y coordinate of the point to convert
latStorage for the returned latitude
lonStorage for the returned longitude
Returns
true if the point was converted, or false if an error occurred.

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ offsetToMU()

virtual bool TSLTerrainVSInput::offsetToMU ( unsigned int x,
unsigned int y,
double & muX,
double & muY )
virtual

Query the geographic location of the provided X/Y offset, in map units.

Parameters
xThe X coordinate of the point to convert
yThe Y coordinate of the point to convert
muXStorage for the returned MU X value
muYStorage for the returned MU Y value

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ postDistanceX()

virtual double TSLTerrainVSInput::postDistanceX ( )
virtual

Query the horizontal post-distance of the input data.

This is the distance between sample points, in map units

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ postDistanceY()

virtual double TSLTerrainVSInput::postDistanceY ( )
virtual

Query the vertical post-distance of the input data.

This is the distance between sample points, in map units

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ processFinished()

virtual void TSLTerrainVSInput::processFinished ( )
pure 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.

This method is provided as an opportunity for the input object to release any per-thread or per-calculation resources, and to reset any internal state required for another viewshed calculation.

Implemented in TSLTerrainVSInputArray, TSLTerrainVSInputEarthCurvature, and TSLTerrainVSInputTerrainDatabase.

◆ queryExtent()

virtual TSLMUExtent TSLTerrainVSInput::queryExtent ( ) const
virtual

Query the extent of the input data.

The units of this extent are defined by this object's coordinate system.

Returns the input object's extent.

Reimplemented in TSLTerrainVSInputEarthCurvature.

◆ valid()

virtual bool TSLTerrainVSInput::valid ( const TSLTerrainVSAlgorithm::Parameters & params) const
pure 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.

Parameters
paramsThe parameters of the viewshed operation.
Returns
If this method true, the viewshed calculation will proceed. If false the viewshed calculation will terminate, and an error will be logged on the error stack.

Implemented in TSLTerrainVSInputArray, TSLTerrainVSInputEarthCurvature, and TSLTerrainVSInputTerrainDatabase.

◆ width()

virtual unsigned int TSLTerrainVSInput::width ( ) const
virtual

Query the width of the input data

Reimplemented in TSLTerrainVSInputEarthCurvature.

Member Data Documentation

◆ m_coordinateSystem

TSLCoordinateSystem* TSLTerrainVSInput::m_coordinateSystem
protected

◆ m_extent

TSLMUExtent TSLTerrainVSInput::m_extent
protected

The Map-Unit extent of the input object.

The units of this extent are defined by the source data coordinate system.

◆ m_height

unsigned int TSLTerrainVSInput::m_height
protected

The number of vertical elements in the input data.

◆ m_postDistanceX

double TSLTerrainVSInput::m_postDistanceX
protected

The horizontal distance between posts, in the units of the terrain data.

◆ m_postDistanceY

double TSLTerrainVSInput::m_postDistanceY
protected

The horizontal distance between posts, in the units of the terrain data.

◆ m_width

unsigned int TSLTerrainVSInput::m_width
protected

Data Members for Class Attributes The number of horizontal elements in the input data.