From 25e92ae10a8d93e92dee7dac8c714600b99c63f4 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Richter Date: Tue, 17 Jan 2017 17:19:23 +0100 Subject: [PATCH] added reduce option to ita_plot_mesh and fixed argument pass in itaMesh --- kernel/ClassStuff/Meshing/@itaMesh/itaMesh.m | 4 ++-- kernel/PlotRoutines/ita_plot_mesh.m | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/ClassStuff/Meshing/@itaMesh/itaMesh.m b/kernel/ClassStuff/Meshing/@itaMesh/itaMesh.m index 2dd182d..d521920 100644 --- a/kernel/ClassStuff/Meshing/@itaMesh/itaMesh.m +++ b/kernel/ClassStuff/Meshing/@itaMesh/itaMesh.m @@ -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 diff --git a/kernel/PlotRoutines/ita_plot_mesh.m b/kernel/PlotRoutines/ita_plot_mesh.m index 2df3857..7d714db 100644 --- a/kernel/PlotRoutines/ita_plot_mesh.m +++ b/kernel/PlotRoutines/ita_plot_mesh.m @@ -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 -- 2.22.0