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
LoS Class Reference

Class that represents LoS for classic Viewshed calculation. More...

#include <los.h>

Inheritance diagram for LoS:
Collaboration diagram for LoS:

Public Member Functions

 LoS (std::vector< LoSNode > losNodes)
void setLoSNodes (std::vector< LoSNode > losNodes)
void setTargetPoint (std::shared_ptr< LoSNode > poi, double targetOffset=0)
void prepareForCalculation () override
 Prepare line-of-sight for calculation. For example inverse LoS needs some preprocessing before being able to be analysed.
bool isValid () override
int targetPointIndex () override
 Index of target point in the line-of-sight.
int numberOfNodes () override
 Number of LoSNodes in this line-of-sight.
int resultRow () override
 Row number where the outcome of LoS analysis should be stored.
int resultCol () override
 Column number where the outcome of LoS analysis should be stored.
LoSNode nodeAt (std::size_t i) override
 LoSNode at specific index.
void removePointsAfterTarget ()
Public Member Functions inherited from viewshed::AbstractLoS
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.
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.
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

void sort () override
 Sort LoSNodes by distance from View point.
void findTargetPointIndex () override
 Retrieve index of target point in this LoS.
Protected Member Functions inherited from viewshed::AbstractLoS
double curvatureCorrectionsFix (const double distance)
 Elevation changes using currently set curvature corrections for specific distance.

Additional Inherited Members

Protected Attributes inherited from viewshed::AbstractLoS
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

Class that represents LoS for classic Viewshed calculation.

Member Function Documentation

◆ findTargetPointIndex()

void LoS::findTargetPointIndex ( )
overrideprotectedvirtual

Retrieve index of target point in this LoS.

Implements viewshed::AbstractLoS.

◆ isValid()

bool LoS::isValid ( )
overridevirtual

Implements viewshed::AbstractLoS.

◆ nodeAt()

LoSNode LoS::nodeAt ( std::size_t i)
overridevirtual

LoSNode at specific index.

Parameters
i
Returns
LoSNode

Implements viewshed::AbstractLoS.

◆ numberOfNodes()

int LoS::numberOfNodes ( )
overridevirtual

Number of LoSNodes in this line-of-sight.

Returns
int

Implements viewshed::AbstractLoS.

◆ prepareForCalculation()

void LoS::prepareForCalculation ( )
overridevirtual

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

Implements viewshed::AbstractLoS.

◆ resultCol()

int LoS::resultCol ( )
overridevirtual

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

Returns
int

Implements viewshed::AbstractLoS.

◆ resultRow()

int LoS::resultRow ( )
overridevirtual

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

Returns
int

Implements viewshed::AbstractLoS.

◆ sort()

void LoS::sort ( )
overrideprotectedvirtual

Sort LoSNodes by distance from View point.

Implements viewshed::AbstractLoS.

◆ targetPointIndex()

int LoS::targetPointIndex ( )
overridevirtual

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

Returns
int

Implements viewshed::AbstractLoS.


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