Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
a455e599
Commit
a455e599
authored
Oct 15, 2016
by
Jan-Gerrit Richter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started reworking surf for parse arguments
parent
3605d1e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
22 deletions
+46
-22
applications/SphericalHarmonics/@itaSamplingSph/surf.m
applications/SphericalHarmonics/@itaSamplingSph/surf.m
+8
-1
kernel/ClassStuff/@itaCoordinates/surf.m
kernel/ClassStuff/@itaCoordinates/surf.m
+38
-21
No files found.
applications/SphericalHarmonics/@itaSamplingSph/surf.m
View file @
a455e599
...
...
@@ -6,10 +6,17 @@ function varargout = surf(this, varargin)
% </ITA-Toolbox>
% sArgs = struct('pos1_data','double', 'parent', 0);
% [input,sArgs] = ita_parse_arguments(sArgs,varargin);
numArgIn
=
nargin
;
titleString
=
[];
uniformPlot
=
0
;
numArgIn
=
nargin
;
% this is the plot to a uniform sphere
if
numArgIn
==
3
&&
varargin
{
1
}
==
1
tmp
=
varargin
{
2
};
...
...
kernel/ClassStuff/@itaCoordinates/surf.m
View file @
a455e599
...
...
@@ -41,21 +41,37 @@ function varargout = surf(this, varargin)
narginchk
(
1
,
inf
);
defaultProperties
=
{
'EdgeAlpha'
,
0
,
'FaceColor'
,
'interp'
};
sArgs
=
struct
(
'pos1_data'
,
'double'
,
'radius'
,
[],
defaultProperties
{:},
'parent'
,[]);
if
~
isempty
(
varargin
)
[
data
,
sArgs
]
=
ita_parse_arguments
(
sArgs
,
varargin
);
end
numArgIn
=
nargin
;
%% now set r and color according to the input variables
% there is three options for the colorbar settings:
% geometry / complex / magnitude
if
nargin
==
1
||
(
nargin
>
1
&&
ischar
(
varargin
{
1
}))
% % check for a parent jri: I would like to make this pretty, but i don't
% % have time
% parent = 0;
% if numel(varargin) && strcmpi(data,'Parent')
% parent = varargin{2};
% varargin = varargin(3:end);
% end
if
(
numArgIn
==
1
)
% only coordinates given
r
=
this
.
r
;
color
=
zeros
(
size
(
r
));
colorbar_settings
=
'geometry'
;
else
if
nargin
>
1
&&
isnumeric
(
varargin
{
1
})
else
% also a radius is given
r
=
varargin
{
1
}(:);
if
~
isempty
(
sArgs
.
radius
)
r
=
sArgs
.
radius
;
else
r
=
data
;
end
isComplex
=
~
all
(
isreal
(
r
));
% & min(r(:)) < 0;
if
isComplex
% if the radius is complex, set the color
...
...
@@ -69,40 +85,37 @@ elseif nargin > 1 && isnumeric(varargin{1})
end
r
=
abs
(
r
);
if
nargin
>
2
&&
isnumeric
(
varargin
{
2
}
)
if
~
isempty
(
sArgs
.
radius
)
% if a color is given explicitly
% negative radii are set to 0
if
sum
(
abs
(
imag
(
r
)))
>
0
,
ita_verbose_info
(
'ignoring imaginary part of radius'
);
end
r
=
max
(
real
(
r
),
0
);
color
=
varargin
{
2
}
.'
;
color
=
data
.'
;
% use the magnitude of complex data
if
~
all
(
isreal
(
color
))
color
=
abs
(
color
);
end
colorbar_settings
=
'magnitude'
;
% set varargin for the built-in function
varargin
=
varargin
(
3
:
end
);
else
varargin
=
varargin
(
2
:
end
);
end
elseif
nargin
>
2
&&
isa
(
varargin
{
1
}
,
'itaSuper'
)
varargout
{
1
}
=
surf
(
this
,
varargin
{
1
}
.
freq2value
(
varargin
{
2
}),
varargin
{
3
:
end
});
title
([
' f = '
num2str
(
varargin
{
2
})
'Hz '
])
if
~
nargout
,
varargout
=
{};
end
return
;
% elseif numArgIn > 2 && isa(data
,'itaSuper')
% varargout{1} = surf(this, data
.freq2value(varargin{2}), varargin{3:end});
%
title([' f = ' num2str(varargin{2}) 'Hz '])
%
if ~nargout, varargout = {}; end
%
return;
end
% define how big the patches can get
if
numel
(
varargin
)
&&
strcmpi
(
varargin
{
1
}
,
'plop'
)
if
numel
(
varargin
)
&&
strcmpi
(
data
,
'plop'
)
maxAreaVertex
=
varargin
{
2
};
varargin
=
varargin
(
3
:
end
);
else
maxAreaVertex
=
0
;
end
% set a hull if no is explicitly given
if
numel
(
varargin
)
&&
strcmpi
(
varargin
{
1
}
,
'hull'
)
if
numel
(
varargin
)
&&
strcmpi
(
data
,
'hull'
)
hull
=
varargin
{
2
};
if
any
(
size
(
hull
,
2
)
~=
3
)
error
(
'something wrong with the hull in itaCoordinates.surf'
);
...
...
@@ -153,7 +166,11 @@ if maxAreaVertex > 0
end
% plot the surface
hFig
=
trisurf
(
hull
,
this
.
x
,
this
.
y
,
this
.
z
);
if
sArgs
.
parent
~=
0
hFig
=
trisurf
(
hull
,
this
.
x
,
this
.
y
,
this
.
z
,
'Parent'
,
sArgs
.
parent
);
else
hFig
=
trisurf
(
hull
,
this
.
x
,
this
.
y
,
this
.
z
);
end
% jri: matlab 2014b interpolation changed: interpolation between cvalues
% leads to breaks in plot: set rgbValues only in complex plots
if
(
strcmp
(
colorbar_settings
,
'complex'
))
...
...
@@ -164,9 +181,9 @@ else
end
set
(
gca
,
'SortMethod'
,
'depth'
);
% replaced set(gca,'DrawMode','fast'); % this avoids a MATLAB segfault (?? only for renderer painters)
set
(
hFig
,
defaultProperties
{:});
if
numel
(
varargin
)
set
(
hFig
,
varargin
{:});
end
%
if numel(varargin)
%
set(hFig, varargin{:});
%
end
switch
colorbar_settings
case
'geometry'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment