forked from adityagirisha/VRchitect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blah.py
140 lines (107 loc) · 3.21 KB
/
blah.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from functools import partial
from kivy.base import runTouchApp
from kivy.uix.spinner import Spinner
import cv2
import numpy as np
import os
str_path=""
str_name=""
h=0.0
l=0.0
b=0.0
y=0
floor_images=[]
class LoadDialog(FloatLayout):
load = ObjectProperty(None)
cancel = ObjectProperty(None)
class LoadDialogNext(FloatLayout):
loadnext = ObjectProperty(None)
cancel = ObjectProperty(None)
class Root(FloatLayout):
hgt = ObjectProperty(None)
len = ObjectProperty(None)
bre = ObjectProperty(None)
plus = ObjectProperty(None)
minus = ObjectProperty(None)
floor = ObjectProperty(None)
loadfile = ObjectProperty(None)
def add(self):
f=int(self.floor.text)
if(f>=0):
f=f+1
self.floor.text=str(f)
def subt(self):
f=int(self.floor.text)
if(f>0):
f=f-1
self.floor.text=str(f)
def dismiss_popup(self):
self._popup.dismiss()
def show_load(self):
global x
x=int(self.floor.text)
if(x==0):
return
if(x==1):
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
if(x>1):
content = LoadDialogNext(loadnext=self.loadnext, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
x=x-1
def loadnext(self, path, filename):
global y
global floor_images
floor_images.append(str(filename))
print(filename)
print(floor_images[y])
y=y+1
self.dismiss_popup()
global x
if( x>1):
content = LoadDialogNext(loadnext=self.loadnext, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
if(x==1):
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
x=x-1
def load(self, path, filename):
global y
global floor_images
floor_images.append(str(filename))
print(floor_images[y])
y=y+1
self.dismiss_popup()
def sub(self):
global h
global b
global l
h=float(self.hgt.text)
b=float(self.bre.text)
l=float(self.len.text)
global floor_images
print(floor_images)
print(h,b,l)
class Editor(App):
pass
Factory.register('Root', cls=Root)
Factory.register('LoadDialog', cls=LoadDialog)
Factory.register('LoadDialogNext', cls=LoadDialogNext)
if __name__ == '__main__':
Editor().run()