| author | marci | 
| Tue, 06 Apr 2004 12:00:34 +0000 | |
| changeset 311 | 6635b11938fe | 
| parent 240 | 4a1d2e642552 | 
| child 921 | 818510fa3d99 | 
| permissions | -rw-r--r-- | 
| athos@244 | 1  | 
#include <xy.h>  | 
| athos@240 | 2  | 
|
| athos@240 | 3  | 
#include <iostream>  | 
| athos@240 | 4  | 
using namespace std;  | 
| athos@240 | 5  | 
using namespace hugo;  | 
| athos@240 | 6  | 
int main()  | 
| athos@240 | 7  | 
{
 | 
| athos@240 | 8  | 
xy<int> z;  | 
| athos@240 | 9  | 
cout << "A teszt a következő: először beolvasunk 2 síkvektort, elkészítjük hozzá a határoló dobozt. Azután további síkvektorokat olvasunk be, amiket egy másik bounding boxhoz adogatunk hozzá. Mindig kiírjuk, hogy a megadott új pont benne volt e, majd hozzáadás után a doboz aktuális állapotát. Ezt a második beolvasást CTRL-D-vel lehet megszakítani: ezután a két dobozt összeadjuk." << endl;  | 
| athos@240 | 10  | 
|
| athos@240 | 11  | 
cout << "Kerek először 2 sikvektort (az első dobozhoz)." << endl;  | 
| athos@240 | 12  | 
BoundingBox<int> doboz1;  | 
| athos@240 | 13  | 
cin >> z;  | 
| athos@240 | 14  | 
doboz1 += z;  | 
| athos@240 | 15  | 
cin >> z;  | 
| athos@240 | 16  | 
doboz1 += z;  | 
| athos@240 | 17  | 
cout << "Az első határoló doboz aktualisan: " << endl;  | 
| athos@240 | 18  | 
cout << "Bal alsó sarok: " << doboz1.bottomLeft() << endl;  | 
| athos@240 | 19  | 
cout << "Jobb felső sarok: " << doboz1.topRight() << endl;  | 
| athos@240 | 20  | 
|
| athos@240 | 21  | 
|
| athos@240 | 22  | 
|
| athos@240 | 23  | 
cout << "Kerek sok sikvektort." << endl;  | 
| athos@240 | 24  | 
|
| athos@240 | 25  | 
BoundingBox<int> doboz;  | 
| athos@240 | 26  | 
|
| athos@240 | 27  | 
vector< xy<int> > v;  | 
| athos@240 | 28  | 
|
| athos@240 | 29  | 
	while(cin >> z) {
 | 
| athos@240 | 30  | 
v.push_back(z);  | 
| athos@240 | 31  | 
		if (doboz.inside(z)){
 | 
| athos@240 | 32  | 
cout << "Ez most belül van." << endl;  | 
| athos@240 | 33  | 
}  | 
| athos@240 | 34  | 
		else{
 | 
| athos@240 | 35  | 
cout << "Ez most kívül van." << endl;  | 
| athos@240 | 36  | 
}  | 
| athos@240 | 37  | 
|
| athos@240 | 38  | 
doboz += z;  | 
| athos@240 | 39  | 
cout << "A második határoló doboz aktualisan: " << endl;  | 
| athos@240 | 40  | 
cout << "Bal alsó sarok: " << doboz.bottomLeft() << endl;  | 
| athos@240 | 41  | 
cout << "Jobb felső sarok: " << doboz.topRight() << endl;  | 
| athos@240 | 42  | 
}  | 
| athos@240 | 43  | 
|
| athos@240 | 44  | 
doboz += doboz1;  | 
| athos@240 | 45  | 
cout << "A két doboz összege: " << endl;  | 
| athos@240 | 46  | 
cout << "Bal alsó sarok: " << doboz.bottomLeft() << endl;  | 
| athos@240 | 47  | 
cout << "Jobb felső sarok: " << doboz.topRight() << endl;  | 
| athos@240 | 48  | 
|
| athos@240 | 49  | 
/*  | 
| athos@240 | 50  | 
cout << "A kovetkezo szamokat szoroztam ossze:" << endl;  | 
| athos@240 | 51  | 
	for(unsigned int i=0; i<v.size(); ++i) {
 | 
| athos@240 | 52  | 
cout << v[i] << ", A normanégyzete: " << v[i].normSquare() <<endl;  | 
| athos@240 | 53  | 
cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl;  | 
| athos@240 | 54  | 
cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl;  | 
| athos@240 | 55  | 
}  | 
| athos@240 | 56  | 
	if (v.size()>1){
 | 
| athos@240 | 57  | 
cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl;  | 
| athos@240 | 58  | 
}  | 
| athos@240 | 59  | 
*/  | 
| athos@240 | 60  | 
cout << "Eleg nehez volt." << endl;  | 
| athos@240 | 61  | 
}  |