-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
61 lines (51 loc) · 1.2 KB
/
main.cpp
File metadata and controls
61 lines (51 loc) · 1.2 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include "R2Graph.h"
#include "R3Graph.h"
#include "DrawInterWindow.h"
int main() {
using namespace std;
double A, B, C, x, y, z;
#if 0
cout << "Enter vector ";
cin >> A >> B >> C;
if (A*A + B*B + C*C < 1e-16)
{
cout << "You entered null vector" << endl;
return -1;
}
cout << "Enter starting point ";
cin >> x >> y >> z;
#else
A = 1;
B = 1;
C = 1;
x = 0.5;
y = 0.5;
z = 0.5;
#endif
if (!GWindow::initX()) {
std::cout << "Could not connect to X-server" << std::endl;
return -1;
}
DrawInterWindow w;
w.setPlane(InterPlane(A, B, C, x, y, z));
double aspect = (double) GWindow::screenMaxX() /
(double) GWindow::screenMaxY();
double width = 30.;
int height = width / aspect;
w.createWindow(
I2Rectangle(
I2Point(10, 10),
GWindow::screenMaxX()/2,
GWindow::screenMaxY()/2
),
R2Rectangle(
R2Point(-width/2., -height/2.),
width, height
)
);
w.setBackground("LightGray");
DrawInterWindow::printHelp();
GWindow::messageLoop();
GWindow::closeX();
}