from Tkinter import *
from visual import *
from random import *

import time,sys,thread


kSpaceW = display(title='k Space', width=300, height=310, x=440, y=630, center=(pi,pi,0), background=(.95,.95,.95), visible=1)
kSpaceW.fov = 0.001
kSpaceW.userzoom = 0
kSpaceW.userspin = 0
kSpaceW.range = 1.1*pi


xAxis = []
for x in arange(0.0,2.0*pi+.1,2.0*pi):
    xAxis.append(vector(x,pi,0.0))
xAxisLine = curve(pos=xAxis, color=(.0,.0,.0))

yAxis = []
for y in arange(0.0,2.0*pi+.1,2.0*pi):
    yAxis.append(vector(pi,y,0.0))
yAxisLine = curve(pos=yAxis, color=(.0,.0,.0))



class kSpace:
    nSpinsX = 3
    nSpinsY = 2
    
    kInput = vector(0.0,0.0,0.0)
    kActual = vector(0.0,0.0,0.0)

    kInputPoint = sphere(pos=kInput, color=(0.5,0.5,0.9), radius=0.1)
    kActualPoint = sphere(pos=kActual, color=(0.0,0.0,0.0), radius=0.1)
    
    def __init__(self,nSpinsX,nSpinsY,kInput,kActual):
        self.nSpinsX = nSpinsX
        self.nSpinsY = nSpinsY
        
        self.kInput = kInput
        self.kActual = kActual

    def setkValues(self,kInput,kActual):
        self.kInput = kInput
        self.kActual = kActual
        
        self.kInputPoint.pos = vector(kInput[0],kInput[1],0.0)
        self.kActualPoint.pos = vector(kActual[0],kActual[1],0.0)



        
    
