Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* LineOfSightCalculation (L400)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by N. Thoden, NLE, 06.04.2020
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ElevationMap/situationmapelevationmap_export.h>
|
||||
#include <Common/situation_map_logging.h>
|
||||
|
||||
#include <LtsUtilsCore/qpoint3d.h>
|
||||
using Point3D = LtsUtils::QPoint3D; ///< x = lon ; y = lat , z = elevation/altitude in meters
|
||||
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
|
||||
// forward
|
||||
class ElevationMap;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
/*!
|
||||
\brief Define visibility.
|
||||
*/
|
||||
enum class LineOfSightVisibility
|
||||
{
|
||||
Undefined, /*!< no data at that location? */
|
||||
Visible,
|
||||
Obstructed
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class SITUATIONMAPELEVATIONMAP_EXPORT ObserverTargetData
|
||||
{
|
||||
public:
|
||||
explicit ObserverTargetData(const Point3D &oberserver = Point3D(), // z-value: incl. observerHeight
|
||||
const Point3D &target = Point3D()) // z-value: incl. targetHeight
|
||||
: m_oberserver(oberserver)
|
||||
, m_target(target)
|
||||
{}
|
||||
|
||||
const Point3D &observer() const { return m_oberserver; }
|
||||
const Point3D &target() const { return m_target; }
|
||||
|
||||
const Point3D &obstacle() const { return m_obstacle; }
|
||||
void setObstacle(const Point3D &obstacle) { m_obstacle = obstacle; }
|
||||
|
||||
LineOfSightVisibility lineOfSightVisibility() const { return m_visible; }
|
||||
void setLineOfSightVisibility(const LineOfSightVisibility &visible) { m_visible = visible; }
|
||||
|
||||
bool isObserverAndTargetValid() const { return (!m_oberserver.isNull()) && (!m_target.isNull()); }
|
||||
|
||||
private:
|
||||
Point3D m_oberserver;
|
||||
Point3D m_target;
|
||||
|
||||
Point3D m_obstacle;
|
||||
LineOfSightVisibility m_visible = LineOfSightVisibility::Undefined;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class SITUATIONMAPELEVATIONMAP_EXPORT LineOfSightCalculation
|
||||
{
|
||||
public:
|
||||
explicit LineOfSightCalculation(ElevationMap *elevationMap);
|
||||
~LineOfSightCalculation();
|
||||
|
||||
bool calculate(ObserverTargetData &observerTarget, unsigned int sampleIntervallMeter = 5);
|
||||
|
||||
protected:
|
||||
static Point3D movePoint(const Point3D &oberserver,
|
||||
const Point3D &target,
|
||||
double distanceFromObserverToTargetAsFraction);
|
||||
|
||||
static double distanceMeter(const Point3D &oberserver,
|
||||
const Point3D &target);
|
||||
|
||||
|
||||
private:
|
||||
LOGGER_T m_logger; ///< Interface of the Logging-Facility
|
||||
ElevationMap *m_elevationMap = nullptr;
|
||||
|
||||
ObserverTargetData m_observerTarget;
|
||||
};
|
||||
|
||||
} // namespace SituationMap
|
||||
|
||||
Reference in new issue
Block a user