📄 shw3d_win.m
字号:
function fig = shw3d_win()
%SHW3D_WIN is a demo of GUI design for the book.
%designed by Professor Dingyu Xue (c), 5 April, 2000
mat2=[ 0 0 1.0000
0 0.5000 0
1.0000 0 0
0 0.7500 0.7500
0.7500 0 0.7500
0.7500 0.7500 0
0.2500 0.2500 0.2500];
h0 = figure('Units','normalized', 'Color',[0.8 0.8 0.8], ...
'Name','Graphics Displayer', 'NumberTitle','off', ...
'PaperPosition',[18 180 576 432], 'PaperUnits','points', ...
'Position',[0.245 0.2317 0.58875 0.5667], ...
'Tag','gFigMain', 'ToolBar','figure');
mat0=colormap; set(h0,'Colormap',mat0);
h1 = uicontrol('Parent',h0, 'Units','normalized', ...
'BackgroundColor',[0.8 0.8 0.8],'ListboxTop',0,...
'Position',[0.7495, 0.4624, 0.2144, 0.2882],...
'Style','frame', 'Tag','Frame1');
h1 = uicontrol('Parent',h0, 'Units','normalized',...
'BackgroundColor',[0.8 0.8 0.8], 'Callback','draw_3d_graph;',...
'Position',[0.7282 0.8824 0.2251 0.0706], ...
'ListboxTop',0,'String','Draw 3D Surface', 'Tag','btnDraw');
h1 = axes('Parent',h0, 'CameraUpVector',[0 1 0], ...
'CameraUpVectorMode','manual', 'NextPlot','replace',...
'Color',[1 1 1], 'ColorOrder',mat2, ...
'Position',[0.0764 0.3206 0.6030 0.6059], ...
'Tag','myAxes', 'XColor',[0 0 0],'YColor',[0 0 0],'ZColor',[0 0 0]);
h2 = text('Parent',h1, 'Color',[0 0 0], 'HandleVisibility','off', ...
'HorizontalAlignment','center','Position',[0.4982 -0.1171 9.1603],...
'Tag','Axes1Text4','VerticalAlignment','cap');
set(get(h2,'Parent'),'XLabel',h2);
h2 = text('Parent',h1, 'Color',[0 0 0],'HandleVisibility','off', ...
'HorizontalAlignment','center', 'Position',[-0.1025 0.4927 9.1603], ...
'Rotation',90,'Tag','Axes1Text3', 'VerticalAlignment','baseline');
set(get(h2,'Parent'),'YLabel',h2);
h2 = text('Parent',h1, 'Color',[0 0 0],'HandleVisibility','off', ...
'Position',[-0.1307 1.1171 9.1603], ...
'HorizontalAlignment','right','Tag','Axes1Text2','Visible','off');
set(get(h2,'Parent'),'ZLabel',h2);
h2 = text('Parent',h1,'Color',[0 0 0],'HandleVisibility','off', ...
'HorizontalAlignment','center','Position',[0.4982 1.0341 9.1603],...
'Tag','Axes1Text1','VerticalAlignment','bottom');
set(get(h2,'Parent'),'Title',h2);
h1 = uicontrol('Parent',h0, 'Units','normalized','Style','edit',...
'Position',[0.0573 0.0588 0.6157 0.1676], ...
'BackgroundColor',[1 1 1],'ListboxTop',0,'Tag','strB',...
'HorizontalAlignment','left','Max',5);
h1 = uicontrol('Parent',h0, 'Units','normalized',...
'BackgroundColor',[0.8,0.8,0.8],'ListboxTop',0,...
'Position',[0.6709 0.0647 0.0382 0.1618],...
'Style','slider','Tag','Slider1');
h1 = uicontrol('Parent',h0, 'Units','normalized',...
'BackgroundColor',[0.8 0.8 0.8],'ListboxTop',0,...
'Position',[0.7516, 0.1912, 0.2144, 0.2235],...
'Style','frame', 'Tag','Frame1');
h1 = uicontrol('Parent',h0, 'Units','normalized',...
'BackgroundColor',[0.8 0.8 0.8],'ListboxTop',0, ...
'Position',[0.7792 0.3882 0.1444 0.04412], ...
'String','Grid setting', 'Style','text', 'Tag','StaticText1');
h1 = uicontrol('Parent',h0, 'Units','normalized',...
'BackgroundColor',[0.8 0.8 0.8],'ListboxTop',0, ...
'Position',[0.7813 0.3324 0.1444 0.04118], ...
'String','x-axis grid', 'Style','checkbox', 'Tag','chkX',...
'Value',1,'CallBack','shw_grids;');
h1 = uicontrol('Parent',h0, 'Units','normalized',...
'BackgroundColor',[0.8 0.8 0.8],'ListboxTop',0, ...
'Position',[0.7813 0.2735 0.1444 0.04118], ...
'String','y-axis grid', 'Style','checkbox', 'Tag','chkY',...
'Value',1,'CallBack','shw_grids;');
h1 = uicontrol('Parent',h0, 'Units','normalized', ...
'BackgroundColor',[0.8 0.8 0.8],'ListboxTop',0, ...
'Position',[0.7813 0.2146 0.1444 0.041176], ...
'String','z-axis grid', 'Style','checkbox','Tag','chkZ',...
'Value',1,'CallBack','shw_grids;');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0, ...
'BackgroundColor',[0.8 0.8 0.8],'Position',[278.25 180.75 46.5 15],...
'String','Lighting spot','Style','text', 'Tag','StaticText2');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0,...
'BackgroundColor',[1 1 1],'Position',[298.5 144 33.75 15.75], ...
'String','-1', 'Style','edit', 'Tag','edYPos','CallBack','set_light;');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0, ...
'BackgroundColor',[0.8 0.8 0.8],'Position',[270 145.5 23.25 13.5],...
'String','y-axis','Style','text', 'Tag','StaticText3');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0,...
'BackgroundColor',[0.8 0.8 0.8],'Position',[270 166.5 23.25 13.5],...
'String','x-axis','Style','text', 'Tag','StaticText3');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0, ...
'BackgroundColor',[1 1 1],'Position',[298.5 165.75 33.75 15.75], ...
'String','-1','Style','edit', 'Tag','edXPos','CallBack','set_light;');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0,...
'BackgroundColor',[1 1 1],'Position',[298.5 122.25 33.75 15.75], ...
'String','1','Style','edit', 'Tag','edZPos','CallBack','set_light;');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0, ...
'BackgroundColor',[0.8 0.8 0.8],'Position',[270 123.75 23.25 13.5],...
'String','z-axis','Style','text', 'Tag','StaticText3');
h1 = uicontrol('Parent',h0, 'Units','normalized','ListboxTop',0,...
'BackgroundColor',[0.8 0.8 0.8],'Callback','run_demo', ...
'Position',[0.7304 0.7912 0.2229 0.06471], ...
'String','Run Demo', 'Tag','btnDemo');
h1 = uicontrol('Parent',h0, 'Units','points','ListboxTop',0, ...
'BackgroundColor',[0.8 0.8 0.8],'Position',[258.25 27.90 76.5 15],...
'String','Coloring Scheme','Style','text', 'Tag','StaticText2');
h1 = uicontrol('Parent',h0, 'Units','normalized','ListboxTop',0, ...
'BackgroundColor',[0.8 0.8 0.8],'Position',[0.7643 0.05 0.1975 0.0529], ...
'String','faceted | flat | interp','Style','popupmenu',...
'Tag','lstColor','Value',2,'CallBack','set_color_edge;');
if nargout > 0, fig = h0; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -