Viewshed 6.1.0
A C++ library for calculation of viewshed, inverse viewshed and visibility indices for both of those analyses.
Loading...
Searching...
No Matches
viewshed::AbstractLoS Class Referenceabstract

Abstract class that represent line-of-sight (LoS). Consists of LoSNodes, view point and target point (both with potential offset from the surface). More...

#include <abstractlos.h>

Inheritance diagram for viewshed::AbstractLoS:
Collaboration diagram for viewshed::AbstractLoS:

Public Member Functions

void setViewPoint (std::shared_ptr< Point > vp)
 Set the View Point object directly from Point with offset specified as part of this object.
void setViewPoint (std::shared_ptr< LoSNode > poi, double observerOffset=0)
 Set the View Point object from LoSNode point, specifying offset of the observer.
void setTargetPoint (std::shared_ptr< Point > tp)
 Set the Target Point object directly from Point with offset specified as part of this object.
void setTargetPoint (std::shared_ptr< LoSNode > poi, double targetOffset=0)
 Set the Target Point object from LoSNode point, specifying offset of the target.
void setAngle (double angle)
 Set the horizontal angle for extracting elevations, distances and gradients from line-of-sight.
virtual void prepareForCalculation ()=0
 Prepare line-of-sight for calculation. For example inverse LoS needs some preprocessing before being able to be analysed.
double gradient (std::size_t i)
 Extract gradient value for line-of-sight LoSNode at position i.
double distance (std::size_t i)
 Extract distance for line-of-sight LoSNode at position i.
double elevation (std::size_t i)
 Extract elevation for line-of-sight LoSNode at position i.
virtual bool isValid ()=0
virtual int numberOfNodes ()=0
 Number of LoSNodes in this line-of-sight.
virtual int targetPointIndex ()=0
 Index of target point in the line-of-sight.
virtual int resultRow ()=0
 Row number where the outcome of LoS analysis should be stored.
virtual int resultCol ()=0
 Column number where the outcome of LoS analysis should be stored.
virtual LoSNode nodeAt (std::size_t i)=0
 LoSNode at specific index.
double horizontalAngle ()
 Horizontal angle for this line-of-sight.
int targetRow ()
 Row number for the target of LoS.
int targetCol ()
 Column number for the target of LoS.
double targetDistance ()
 Distance of target.
double targetGradient ()
 Gradient of target.
double targetElevation ()
 Elevation of target.
std::shared_ptr< Pointvp ()
 View point for this line-of-sight.
void applyCurvatureCorrections (bool apply, double refractionCoeff, double earthDiameter)
 Specify curvature corrections settings.
void applyCurvatureCorrections (bool apply)
 Set curvature corrections on/off.
void setRefractionCoeficient (double refractionCoeff)
 Set the Refraction Coeficient for curvature corrections.
void setEarthDiameter (double earthDiameter)
 Set the Earth Diameter for curvature corrections.
int targetIndex ()
 Get index of target point in the current LoS.
double viewPointElevation ()
 Surface elevation of viewpoint;.
double viewPointTotalElevation ()
 Surface elevation of viewpoint with offset.
virtual void setCurrentLoSNode (std::size_t i)
 Set the Current LoS Node object.
double currentDistance ()
 Distance to current node.
double currentGradient ()
 Gradient to current node.
double currentElevation ()
 Elevation to current node.

Protected Member Functions

virtual void findTargetPointIndex ()=0
 Retrieve index of target point in this LoS.
virtual void sort ()=0
 Sort LoSNodes by distance from View point.
double curvatureCorrectionsFix (const double distance)
 Elevation changes using currently set curvature corrections for specific distance.

Protected Attributes

double mAngleHorizontal = 0
 Horizontal angle between view point and target point.
double mPointDistance = 0
 Distance between observer and target point.
std::shared_ptr< PointmVp = std::make_shared<Point>()
 View point.
std::shared_ptr< PointmTp = std::make_shared<Point>()
 Target point.
int mTargetIndex = -1
 Index of target point.
bool mCurvatureCorrections = false
 Use curvature corrections for this LoS.
double mEarthDiameter = EARTH_DIAMETER
 Earth diameter for curvature corrections.
double mRefractionCoefficient = REFRACTION_COEFFICIENT
 Refraction coefficient for curvature corrections.
LoSNode mCurrentLoSNode
 Currently solved LoS Node.

Detailed Description

Abstract class that represent line-of-sight (LoS). Consists of LoSNodes, view point and target point (both with potential offset from the surface).

Member Function Documentation

◆ applyCurvatureCorrections() [1/2]

void viewshed::AbstractLoS::applyCurvatureCorrections ( bool apply)
inline

Set curvature corrections on/off.

Parameters
apply

◆ applyCurvatureCorrections() [2/2]

void viewshed::AbstractLoS::applyCurvatureCorrections ( bool apply,
double refractionCoeff,
double earthDiameter )
inline

Specify curvature corrections settings.

Parameters
apply
refractionCoeff
earthDiameter

◆ currentDistance()

double AbstractLoS::currentDistance ( )

Distance to current node.

See also
setCurrentLoSNode( std::size_t i )
Returns
double

◆ currentElevation()

double AbstractLoS::currentElevation ( )

Elevation to current node.

See also
setCurrentLoSNode( std::size_t i )
Returns
double

◆ currentGradient()

