Home > functions > gui > bm_editor > bm_edit_app_view > bm_edit_app_view3d > bm_edit_app_view3d_plot_surf.m

bm_edit_app_view3d_plot_surf

PURPOSE ^

plot surface

SYNOPSIS ^

function h = bm_edit_app_view3d_plot_surf(obj, axes_h, V, F, face_color, max_mode)

DESCRIPTION ^

 plot surface
 [USAGE]
    h = bm_edit_app_view3d_plot_surf(...
                         <obj>, <V>, <F>[, face_color][, max_mode]);
 [IN]
           obj : bm_edit_app_view3d object
        axes_h : plotted axes handle
             V : vertex coordinate
             F : patch index
    face_color : face color
      max_mode : set axis limit
 [OUT]
    h : patch object handle

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function h = bm_edit_app_view3d_plot_surf(...
0002                             obj, axes_h, V, F, face_color, max_mode)
0003 % plot surface
0004 % [USAGE]
0005 %    h = bm_edit_app_view3d_plot_surf(...
0006 %                         <obj>, <V>, <F>[, face_color][, max_mode]);
0007 % [IN]
0008 %           obj : bm_edit_app_view3d object
0009 %        axes_h : plotted axes handle
0010 %             V : vertex coordinate
0011 %             F : patch index
0012 %    face_color : face color
0013 %      max_mode : set axis limit
0014 % [OUT]
0015 %    h : patch object handle
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 %
0021 % --- Previous check
0022 %
0023 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0024 if ~exist('axes_h', 'var'), error('axes_h is a required parameter.'); end
0025 if ~exist('V', 'var'), error('V is a required parameter.'); end
0026 if ~exist('F', 'var'), error('F is a required parameter.'); end
0027 if ~exist('face_color','var') | isempty(face_color), 
0028     face_color = [0.8 0.7 0.6];
0029 end
0030 if ~exist('max_mode','var') | isempty(max_mode), max_mode=0; end;
0031 
0032 %
0033 % --- Main Procedure
0034 %
0035 
0036 set(gcf, 'CurrentAxes', axes_h);
0037 
0038 % ¶ÊÌÌɽ¼¨
0039 h = patch('Faces',F,'Vertices',V,'FaceColor',face_color,'EdgeColor','none');
0040 
0041 lighting phong;
0042 material dull;
0043 axis equal;
0044 
0045 xlabel('X');
0046 ylabel('Y');
0047 zlabel('Z');
0048 
0049 if  max_mode == 1
0050     Vmax = max(V);
0051     Vmin = min(V);
0052     xlim([Vmin(1) Vmax(1)]);
0053     ylim([Vmin(2) Vmax(2)]);
0054     zlim([Vmin(3) Vmax(3)]);
0055 end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005