psen_scan_internal_angle.h
Go to the documentation of this file.
1 // Copyright (c) 2020 Pilz GmbH & Co. KG
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program. If not, see <https://www.gnu.org/licenses/>.
15 
16 #ifndef PSEN_SCAN_INTERNAL_ANGLE
17 #define PSEN_SCAN_INTERNAL_ANGLE
18 
19 #include <ostream>
20 
21 namespace psen_scan
22 {
23 class PSENscanInternalAngle;
24 
29 class Degree
30 {
31 private:
32  double angle_;
33 
34 public:
35  Degree(const Degree& angle);
36  explicit Degree(const double& angle);
37  explicit Degree(const PSENscanInternalAngle& angle);
38  explicit operator double() const noexcept;
39  bool operator<(const Degree& rhs) const;
40  bool operator>(const Degree& rhs) const;
41  bool operator==(const Degree& rhs) const;
42  Degree& operator*=(const double& rhs);
43  Degree operator*(const double& rhs);
44  Degree& operator-=(const Degree& rhs);
45  Degree operator-(const Degree& rhs);
46  Degree operator-();
47  Degree& operator=(const Degree& rhs) = default;
48  friend std::ostream& operator<<(std::ostream& os, const Degree& deg);
49 };
50 
56 {
57 private:
58  int angle_;
59 
60 public:
61  PSENscanInternalAngle(const PSENscanInternalAngle& angle);
62  explicit PSENscanInternalAngle(const int& angle);
63  explicit PSENscanInternalAngle(const Degree& angle);
64  explicit operator int() const noexcept;
65  bool operator<(const PSENscanInternalAngle& rhs) const;
66  bool operator>(const PSENscanInternalAngle& rhs) const;
67  bool operator<=(const PSENscanInternalAngle& rhs) const;
68  bool operator>=(const PSENscanInternalAngle& rhs) const;
69  bool operator==(const PSENscanInternalAngle& rhs) const;
70  bool operator!=(const PSENscanInternalAngle& rhs) const;
71  PSENscanInternalAngle operator-=(const PSENscanInternalAngle& rhs);
72  PSENscanInternalAngle operator-(const PSENscanInternalAngle& rhs) const;
73  PSENscanInternalAngle operator-();
74  PSENscanInternalAngle operator+=(const PSENscanInternalAngle& rhs);
75  PSENscanInternalAngle operator+(const PSENscanInternalAngle& rhs) const;
76  PSENscanInternalAngle& operator=(const PSENscanInternalAngle& rhs) = default;
77  friend std::ostream& operator<<(std::ostream& os, const PSENscanInternalAngle& deg);
78 };
79 } // namespace psen_scan
80 
81 #endif // PSEN_SCAN_INTERNAL_ANGLE
Class to model angles in degrees from user&#39;s perspective.
Degree(const Degree &angle)
Construct a new Degree:: Degree object from another Degree object.
Class to model angles in PSENscan internal format (tenth of degrees)


psen_scan
Author(s):
autogenerated on Mon Feb 28 2022 23:16:20