2
/******************************************************************************
3
* MODULE : rectangles.hpp
4
* DESCRIPTION: Rectangles and lists of rectangles with reference counting.
5
* Used in graphical programs.
6
* COPYRIGHT : (C) 1999 Joris van der Hoeven
7
*******************************************************************************
8
* This software falls under the GNU general public license and comes WITHOUT
9
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
10
* If you don't have this file, write to the Free Software Foundation, Inc.,
11
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
12
******************************************************************************/
18
class rectangle_rep: concrete_struct {
23
rectangle_rep (SI x1b, SI y1b, SI x2b, SI y2b);
24
friend class rectangle;
29
rectangle (SI x1b=0, SI y1b=0, SI x2b=0, SI y2b=0);
32
CONCRETE_CODE(rectangle);
34
ostream& operator << (ostream& out, rectangle r);
35
rectangle copy (rectangle r);
36
bool operator == (rectangle r1, rectangle r2);
37
bool operator != (rectangle r1, rectangle r2);
38
bool intersect (rectangle r1, rectangle r2);
39
bool operator <= (rectangle r1, rectangle r2);
40
rectangle translate (rectangle r, SI x, SI y);
41
rectangle operator * (rectangle r, int d);
42
rectangle operator / (rectangle r, int d);
43
double area (rectangle r);
45
typedef list<rectangle> rectangles;
47
rectangles operator - (rectangles l1, rectangles l2);
48
rectangles operator & (rectangles l1, rectangles l2);
49
rectangles operator | (rectangles l1, rectangles l2);
50
rectangles operator * (rectangles l, int d);
51
rectangles operator / (rectangles l, int d);
52
rectangles translate (rectangles l, SI x, SI y);
53
rectangles thicken (rectangles l, SI width, SI height);
54
rectangles outline (rectangles l, SI pixel);
55
rectangles correct (rectangles l);
56
rectangles simplify (rectangles l);
57
rectangle least_upper_bound (rectangles l);
58
double area (rectangles r);
60
#endif // defined RECTANGLES_H