⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui_mesh_plot.m

📁 Matlab下的EEG处理程序库
💻 M
📖 第 1 页 / 共 2 页
字号:
function [p] = gui_mesh_plot(p,mesh_plot_command,parent)

% GUI_MESH_PLOT - GUI for plotting meshes
%
% Useage:   p = gui_mesh_plot(p,command,[parent])
%
% command   - either 'init' or 'plot'
% parent    - optional, GUI parent window
%
% The functionality is further described in mesh_plot.m
%

% $Revision: 1.3 $ $Date: 2003/04/07 06:12:02 $

% Licence:  GNU GPL, no express or implied warranties
% History:  02/2002, Darren.Weber@flinders.edu.au
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if ~exist('mesh_plot_command','var'),
    mesh_plot_command = 'init';
end

if ~exist('p','var'),
    p = mesh_open;
elseif isempty(p),
    p = mesh_open(p);
elseif isfield(p,'mesh'),
    if isfield(p.mesh,'data'),
        if isempty(p.mesh.data),
            p = mesh_open(p);
        end
    else
        p = mesh_open(p);
    end
end


switch mesh_plot_command,
    
	case 'init',
        
        p = mesh_plot(p);
        
        if exist('parent','var'),
            MESHPlot = INIT(p,parent);
        else
            MESHPlot = INIT(p);
        end
        
    case 'return',
        
        MESHPlot = get(gcbf,'Userdata');
        if isequal(get(MESHPlot.handles.Bhold,'Value'),0),
            p = gui_updateparent(MESHPlot);
            close gcbf;
        else
            p = gui_updateparent(MESHPlot,0);
        end
        fprintf('GUI_MESH_PLOT: Plot parameters returned.\n');
        
	otherwise,
        close(p.mesh.plot.fig);
        close gcbf;
end

return


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [MESHPlot] = INIT(p,parent),
    
    % GUI General Parameters
    
    GUIwidth  = 50;
    GUIheight = 30;
    
    GUI = figure('Name','MESH Plot','Tag','MESH_PLOT',...
                 'NumberTitle','off','units','characters',...
                 'MenuBar','none','Position',[1 1 GUIwidth GUIheight]);
    movegui(GUI,'center');
    
    set(GUI,'HandleVisibility','callback');
    
    MESHPlot.gui = GUI;
    
    Font.FontName   = 'Helvetica';
    Font.FontUnits  = 'Pixels';
    Font.FontSize   = 12;
    Font.FontWeight = 'normal';
    Font.FontAngle  = 'normal';
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Mesh Data Selection and Parameters

    % Provide some GUI callbacks to change lighting...
    G.Fmesh = uicontrol('Parent',GUI,'Style','frame','Units','Normalized',Font, ...
        'Position',[.04 .62 .92 .36],...
        'TooltipString','Mesh Parameters',...
        'HorizontalAlignment','left');
    G.Tmesh = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font, ...
        'Position',[.06 .90 .4 .05],...
        'TooltipString','Mesh Parameters',...
        'String','Mesh','HorizontalAlignment','left');
    
 	% Overlay checkbox
	G.Boverlay = uicontrol('Parent',GUI,'Style','checkbox','Units','Normalized', Font, ...
        'Position',[.50 .90 .4 .05],'String','Overlay','BusyAction','queue',...
        'TooltipString','Overlay MESH Plots',...
        'Value',p.mesh.plot.overlay,'HorizontalAlignment', 'center');
    
    % Mesh Type
    G.Title_data = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font, ...
        'Position',[.10 .82 .3 .05],...
        'String','Mesh Type:','HorizontalAlignment','left');
    G.PmeshType = uicontrol('Tag','PmeshType','Parent',GUI,'Style','popupmenu',...
        'Units','Normalized',Font,  ...
        'Position',[.50 .82 .4 .05],...
        'String',p.mesh.data.meshtype,'Value',p.mesh.current,...
        'TooltipString','Mesh/Tesselation Layer',...
        'Callback',strcat('MESHPlot = get(gcbf,''Userdata'');',...
                          'MESHPlot.p.mesh.current = get(MESHPlot.handles.PmeshType,''Value'');',...
                          'MESHPlot.p.mesh.plot.overlay = get(MESHPlot.handles.Boverlay,''Value'');',...
                          'MESHPlot.p = mesh_plot(MESHPlot.p);',...
                          'set(gcbf,''Userdata'',MESHPlot); clear MESHPlot;'));
    
    G.Tedgecolor = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font, ...
        'Position',[.10 .75 .3 .05],...
        'TooltipString','Mesh Edge Color: 3 by 0-1 RGB float values or ''none''',...
        'String','Edge Color:','HorizontalAlignment','left');
    G.Eedgecolor = uicontrol('Parent',GUI,'Style','edit',...
        'Tag','p.mesh.plot.Hpatch.edgecolor','Units','Normalized',Font,  ...
        'Position',[.50 .75 .4 .05],...
        'String',sprintf('%2.1f %2.1f %2.1f',get(p.mesh.plot.Hpatch{p.mesh.current},'EdgeColor')),...
        'TooltipString','Mesh Edge Color: 0-1 RGB values or ''none''',...
        'Callback',strcat('MESHPlot = get(gcbf,''Userdata'');',...
                          'MESHPlot.p.mesh.plot.edgecolor = get(MESHPlot.handles.Eedgecolor,''String'');',...
                          'if findstr(MESHPlot.p.mesh.plot.edgecolor,''none''), ',...
                          '   set(MESHPlot.p.mesh.plot.Hpatch{MESHPlot.p.mesh.current},''EdgeColor'',''none'');',...
                          'else, ',...
                          '   edgecolor = str2num(MESHPlot.p.mesh.plot.edgecolor); ',...
                          '   if and(isequal(size(edgecolor,1),1),isequal(size(edgecolor,2),3)), ',...
                          '      set(MESHPlot.p.mesh.plot.Hpatch{MESHPlot.p.mesh.current},''EdgeColor'',edgecolor);',...
                          '   else, ',...
                          '      msg = sprintf(''EdgeColor must be ''''none'''' or 1x3 element RGB values between 0-1\n'');',...
                          '      warndlg(msg,''Mesh Plot Warning'');',...
                          '   end; ',...
                          'end; ',...
                          'set(gcbf,''Userdata'',MESHPlot); clear edgecolor MESHPlot;'));
    
    G.Tfacecolor = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font, ...
        'Position',[.10 .70 .3 .05],...
        'TooltipString','Mesh Face Color: 3 by 0-1 RGB float values or ''none''',...
        'String','Face Color:','HorizontalAlignment','left');
    G.Efacecolor = uicontrol('Parent',GUI,'Style','edit',...
        'Tag','p.mesh.plot.Hpatch.facecolor','Units','Normalized',Font,  ...
        'Position',[.50 .70 .4 .05],...
        'String',sprintf('%2.1f %2.1f %2.1f',get(p.mesh.plot.Hpatch{p.mesh.current},'FaceColor')),...
        'TooltipString','Face Edge Color: 0-1 RGB values or ''none''',...
        'Callback',strcat('MESHPlot = get(gcbf,''Userdata'');',...
                          'MESHPlot.p.mesh.plot.facecolor = get(MESHPlot.handles.Efacecolor,''String'');',...
                          'if findstr(MESHPlot.p.mesh.plot.facecolor,''none''), ',...
                          '   set(MESHPlot.p.mesh.plot.Hpatch{MESHPlot.p.mesh.current},''FaceColor'',''none'');',...
                          'else, ',...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -