forked from i-RIC/iriclib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiricsolverlib_rect2d.h
47 lines (34 loc) · 896 Bytes
/
iricsolverlib_rect2d.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef IRICSOLVERLIB_RECT2D_H
#define IRICSOLVERLIB_RECT2D_H
#include "iricsolverlib_api.h"
namespace iRICSolverLib {
class Point2D;
class IRICSOLVERLIB_API Rect2D
{
public:
Rect2D();
Rect2D(double xmin, double xmax, double ymin, double ymax);
Rect2D(const Rect2D& rect);
Rect2D& operator=(const Rect2D& rect);
double xMin() const;
double xMax() const;
double yMin() const;
double yMax() const;
double xWidth() const;
double yWidth() const;
bool contains(double x, double y) const;
bool contains(const Point2D& point) const;
bool intersects(const Rect2D& rect) const;
void setXMin(double xmin);
void setXMax(double xmax);
void setYMin(double ymin);
void setYMax(double ymax);
private:
double m_xMin;
double m_xMax;
double m_yMin;
double m_yMax;
};
Rect2D operator +(const Rect2D& rect1, const Rect2D& rect2);
} // iRICSolverLib
#endif // IRICSOLVERLIB_RECT2D_H