1 #ifndef GLOBAL_H 2 #define GLOBAL_H 3 4 #include <string> 5 #include <stdexcept> 6 #include <array> 7 8 namespace Vipster { 9 constexpr double pi = 3.14159265358979323846264338327950288; 10 constexpr double rad2deg = 180. / pi; 11 constexpr double deg2rad = pi / 180.; 12 constexpr double bohrrad = 0.52917721092; 13 constexpr double invbohr = 1./bohrrad; 14 15 using ColVec = std::array<uint8_t, 4>; 16 using SizeVec = std::array<size_t, 3>; 17 using DiffVec = std::array<int, 3>; 18 19 constexpr static std::array<Vipster::ColVec, 5> defaultColors{ 20 Vipster::ColVec{80, 0, 0, 200}, 21 Vipster::ColVec{0, 80, 0, 200}, 22 Vipster::ColVec{80, 80, 0, 200}, 23 Vipster::ColVec{80, 0, 80, 200}, 24 Vipster::ColVec{0, 80, 80, 200} 25 }; 26 27 class Error:public std::logic_error{ 28 public: Error(std::string reason)29 Error(std::string reason):std::logic_error(reason){} 30 }; 31 } 32 33 #endif // GLOBAL_H 34