ad_map_access
BoundingSphere.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 Intel Corporation
5  *
6  * SPDX-License-Identifier: MIT
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <iostream>
21 #include <limits>
22 #include <memory>
23 #include <sstream>
25 #include "ad/physics/Distance.hpp"
29 namespace ad {
33 namespace map {
39 namespace point {
40 
47 {
51  typedef std::shared_ptr<BoundingSphere> Ptr;
52 
56  typedef std::shared_ptr<BoundingSphere const> ConstPtr;
57 
61  BoundingSphere() = default;
62 
66  ~BoundingSphere() = default;
67 
71  BoundingSphere(const BoundingSphere &other) = default;
72 
76  BoundingSphere(BoundingSphere &&other) = default;
77 
85  BoundingSphere &operator=(const BoundingSphere &other) = default;
86 
94  BoundingSphere &operator=(BoundingSphere &&other) = default;
95 
103  bool operator==(const BoundingSphere &other) const
104  {
105  return (center == other.center) && (radius == other.radius);
106  }
107 
115  bool operator!=(const BoundingSphere &other) const
116  {
117  return !operator==(other);
118  }
119 
124 
128  ::ad::physics::Distance radius;
129 };
130 
131 } // namespace point
132 } // namespace map
133 } // namespace ad
134 
138 #ifndef GEN_GUARD_AD_MAP_POINT_BOUNDINGSPHERE
139 #define GEN_GUARD_AD_MAP_POINT_BOUNDINGSPHERE
140 
143 namespace ad {
147 namespace map {
153 namespace point {
154 
164 inline std::ostream &operator<<(std::ostream &os, BoundingSphere const &_value)
165 {
166  os << "BoundingSphere(";
167  os << "center:";
168  os << _value.center;
169  os << ",";
170  os << "radius:";
171  os << _value.radius;
172  os << ")";
173  return os;
174 }
175 
176 } // namespace point
177 } // namespace map
178 } // namespace ad
179 
180 namespace std {
184 inline std::string to_string(::ad::map::point::BoundingSphere const &value)
185 {
186  stringstream sstream;
187  sstream << value;
188  return sstream.str();
189 }
190 } // namespace std
191 #endif // GEN_GUARD_AD_MAP_POINT_BOUNDINGSPHERE
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::point::operator<<
std::ostream & operator<<(std::ostream &os, Altitude const &_value)
standard ostream operator
Definition: Altitude.hpp:562
ad::map::point::BoundingSphere::operator=
BoundingSphere & operator=(const BoundingSphere &other)=default
standard assignment operator
ECEFPoint.hpp
ad::map::point::BoundingSphere::center
::ad::map::point::ECEFPoint center
Definition: BoundingSphere.hpp:123
ad::map::point::BoundingSphere::operator==
bool operator==(const BoundingSphere &other) const
standard comparison operator
Definition: BoundingSphere.hpp:103
std::to_string
std::string to_string(::ad::map::access::GeometryStoreItem const &value)
overload of the std::to_string for GeometryStoreItem
Definition: GeometryStoreItem.hpp:183
ad::map::point::BoundingSphere::~BoundingSphere
~BoundingSphere()=default
standard destructor
ad::map::point::BoundingSphere::BoundingSphere
BoundingSphere()=default
standard constructor
ad::map::point::BoundingSphere
DataType BoundingSphere.
Definition: BoundingSphere.hpp:46
ad::map::point::BoundingSphere::radius
::ad::physics::Distance radius
Definition: BoundingSphere.hpp:128
ad::map::point::ECEFPoint
DataType ECEFPoint.
Definition: ECEFPoint.hpp:45
ad::map::point::BoundingSphere::Ptr
std::shared_ptr< BoundingSphere > Ptr
Smart pointer on BoundingSphere.
Definition: BoundingSphere.hpp:51
ad::map::point::BoundingSphere::operator!=
bool operator!=(const BoundingSphere &other) const
standard comparison operator
Definition: BoundingSphere.hpp:115
ad::map::point::BoundingSphere::ConstPtr
std::shared_ptr< BoundingSphere const > ConstPtr
Smart pointer on constant BoundingSphere.
Definition: BoundingSphere.hpp:56