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
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 AbstractLoS:
Collaboration diagram for 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]

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()

Distance to current node.

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

◆ currentElevation()

Elevation to current node.

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

◆ 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

◆ gradient()

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

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

Parameters
i
Returns
double

◆ 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

◆ numberOfNodes()

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

Number of LoSNodes in this line-of-sight.

Returns
int

◆ resultCol()

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

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

Returns
int

◆ resultRow()

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

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

Returns
int

◆ 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

◆ targetCol()

Column number for the target of LoS.

Returns
int

◆ targetDistance()

Distance of target.

Returns
double

◆ targetElevation()

Elevation of target.

Returns
double

◆ targetGradient()

Gradient of target.

Returns
double

◆ targetIndex()

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

◆ targetRow()

Row number for the target of LoS.

Returns
int

◆ viewPointElevation()

Surface elevation of viewpoint;.

Returns
double

◆ 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: