Commit 25e92ae1 authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter

added reduce option to ita_plot_mesh and fixed argument pass in itaMesh

parent 6fd09c86
...@@ -311,11 +311,11 @@ classdef itaMesh ...@@ -311,11 +311,11 @@ classdef itaMesh
end end
%% plot %% plot
function h = plot(this,additionalArgs) function h = plot(this,varargin)
if nargin < 2 if nargin < 2
h = ita_plot_mesh(this); h = ita_plot_mesh(this);
else else
h = ita_plot_mesh(this,additionalArgs); h = ita_plot_mesh(this,varargin{:});
end end
end end
......
...@@ -41,13 +41,16 @@ if nargin ...@@ -41,13 +41,16 @@ if nargin
handleMode = false; handleMode = false;
if ischar(varargin{1}) if ischar(varargin{1})
sArgs = struct('pos1_unvFilename','string','plotObject',itaSuper(),'plotInstant',[],'plotDomain','freq','plotType','mag','plotRange',[],'hold','off'); sArgs = struct('pos1_unvFilename','string','plotObject',itaSuper(),'plotInstant',[],'plotDomain','freq','plotType','mag','plotRange',[],'hold','off');
sArgs.reduce = 0;
[unvFilename,sArgs] = ita_parse_arguments(sArgs,varargin); [unvFilename,sArgs] = ita_parse_arguments(sArgs,varargin);
Mesh = itaMesh(unvFilename); Mesh = itaMesh(unvFilename);
elseif isa(varargin{1},'itaMesh') elseif isa(varargin{1},'itaMesh')
sArgs = struct('pos1_Mesh','itaMesh','plotObject',itaSuper(),'plotInstant',[],'plotDomain','freq','plotType','mag','plotRange',[],'hold','off'); sArgs = struct('pos1_Mesh','itaMesh','plotObject',itaSuper(),'plotInstant',[],'plotDomain','freq','plotType','mag','plotRange',[],'hold','off');
sArgs.reduce = 0;
[Mesh,sArgs] = ita_parse_arguments(sArgs,varargin); [Mesh,sArgs] = ita_parse_arguments(sArgs,varargin);
elseif all(ishandle(varargin{1})) elseif all(ishandle(varargin{1}))
sArgs = struct('pos1_h','anything','plotObject',itaSuper(),'plotInstant',[],'plotDomain','freq','plotType','mag','plotRange',[],'hold','off'); sArgs = struct('pos1_h','anything','plotObject',itaSuper(),'plotInstant',[],'plotDomain','freq','plotType','mag','plotRange',[],'hold','off');
sArgs.reduce = 0;
[h,sArgs] = ita_parse_arguments(sArgs,varargin); [h,sArgs] = ita_parse_arguments(sArgs,varargin);
handleMode = true; handleMode = true;
else else
...@@ -153,6 +156,9 @@ else ...@@ -153,6 +156,9 @@ else
% figure('units','normalized','outerposition',[1 0 1 1]); % figure('units','normalized','outerposition',[1 0 1 1]);
figure; figure;
end end
if sArgs.reduce ~= 0
[faces_matrix, vertices_matrix] = reducepatch(faces_matrix,vertices_matrix,sArgs.reduce,'fast');
end
h = patch('Vertices',vertices_matrix,'Faces',faces_matrix,'FaceVertexCData',plotData,'FaceColor','interp','EdgeColor','k'); h = patch('Vertices',vertices_matrix,'Faces',faces_matrix,'FaceVertexCData',plotData,'FaceColor','interp','EdgeColor','k');
hold off; hold off;
if ~meshOnly if ~meshOnly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment