### /filter/getInput.py

import wx
from gui.imageimport import *


from obj.objImage import objImage
from obj.objFilter import objFilter

def getInput(obj,frame):
	# get datainputs from objFilter.input 
	# for the number
	
	obj.datainput = []
	i = 0
	
	for o in obj.input:
		if isinstance(o,objImage):
			# obj.datainput[i] = o.image
			obj.datainput.append(o.image)
			
			# update editcount
			#obj.editcount = frame.get_editcount()
		elif isinstance(o,objFilter):
			# editcount decision
			#if obj.editcount <= o.editcount:
			
			getInput(o,frame)
			
			if o.dataoutput == None:
				continue
			else:
				#obj.datainput[i] = o.dataoutput
				obj.datainput.append(o.dataoutput)
			#else:
			#	obj.datainput.append(o.dataoutput)
			
			# update editcount
			#obj.editcount = o.editcount
			
		#print obj,obj.editcount
		# iterator decision
		i += 1
		if i >= obj.getcount:
			break
			
	# make obj.dataoutput
	"""
	if i >= obj.getcount:
		obj.function(obj)
		obj.PreviewBitmap()
	else:
		obj.dataoutput = None
	"""
	obj.function(obj)
	obj.PreviewBitmap()
