Ignore:
Timestamp:
Jan 17, 2020, 8:13:53 PM (3 years ago)
Author:
sommeria
Message:

LIF updated and bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r1071 r1072  
    288288
    289289%% selection of an existing projection object (third priority)
    290 if  test_edit
     290if  test_edit && ~strcmp(get(hcurrentobject,'Type'),'figure')
    291291    testdeform=0;
    292292    if ~(isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'create'))
     
    360360               end
    361361            end
    362 %             if testdeform==0
    363 %                 AxeData.Drawing='translate';
    364 %                 set(AxeData.CurrentObject,'Selected','on')
    365 %                 set(gcbo,'Pointer','fleur');
    366 %             end
    367362        else
    368363            if strcmp(get(hCurrentGUI,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field
     
    433428    h_set_object=findobj(allchild(0),'Tag','set_object');
    434429    hh_set_object=guidata(h_set_object);
    435     if strcmp(ObjectData.Type,'plane_z')&& ~isempty(ObjectData.Coord)
    436         Delta_x=(xy(1,1)-ObjectData.Coord(1,1));%displacement along x
    437         Delta_y=(xy(1,2)-ObjectData.Coord(1,2));%displacement along y
    438         ObjectData.Angle(1)=(180/pi)*angle(Delta_x+i*Delta_y);
    439         ObjectData.Angle(2)=90;       
    440         set(hh_set_object.num_Angle_1,'String',num2str(ObjectData.Angle(1)))
    441         set(hh_set_object.num_Angle_2,'String',num2str(ObjectData.Angle(2)))
    442          drawing_status='off';
     430    if strcmp(ObjectData.Type,'plane')
     431        if isempty(ObjectData.Coord)||(isfield(ObjectData,'RangeX') && size(ObjectData.RangeX,2)==2)% draw a new plane
     432            ObjectData.Coord=xy(1,1:2);% record the coordinates marked by the mouse as origin of the new plane
     433            set(hh_set_object.Coord,'Data',ObjectData.Coord);%append the current mouse cordinates in the GUI set_object
     434            set(hh_set_object.num_RangeX_2,'String','')
     435            set(hh_set_object.num_Angle_1,'String','0')
     436            drawing_status='create';
     437        else
     438            Delta_x=(xy(1,1)-ObjectData.Coord(1,1));%displacement along x
     439            Delta_y=(xy(1,2)-ObjectData.Coord(1,2));%displacement along y
     440            ObjectData.Angle(1)=(180/pi)*angle(Delta_x+i*Delta_y);
     441            ObjectData.Angle(2)=90;
     442            ObjectData.RangeX(1)=0;
     443            ObjectData.RangeX(2)=abs(Delta_x+i*Delta_y);
     444            set(hh_set_object.num_Angle_1,'String',num2str(ObjectData.Angle(1)))
     445            set(hh_set_object.num_Angle_2,'String',num2str(ObjectData.Angle(2)))
     446            set(hh_set_object.num_RangeX_1,'String',num2str(ObjectData.RangeX(1)))
     447            set(hh_set_object.num_RangeX_2,'String',num2str(ObjectData.RangeX(2)))
     448            drawing_status='off';
     449        end
    443450    else
    444451        ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
Note: See TracChangeset for help on using the changeset viewer.