MyScript Interactive Ink SDK  4.1.2
PointD.h
1 // Copyright @ MyScript. All rights reserved.
2 
3 #pragma once
4 
5 #include <iink/Engine.h>
6 
7 #include <cmath>
8 #include <iosfwd>
9 
10 namespace myscript {
11 namespace iink {
12 namespace graphics {
13 
19 struct PointD
20 {
21  double x = 0.0;
22  double y = 0.0;
27  PointD() = default;
28 
35  PointD(double x, double y) noexcept : x(x), y(y) {}
36 
42  bool isFinite() const noexcept
43  {
44  return std::isfinite(y) && std::isfinite(x);
45  }
46 
54  bool operator==(const PointD& other) const noexcept
55  {
56  return x == other.x && y == other.y;
57  }
58 
66  bool operator!=(const PointD& other) const noexcept
67  {
68  return x != other.x || y != other.y;
69  }
70 
79  IINK_API friend std::ostream& operator<<(std::ostream& os, const PointD& p);
80 };
81 
82 }
83 }
84 }
Definition: Configuration.h:10
Definition: PointD.h:20
double y
Definition: PointD.h:22
bool operator!=(const PointD &other) const noexcept
Definition: PointD.h:66
double x
Definition: PointD.h:21
friend std::ostream & operator<<(std::ostream &os, const PointD &p)
bool isFinite() const noexcept
Definition: PointD.h:42
PointD(double x, double y) noexcept
Definition: PointD.h:35
bool operator==(const PointD &other) const noexcept
Definition: PointD.h:54