1 #ifndef OSMSCOUT_PIXEL_H 2 #define OSMSCOUT_PIXEL_H 34 #include <type_traits> 53 inline Pixel() =
default;
63 return x==other.x && y==other.y;
68 return y!=other.y || x!=other.x;
73 return std::tie(y, x) < std::tie(other.y, other.x);
86 std::string GetDisplayText()
const;
90 stream << GetDisplayText();
103 std::array<double,2> coords;
109 Vertex2D() =
default;
118 Vertex2D(
const Vertex2D& other) =
default;
119 Vertex2D(Vertex2D&& other) =
default;
121 Vertex2D& operator=(
const Vertex2D& other) =
default;
122 Vertex2D& operator=(Vertex2D&& other) =
default;
153 return coords[0]==other.coords[0] &&
154 coords[1]==other.coords[1];
159 return std::tie(coords[1], coords[0]) < std::tie(other.coords[1], other.coords[0]);
163 double xDiff = coords[0] - other.coords[0];
164 double yDiff = coords[1] - other.coords[1];
165 return sqrt(xDiff*xDiff + yDiff*yDiff);
170 static_assert(std::is_trivially_copyable<Vertex2D>::value);
171 static_assert(std::is_trivially_assignable<Vertex2D,Vertex2D>::value);
189 Vertex3D() =
default;
191 Vertex3D(
const Vertex3D& other) =
default;
257 return std::tie(x, y, z) < std::tie(other.x, other.y, other.z);
void Set(double x, double y)
Definition: Pixel.h:134
Vertex3D(double x, double y)
Definition: Pixel.h:193
void Set(double x, double y, double z)
Definition: Pixel.h:239
Pixel(uint32_t x, uint32_t y)
Definition: Pixel.h:55
bool operator==(const Vertex2D &other) const
Definition: Pixel.h:151
std::ostream & operator<<(std::ostream &stream) const
Definition: Pixel.h:88
uint32_t x
Definition: Pixel.h:47
void SetX(double x)
Definition: Pixel.h:124
Vertex2D(double x, double y)
Definition: Pixel.h:111
bool operator<(const Vertex2D &other) const
Definition: Pixel.h:157
OSMSCOUT_API uint64_t InterleaveNumbers(uint32_t a, uint32_t b)
double GetX() const
Definition: Pixel.h:141
#define CLASS_FINAL
Definition: Compiler.h:26
#define OSMSCOUT_API
Definition: CoreImportExport.h:45
void SetY(double y)
Definition: Pixel.h:129
uint64_t GetId() const
Definition: Pixel.h:81
double DistanceTo(const Vertex2D &other) const
Definition: Pixel.h:162
bool operator==(const Pixel &other) const
Definition: Pixel.h:61
uint32_t y
Definition: Pixel.h:48
bool operator<(const Pixel &other) const
Definition: Pixel.h:71
bool operator==(const Vertex3D &other) const
Definition: Pixel.h:248
bool operator<(const Vertex3D &other) const
Definition: Pixel.h:255
double GetY() const
Definition: Pixel.h:146
bool operator!=(const Pixel &other) const
Definition: Pixel.h:66
void SetZ(double z)
Definition: Pixel.h:226
double GetZ() const
Definition: Pixel.h:211