double AbstractLoS::currentGradient ( )

Gradient to current node.

See also
setCurrentLoSNode( std::size_t i )
Returns
double

◆ curvatureCorrectionsFix()

double AbstractLoS::curvatureCorrectionsFix ( const double distance)
protected

Elevation changes using currently set curvature corrections for specific distance.

Parameters
distance
Returns
double

◆ distance()

double AbstractLoS::distance ( std::size_t i)

Extract distance for line-of-sight LoSNode at position i.

Parameters
i
Returns
double

◆ elevation()

double AbstractLoS::elevation ( std::size_t i)

Extract elevation for line-of-sight LoSNode at position i.

Parameters
i
Returns
double

◆ findTargetPointIndex()

virtual void viewshed::AbstractLoS::findTargetPointIndex ( )
protectedpure virtual

Retrieve index of target point in this LoS.

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ gradient()

double AbstractLoS::gradient ( std::size_t i)

Extract gradient value for line-of-sight LoSNode at position i.

Parameters
i
Returns
double

◆ horizontalAngle()

double AbstractLoS::horizontalAngle ( )

Horizontal angle for this line-of-sight.

Returns
double

◆ nodeAt()

virtual LoSNode viewshed::AbstractLoS::nodeAt ( std::size_t i)
pure virtual

LoSNode at specific index.

Parameters
i
Returns
LoSNode

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ numberOfNodes()

virtual int viewshed::AbstractLoS::numberOfNodes ( )
pure virtual

Number of LoSNodes in this line-of-sight.

Returns
int

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ prepareForCalculation()

virtual void viewshed::AbstractLoS::prepareForCalculation ( )
pure virtual

Prepare line-of-sight for calculation. For example inverse LoS needs some preprocessing before being able to be analysed.

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ resultCol()

virtual int viewshed::AbstractLoS::resultCol ( )
pure virtual

Column number where the outcome of LoS analysis should be stored.

Returns
int

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ resultRow()

virtual int viewshed::AbstractLoS::resultRow ( )
pure virtual

Row number where the outcome of LoS analysis should be stored.

Returns
int

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ setAngle()

void AbstractLoS::setAngle ( double angle)

Set the horizontal angle for extracting elevations, distances and gradients from line-of-sight.

Parameters
angle

◆ setCurrentLoSNode()

void AbstractLoS::setCurrentLoSNode ( std::size_t i)
virtual

Set the Current LoS Node object.

Parameters
i

◆ setEarthDiameter()

void viewshed::AbstractLoS::setEarthDiameter ( double earthDiameter)
inline

Set the Earth Diameter for curvature corrections.

Parameters
earthDiameter

◆ setRefractionCoeficient()

void viewshed::AbstractLoS::setRefractionCoeficient ( double refractionCoeff)
inline

Set the Refraction Coeficient for curvature corrections.

Parameters
refractionCoeff

◆ setTargetPoint() [1/2]

void AbstractLoS::setTargetPoint ( std::shared_ptr< LoSNode > poi,
double targetOffset = 0 )

Set the Target Point object from LoSNode point, specifying offset of the target.

Parameters
poi
observerOffset

◆ setTargetPoint() [2/2]

void AbstractLoS::setTargetPoint ( std::shared_ptr< Point > tp)

Set the Target Point object directly from Point with offset specified as part of this object.

Parameters
vp

◆ setViewPoint() [1/2]

void AbstractLoS::setViewPoint ( std::shared_ptr< LoSNode > poi,
double observerOffset = 0 )

Set the View Point object from LoSNode point, specifying offset of the observer.

Parameters
poi
observerOffset

◆ setViewPoint() [2/2]

void AbstractLoS::setViewPoint ( std::shared_ptr< Point > vp)

Set the View Point object directly from Point with offset specified as part of this object.

Parameters
vp

◆ sort()

virtual void viewshed::AbstractLoS::sort ( )
protectedpure virtual

Sort LoSNodes by distance from View point.

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ targetCol()

int AbstractLoS::targetCol ( )

Column number for the target of LoS.

Returns
int

◆ targetDistance()

double AbstractLoS::targetDistance ( )

Distance of target.

Returns
double

◆ targetElevation()

double AbstractLoS::targetElevation ( )

Elevation of target.

Returns
double

◆ targetGradient()

double AbstractLoS::targetGradient ( )

Gradient of target.

Returns
double

◆ targetIndex()

int viewshed::AbstractLoS::targetIndex ( )
inline

Get index of target point in the current LoS.

Returns
int

◆ targetPointIndex()

virtual int viewshed::AbstractLoS::targetPointIndex ( )
pure virtual

Index of target point in the line-of-sight.

Returns
int

Implemented in InverseLoS, LoS, viewshed::InverseLoS, and viewshed::LoS.

◆ targetRow()

int AbstractLoS::targetRow ( )

Row number for the target of LoS.

Returns
int

◆ viewPointElevation()

double AbstractLoS::viewPointElevation ( )

Surface elevation of viewpoint;.

Returns
double

◆ viewPointTotalElevation()

double AbstractLoS::viewPointTotalElevation ( )

Surface elevation of viewpoint with offset.

Returns
double

◆ vp()

std::shared_ptr< Point > AbstractLoS::vp ( )

View point for this line-of-sight.

Returns
std::shared_ptr<Point>

The documentation for this class was generated from the following files: