20 #ifndef OPENXCOM_GRAPHSUBSET_H
21 #define OPENXCOM_GRAPHSUBSET_H
39 beg_x(0), end_x(max_x),
40 beg_y(0), end_y(max_y)
46 GraphSubset(std::pair<int, int> range_x, std::pair<int, int> range_y):
47 beg_x(range_x.first), end_x(range_x.second),
48 beg_y(range_y.first), end_y(range_y.second)
54 beg_x(r.beg_x), end_x(r.end_x),
55 beg_y(r.beg_y), end_y(r.end_y)
70 inline int size_x()
const
75 inline int size_y()
const
81 static inline void intersection_range(
int& begin_a,
int& end_a,
const int& begin_b,
const int& end_b)
83 if(begin_a >= end_b || begin_b >= end_a)
90 begin_a = std::max(begin_a, begin_b);
91 end_a = std::min(end_a, end_b);
97 intersection_range(ret.beg_x, ret.end_x, b.beg_x, b.end_x);
98 intersection_range(ret.beg_y, ret.end_y, b.beg_y, b.end_y);
104 intersection_range(ret.beg_x, ret.end_x, c.beg_x, c.end_x);
105 intersection_range(ret.beg_y, ret.end_y, c.beg_y, c.end_y);
111 intersection_range(ret.beg_x, ret.end_x, d.beg_x, d.end_x);
112 intersection_range(ret.beg_y, ret.end_y, d.beg_y, d.end_y);
Definition: GraphSubset.h:31