-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestShape.py
73 lines (61 loc) · 2.43 KB
/
testShape.py
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
62
63
64
65
66
67
68
69
70
71
72
73
"""
testShape.py
Description: This file is meant to test if the shapes are being drawn correctly.
It will draw a networks with sizes of 5 to 15 starting with line and
ending with mesh network. It should be noted that each network is
visible for 1 second after being diplayed to the screen.
Notes: In the first graph, it will draw a single red line that will remain
throughout the rest of the graphs. This is because the display object
is only meant to be used once per compliation.
"""
import displayVirusSpread as disp
import fileMaker as make
from time import sleep
for current in range(5,15):
displayData = disp.dataToDisplay()
make.line(current)
sleep(1) # Time in seconds.
displayData.animationSteps.append([(1,2)])
disp.LINE_GRAPH = disp.drawGraphFromFile('line.txt')
displayData.typeOfGraph = disp.graphType.LINE
disp.display(displayData)
for current in range(5,15):
displayData = disp.dataToDisplay()
make.ring(current)
sleep(1) # Time in seconds.
displayData.animationSteps.append([(1,2)])
disp.RING_GRAPH = disp.drawGraphFromFile('ring.txt')
displayData.typeOfGraph = disp.graphType.RING
disp.display(displayData)
for current in range(5,15):
displayData = disp.dataToDisplay()
make.star(current)
sleep(1)
displayData.animationSteps.append([(1,2)])
disp.STAR_GRAPH = disp.drawGraphFromFile('star.txt')
displayData.typeOfGraph = disp.graphType.STAR
disp.display(displayData)
for current in range(5,15):
displayData = disp.dataToDisplay()
make.fullConnected(current)
sleep(1) # Time in seconds.
displayData.animationSteps.append([(1,2)])
disp.ALL_CONNECTED_GRAPH = disp.drawGraphFromFile('fullconnect.txt')
displayData.typeOfGraph = disp.graphType.ALL_CONNECTED
disp.display(displayData)
for current in range(5,15):
displayData = disp.dataToDisplay()
make.tree(current)
sleep(1) # Time in seconds.
displayData.animationSteps.append([(1,2)])
disp.TREE_GRAPH = disp.drawGraphFromFile('tree.txt')
displayData.typeOfGraph = disp.graphType.TREE
disp.display(displayData)
for current in range(5,15):
displayData = disp.dataToDisplay()
make.mesh(current)
sleep(1) # Time in seconds.
displayData.animationSteps.append([(1,2)])
disp.MESH_GRAPH = disp.drawGraphFromFile('mesh.txt')
displayData.typeOfGraph = disp.graphType.MESH
disp.display(displayData)