1
<html><head><TITLE>Rectangle</TITLE></head>
3
<H2><A HREF ="#DOC.DOCU" > <IMG BORDER=0 SRC=down.gif></A> class Rectangle </H2><BLOCKQUOTE>
4
rectangle ADT, defined by x, y, width and height.
10
<DT><h3>Public Fields</h3><DD><TR><TD VALIGN=top><A HREF="#DOC.270.1"> <IMG BORDER=0 SRC=icon1.gif></A> static const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> </TD><TD><B>ZERO</B> <br>
12
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.16"> <IMG BORDER=0 SRC=icon1.gif></A> int </TD><TD><B>x</B> <br>
13
<I> the left x-coordinate of the rectangle</I>
14
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.17"> <IMG BORDER=0 SRC=icon1.gif></A> int </TD><TD><B>y</B> <br>
15
<I> the top y coordinate of the rectangle</I>
16
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.18"> <IMG BORDER=0 SRC=icon1.gif></A> int </TD><TD><B>width</B> <br>
17
<I> the width of the rectangle</I>
18
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.19"> <IMG BORDER=0 SRC=icon1.gif></A> int </TD><TD><B>height</B> <br>
19
<I> the height of the rectangle</I>
20
</TD></TR></TABLE><TABLE>
21
<DT><h3>Public Methods</h3><DD><TR><TD VALIGN=top><A HREF="#DOC.270.2"> <IMG BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Rectangle</B> (int a = 0, int b = 0, int w = 0, int h=0)<br>
22
<I> Construct and initialize new rectangle.</I>
23
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.3"> <IMG BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Rectangle</B> (int w, int h)<br>
24
<I> Construct and initialize new rectangle.</I>
25
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.4"> <IMG BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Rectangle</B> (int d)<br>
26
<I> Construct and initialize new rectangle.</I>
27
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.5"> <IMG BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Rectangle</B> (<!1><A HREF="Point.html">Point</A> origin, <!1><A HREF="Point.html">Point</A> extent)<br>
28
<I> Construct and initialize new rectangle.</I>
29
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.6"> <IMG BORDER=0 SRC=icon1.gif></A> void </TD><TD><B>Set</B> (int a, int b, int w, int h)<br>
30
<I> Reshape rectangle.</I>
31
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.7"> <IMG BORDER=0 SRC=icon1.gif></A> void </TD><TD><B>SetPosition</B> (int a, int b)<br>
32
<I> Set rectangle position.</I>
33
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.8"> <IMG BORDER=0 SRC=icon1.gif></A> void </TD><TD><B>Move</B> (int a, int b)<br>
34
<I> Move rectangle position.</I>
35
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.9"> <IMG BORDER=0 SRC=icon1.gif></A> bool </TD><TD><B>Inside</B> (<!1><A HREF="Point.html">Point</A> p) const <br>
36
<I> Return if point (a,b) is inside rectangle.</I>
37
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.10"> <IMG BORDER=0 SRC=icon1.gif></A> bool </TD><TD><B>Inside</B> (int a, int b) const <br>
38
<I> Return if point (a,b) is inside rectangle.</I>
39
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.11"> <IMG BORDER=0 SRC=icon1.gif></A> bool </TD><TD><B>Intersects</B> (<!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A>* r) const <br>
40
<I> Return if rectangle r intersects with 'this'.</I>
41
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.12"> <IMG BORDER=0 SRC=icon1.gif></A> friend bool </TD><TD><B>operator==</B> (const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.16">x</A>, const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.17">y</A>)<br>
42
<I> Return whether rectangles are equal.</I>
43
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.13"> <IMG BORDER=0 SRC=icon1.gif></A> friend bool </TD><TD><B>operator!=</B> (const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.16">x</A>, const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.17">y</A>)<br>
44
<I> Return whether rectangles are unequal.</I>
45
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.14"> <IMG BORDER=0 SRC=icon1.gif></A> friend ostream& </TD><TD><B>operator<<</B> (ostream &s, const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> r)<br>
46
<I> Write string representation to ostream.</I>
47
</TD></TR><TR><TD VALIGN=top><A HREF="#DOC.270.15"> <IMG BORDER=0 SRC=icon1.gif></A> friend istream& </TD><TD><B>operator>></B> (istream &s, <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &r)<br>
48
<I> Read string representation from istream.</I>
49
</TD></TR></TABLE></DL>
52
<h2> Documentation </h2>
54
rectangle ADT, defined by x, y, width and height.
61
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> static const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> ZERO</B></TT>
65
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> Rectangle(int a = 0, int b = 0, int w = 0, int h=0)</B></TT>
66
<DD> Construct and initialize new rectangle.
70
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> Rectangle(int w, int h)</B></TT>
71
<DD> Construct and initialize new rectangle.
75
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> Rectangle(int d)</B></TT>
76
<DD> Construct and initialize new rectangle.
80
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> Rectangle(<!1><A HREF="Point.html">Point</A> origin, <!1><A HREF="Point.html">Point</A> extent)</B></TT>
81
<DD> Construct and initialize new rectangle.
85
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> void Set(int a, int b, int w, int h)</B></TT>
86
<DD> Reshape rectangle.
88
<A NAME="SetPosition">
90
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> void SetPosition(int a, int b)</B></TT>
91
<DD> Set rectangle position.
95
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> void Move(int a, int b)</B></TT>
96
<DD> Move rectangle position.
100
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> bool Inside(<!1><A HREF="Point.html">Point</A> p) const </B></TT>
101
<DD> Return if point (a,b) is inside rectangle.
104
<A NAME ="DOC.270.10">
105
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> bool Inside(int a, int b) const </B></TT>
106
<DD> Return if point (a,b) is inside rectangle.
108
<A NAME="Intersects">
109
<A NAME ="DOC.270.11">
110
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> bool Intersects(<!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A>* r) const </B></TT>
111
<DD> Return if rectangle r intersects with 'this'.
113
<A NAME="operator==">
114
<A NAME ="DOC.270.12">
115
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> friend bool operator==(const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.16">x</A>, const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.17">y</A>)</B></TT>
116
<DD> Return whether rectangles are equal.
118
<A NAME="operator!=">
119
<A NAME ="DOC.270.13">
120
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> friend bool operator!=(const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.16">x</A>, const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &<!2><A HREF="Rectangle.html#DOC.270.17">y</A>)</B></TT>
121
<DD> Return whether rectangles are unequal.
123
<A NAME="operator<<">
124
<A NAME ="DOC.270.14">
125
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> friend ostream& operator<<(ostream &s, const <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> r)</B></TT>
126
<DD> Write string representation to ostream.
128
<A NAME="operator>>">
129
<A NAME ="DOC.270.15">
130
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> friend istream& operator>>(istream &s, <!2><A HREF="Rectangle.html#DOC.270.2">Rectangle</A> &r)</B></TT>
131
<DD> Read string representation from istream.
134
<A NAME ="DOC.270.16">
135
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> int x</B></TT>
136
<DD> the left x-coordinate of the rectangle
139
<A NAME ="DOC.270.17">
140
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> int y</B></TT>
141
<DD> the top y coordinate of the rectangle
144
<A NAME ="DOC.270.18">
145
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> int width</B></TT>
146
<DD> the width of the rectangle
149
<A NAME ="DOC.270.19">
150
<DT><IMG BORDER=0 SRC=icon2.gif><TT><B> int height</B></TT>
151
<DD> the height of the rectangle
154
<DL><DT><B>This class has no child classes.</B></DL>
155
<DL></DL><P><I><A HREF="aindex.html"> alphabetic index</A></I> <I><A HREF="HIER.html"> hierarchy of classes</A></I><P><hr>
156
<A HREF="http://www.zib.de/Visual/software/doc++/index.html"><IMG BORDER=0 ALIGN=RIGHT SRC=logo.gif></A>
157
<P Align=Center><I>this page has been generated automatically by doc++</I>
158
<P Align=Center><I>(c)opyright by <A HREF="http://www.zib.de/zoeckler/"> Malte Zöckler</A>, <A HREF="mailto:wunderling@zib.de"> Roland Wunderling </A><br>contact: <A HREF="mailto:doc++@zib.de"> doc++@zib.de</a></I>