ad_map_access
ENUOperation.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2018-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: MIT
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
17 
18 namespace ad {
19 namespace map {
20 namespace point {
21 
27 inline bool isValid(ENUPoint const &point, bool const logErrors = true)
28 {
29  return withinValidInputRange(point, logErrors);
30 }
31 
37 inline bool isValid(ENUEdge const &edge, bool const logErrors = true)
38 {
39  return withinValidInputRange(edge, logErrors);
40 }
41 
49 inline ENUPoint createENUPoint(double const x, double const y, double const z)
50 {
51  ENUPoint result;
52  result.x = ENUCoordinate(x);
53  result.y = ENUCoordinate(y);
54  result.z = ENUCoordinate(z);
55  return result;
56 }
57 
66 {
67  ENUPoint result;
68  result.x = x;
69  result.y = y;
70  result.z = z;
71  return result;
72 }
73 
78 {
79  ENUPoint result;
80  result.x = ENUCoordinate(1.);
81  result.y = ENUCoordinate(0.);
82  result.z = ENUCoordinate(0.);
83  return result;
84 }
85 
90 {
91  ENUPoint result;
92  result.x = ENUCoordinate(0.);
93  result.y = ENUCoordinate(1.);
94  result.z = ENUCoordinate(0.);
95  return result;
96 }
97 
102 {
103  ENUPoint result;
104  result.x = ENUCoordinate(0.);
105  result.y = ENUCoordinate(0.);
106  result.z = ENUCoordinate(1.);
107  return result;
108 }
109 
114 inline physics::Distance distance(ENUPoint const &point, ENUPoint const &other)
115 {
116  return vectorLength(vectorSub(point, other));
117 }
118 
123 physics::Distance calcLength(ENUEdge const &edge);
124 
125 } // namespace point
126 } // namespace map
127 } // namespace ad
128 
137 inline double operator*(::ad::map::point::ENUPoint const &a, ::ad::map::point::ENUPoint const &b)
138 {
140 }
141 
147 inline ::ad::map::point::ENUPoint operator*(::ad::map::point::ENUPoint const &a, ::ad::physics::Distance const &b)
148 {
150 }
151 
157 inline ::ad::map::point::ENUPoint operator*(::ad::physics::Distance const &b, ::ad::map::point::ENUPoint const &a)
158 {
160 }
161 
167 inline ::ad::map::point::ENUPoint operator*(::ad::map::point::ENUPoint const &a, double const &b)
168 {
170 }
171 
177 inline ::ad::map::point::ENUPoint operator*(double const &b, ::ad::map::point::ENUPoint const &a)
178 {
180 }
181 
190 inline ::ad::map::point::ENUPoint operator+(::ad::map::point::ENUPoint const &a, ::ad::map::point::ENUPoint const &b)
191 {
193 }
194 
203 inline ::ad::map::point::ENUPoint operator-(::ad::map::point::ENUPoint const &a, ::ad::map::point::ENUPoint const &b)
204 {
206 }
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ENUEdgeValidInputRange.hpp
PointOperation.hpp
ad::map::point::createENUPoint
ENUPoint createENUPoint(double const x, double const y, double const z)
create a ENUPoint
Definition: ENUOperation.hpp:49
operator*
double operator*(::ad::map::point::ENUPoint const &a, ::ad::map::point::ENUPoint const &b)
calculate the dot product of two ENUPoint vectors
Definition: ENUOperation.hpp:137
ENUPointValidInputRange.hpp
ad::map::point::vectorDotProduct
double vectorDotProduct(PointType const &a, PointType const &b)
calculate the dot product of two vectors
Definition: PointOperation.hpp:54
withinValidInputRange
bool withinValidInputRange(::ad::map::access::MapMetaData const &input, bool const logErrors=true)
check if the given MapMetaData is within valid input range
Definition: MapMetaDataValidInputRange.hpp:37
ad::map::point::vectorAdd
PointType vectorAdd(PointType const &a, PointType const &b)
add two vectors
Definition: PointOperation.hpp:126
ad::map::point::ENUPoint::y
::ad::map::point::ENUCoordinate y
Definition: ENUPoint.hpp:133
operator-
inline ::ad::map::point::ENUPoint operator-(::ad::map::point::ENUPoint const &a, ::ad::map::point::ENUPoint const &b)
subtract two ENUPoint vectors from each right
Definition: ENUOperation.hpp:203
ad::map::point::vectorSub
PointType vectorSub(PointType const &a, PointType const &b)
subtract two vectors from each right
Definition: PointOperation.hpp:143
ad::map::point::ENUPoint
DataType ENUPoint.
Definition: ENUPoint.hpp:51
ad::map::point::getEnuEastAxis
ENUPoint getEnuEastAxis()
get ENUPoint defining the East-Axis
Definition: ENUOperation.hpp:77
ad::map::point::distance
physics::Distance distance(BoundingSphere const &left, BoundingSphere const &right)
Computes distance between BoundingSpheres.
Definition: BoundingSphereOperation.hpp:29
ad::map::point::ENUPoint::z
::ad::map::point::ENUCoordinate z
Definition: ENUPoint.hpp:138
operator+
inline ::ad::map::point::ENUPoint operator+(::ad::map::point::ENUPoint const &a, ::ad::map::point::ENUPoint const &b)
add two ENUPoint vectors
Definition: ENUOperation.hpp:190
ad::map::point::isValid
bool isValid(ECEFPoint const &point, bool const logErrors=true)
checks if the given ECEFPoint is valid
Definition: ECEFOperation.hpp:27
ad::map::point::getEnuUpAxis
ENUPoint getEnuUpAxis()
get ENUPoint defining the Up-Axis
Definition: ENUOperation.hpp:101
ad::map::point::vectorMultiplyScalar
PointType vectorMultiplyScalar(PointType const &a, double const &b)
multiplies a vector with a scalar
Definition: PointOperation.hpp:65
ad::map::point::ENUPoint::x
::ad::map::point::ENUCoordinate x
Definition: ENUPoint.hpp:128
ad::map::point::calcLength
physics::Distance calcLength(ECEFEdge const &edge)
calculate the length of the provided border as distance value
ad::map::point::vectorLength
physics::Distance vectorLength(PointType const &a)
calculate the length of a vector
Definition: PointOperation.hpp:91
ad::map::point::getEnuNorthAxis
ENUPoint getEnuNorthAxis()
get ENUPoint defining the North-Axis
Definition: ENUOperation.hpp:89
ad::map::point::ENUEdge
std::vector<::ad::map::point::ENUPoint > ENUEdge
DataType ENUEdge.
Definition: ENUEdge.hpp:42
ad::map::point::ENUCoordinate
DataType ENUCoordinate.
Definition: ENUCoordinate.hpp:65