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
end
%% plot
function h = plot(this,additionalArgs)
function h = plot(this,varargin)
if nargin < 2
h = ita_plot_mesh(this);
else
h = ita_plot_mesh(this,additionalArgs);
h = ita_plot_mesh(this,varargin{:});
end
end
......
......@@ -41,13 +41,16 @@ if nargin
handleMode = false;
if ischar(varargin{1})
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);
Mesh = itaMesh(unvFilename);
elseif isa(varargin{1},'itaMesh')
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);
elseif all(ishandle(varargin{1}))
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);
handleMode = true;
else
......@@ -153,6 +156,9 @@ else
% figure('units','normalized','outerposition',[1 0 1 1]);
figure;
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');
hold off;
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