Back to index

texmacs  1.0.7.15
rectangles.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : rectangles.hpp
00004 * DESCRIPTION: Rectangles and lists of rectangles with reference counting.
00005 *              Used in graphical programs.
00006 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00007 *******************************************************************************
00008 * This software falls under the GNU general public license version 3 or later.
00009 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00010 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00011 ******************************************************************************/
00012 
00013 #ifndef RECTANGLES_H
00014 #define RECTANGLES_H
00015 #include "list.hpp"
00016 
00017 class rectangle_rep: concrete_struct {
00018 public:
00019   SI x1, y1;
00020   SI x2, y2;
00021 
00022   rectangle_rep (SI x1b, SI y1b, SI x2b, SI y2b);
00023   friend class rectangle;
00024 };
00025 
00026 class rectangle {
00027   CONCRETE(rectangle);
00028   rectangle (SI x1b=0, SI y1b=0, SI x2b=0, SI y2b=0);
00029   operator tree ();
00030 };
00031 CONCRETE_CODE(rectangle);
00032 
00033 tm_ostream& operator << (tm_ostream& out, rectangle r);
00034 rectangle copy (rectangle r);
00035 bool operator == (rectangle r1, rectangle r2);
00036 bool operator != (rectangle r1, rectangle r2);
00037 bool intersect (rectangle r1, rectangle r2);
00038 bool operator <= (rectangle r1, rectangle r2);
00039 rectangle translate (rectangle r, SI x, SI y);
00040 rectangle operator * (rectangle r, int d);
00041 rectangle operator / (rectangle r, int d);
00042 double area (rectangle r);
00043 
00044 typedef list<rectangle> rectangles;
00045 
00046 rectangles operator - (rectangles l1, rectangles l2);
00047 rectangles operator & (rectangles l1, rectangles l2);
00048 rectangles operator | (rectangles l1, rectangles l2);
00049 rectangles operator * (rectangles l, int d);
00050 rectangles operator / (rectangles l, int d);
00051 rectangles translate (rectangles l, SI x, SI y);
00052 rectangles thicken (rectangles l, SI width, SI height);
00053 rectangles outline (rectangles l, SI pixel);
00054 rectangles correct (rectangles l);
00055 rectangles simplify (rectangles l);
00056 rectangle  least_upper_bound (rectangles l);
00057 double area (rectangles r);
00058 
00059 #endif // defined RECTANGLES_H