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
inverseviewshed.h
1#pragma once
2#include "viewshed_export.h"
3
4#include <functional>
5#include <iostream>
6#include <limits>
7
8#include "abstractviewshed.h"
9#include "enums.h"
10#include "inverselos.h"
11#include "losevaluator.h"
12#include "point.h"
13#include "viewshedtypes.h"
14#include "visibility.h"
15
16using viewshed::ViewshedAlgorithms;
17
18namespace viewshed
19{
20 class DLL_API InverseViewshed : public AbstractViewshed
21 {
22 public:
23 InverseViewshed( std::shared_ptr<Point> targetPoint, double observerOffset,
24 std::shared_ptr<ProjectedSquareCellRaster> dem,
25 std::shared_ptr<ViewshedAlgorithms> visibilityIndices, bool applyCurvatureCorrections = true,
26 double earthDiameter = EARTH_DIAMETER, double refractionCoeff = REFRACTION_COEFFICIENT,
27 double minimalAngle = std::numeric_limits<double>::quiet_NaN(),
28 double maximalAngle = std::numeric_limits<double>::quiet_NaN() );
29
30 void calculate(
31 std::function<void( std::string, double )> stepsTimingCallback = []( std::string text, double time )
32 { std::cout << text << time << std::endl; },
33 std::function<void( int, int )> progressCallback = []( int, int ) {} ) override;
34
35 std::shared_ptr<InverseLoS> getLoS( OGRPoint point, bool onlyToPoint = false );
36
37 void submitToThreadpool( const CellEvent &e ) override;
38
39 void addEventsFromCell( int &row, int &column, const double &pixelValue, bool &solveCell ) override;
40
41 void calculateVisibilityRaster() override;
42
43 private:
44 double mObserverOffset;
45 };
46
47} // namespace viewshed
Abstract class that represents viewshed calculation from this class specific implementations ( Viewsh...
Definition abstractviewshed.h:43
Class representing cell events for Van Kreveld's plane sweep algorithm. Stores cell position (row and...
Definition cellevent.h:17
void calculate(std::function< void(std::string, double)> stepsTimingCallback=[](std::string text, double time) { std::cout<< text<< time<< std::endl;}, std::function< void(int, int)> progressCallback=[](int, int) {}) override
Calculate the viewshed. Covers all the steps - create list of events, sort list of events,...
Definition inverseviewshed.cpp:65
void calculateVisibilityRaster() override
Calculate visibility mask of areas which are visible from point (visibility), or from which the point...
Definition inverseviewshed.cpp:212
void addEventsFromCell(int &row, int &column, const double &pixelValue, bool &solveCell) override
Function that creates events for event list from given cell.
Definition inverseviewshed.cpp:111
OGRPoint point(int row, int col)
Create OGRPoint with coordinates of given row and column in the raster.
Definition abstractviewshed.cpp:290