Changeset 955 for trunk/src/mouse_down.m


Ignore:
Timestamp:
Jun 22, 2016, 7:54:40 PM (8 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r926 r955  
    430430        set(hhuvmat.CheckViewObject,'Value',1)
    431431    end
    432     ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
     432        %get handles of the GUI set_object
     433    h_set_object=findobj(allchild(0),'Tag','set_object');
     434    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        Delta_mod=sqrt(Delta_x*Delta_x+Delta_y*Delta_y);%modulus of displacement
     439        ObjectData.Angle(1)=90*Delta_x/Delta_mod;
     440        ObjectData.Angle(2)=90*Delta_y/Delta_mod;
     441        ObjectData.Angle(3)=0;% plane rotated by 90 ° along the axis of mouse displacement since the origin
     442        set(hh_set_object.num_Angle_1,'String',num2str(ObjectData.Angle(1)))
     443        set(hh_set_object.num_Angle_2,'String',num2str(ObjectData.Angle(2)))
     444        set(hh_set_object.num_Angle_3,'String',num2str(ObjectData.Angle(3)))
     445        drawing_status='off';
     446    else
     447        ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
     448        set(hh_set_object.Coord,'Data',ObjectData.Coord);%append the current mouse cordinates in the GUI set_object
     449        drawing_status='create';
     450    end
    433451    %TODO replace 0 by z coord for 3D
    434452    hobject=UvData.ProjObject{IndexObj}.DisplayHandle.(CurrentGUI_tag);
     
    449467    PlotData.IndexObj=IndexObj;
    450468    set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion)
    451     AxeData.Drawing='create';% flag for mouse motion
    452 
    453     %show object coordinates in the GUI set_object
    454     h_set_object=findobj(allchild(0),'Tag','set_object');
    455     hh_set_object=guidata(h_set_object);
    456     set(hh_set_object.Coord,'Data',ObjectData.Coord);
     469    AxeData.Drawing=drawing_status;% flag for mouse motion
    457470end
    458471
Note: See TracChangeset for help on using the changeset viewer.