function PlanetextfieldselectRAY(hObject, eventdata, parentfig, Empty_Button, Plane, AxesAFS, AxesSOL, AxesPLA, roton, roton2, rotoff, lcs, nr)

data = get(Empty_Button,'UserData');

set(roton, 'Value', 0);
set(roton2, 'Value', 0);
set(rotoff, 'Value', 1);

if nr == 1
    data.plane.x = getsetvar(Plane(nr), -20, 20, 0, 0);
    set(Plane(nr), 'String', num2str(data.plane.x));
elseif nr == 2
    data.plane.y = getsetvar(Plane(nr), -20, 20, 0, 0);
    set(Plane(nr), 'String', num2str(data.plane.y));
elseif nr == 3
    data.plane.z = getsetvar(Plane(nr), -20, 20, 0, 0);
    set(Plane(nr), 'String', num2str(data.plane.z));
elseif nr == 4
    data.plane.d = getsetvar(Plane(nr), -20, 20, 0, 0);
    set(Plane(nr), 'String', num2str(data.plane.d));
end

if (isfield(data,'isafs') == 1) && (data.isafs == 1)
    [data.plane.act.points, data.plane.d2.points, data.plane.d2.pointsINN, data.plane.d2.pointsOUT] = computePlaneRAY(data);
    
    data.issliced = 0;
    
    axes(AxesSOL);
    
    AFSview = get(AxesAFS,'view');
    PLAview = get(AxesAFS,'view');
    
    plotafsRAY(parentfig, data, AxesAFS, AxesSOL, AxesPLA, lcs);
    
    set(AxesAFS, 'view', AFSview);
    set(AxesPLA, 'view', PLAview);
end

set(Empty_Button,'UserData',data);
