42 lines
653 B
C++
42 lines
653 B
C++
//
|
|
// Created by maximilian on 16.04.22.
|
|
//
|
|
|
|
#ifndef PROG_GEOMETRY_H
|
|
#define PROG_GEOMETRY_H
|
|
|
|
#include <cstdint>
|
|
|
|
using Coordinate = int;
|
|
using Unit = uint64_t;
|
|
using Index = size_t;
|
|
|
|
struct Point {
|
|
Coordinate x;
|
|
Coordinate y;
|
|
};
|
|
|
|
struct Interval {
|
|
Coordinate left;
|
|
Coordinate right;
|
|
};
|
|
|
|
struct Rectangle {
|
|
Point bottom_left;
|
|
Point top_right;
|
|
|
|
// only for algorithm
|
|
Index i_left;
|
|
Index i_right;
|
|
};
|
|
|
|
struct RectCoord {
|
|
Coordinate coord;
|
|
Rectangle* rect; // guaranteed to be valid at all times
|
|
bool operator<(const RectCoord &other) {
|
|
return coord < other.coord;
|
|
}
|
|
};
|
|
|
|
|
|
#endif //PROG_GEOMETRY_H
|