from H3DInterface import *

class PointsToMFVec3f(TypedField(MFVec3f, (SFVec3f, SFVec3f, SFBool))):
	def __init__(self):
		TypedField(MFVec3f, (SFVec3f, SFVec3f, SFBool)).__init__(self)
		self.null_line = [Vec3f(0,0,0), Vec3f(0,0,0)]
	
	def update(self, event):
		routes_in = self.getRoutesIn()
		p1 = routes_in[0].getValue()
		p2 = routes_in[1].getValue()
		enabled = routes_in[2].getValue()
		if enabled:
			return [p1, p2]
		else:
			return self.null_line
		
line_ends = PointsToMFVec3f()
		
