Skip to content
Snippets Groups Projects
Commit b4b29041 authored by leprob001's avatar leprob001
Browse files

In trajectory output window, lines are now drawn between soundsources for selected trajectory.

parent 687feef4
No related merge requests found
function [] = plotSoundsourceLines()
%PLOTSOUNDSOURCELINES Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace artoaGui;
%% Get required data
trajectoryId = artoaWorkspace.trajectoryOutput.tableGeneratedTracksSelectedRow;
trajectory = artoaWorkspace.trajectoryOutput.trajectories{trajectoryId};
%% Get all sound sources that are involved
involvedSoundsourceNames = ...
unique(flatten( ...
cellfun( ...
@strsplit, trajectory.trackParameter.soundsourceCombinations.soundsources, 'UniformOutput', false ...
) ...
));
involvedSoundsources = artoa.data.extractSoundsourcesFromStruct( ...
involvedSoundsourceNames, ...
artoaWorkspace.filteredSoundsources, ...
true ...
);
%% Plot lines between soundsources
hold(artoaGui.trajectoryOutput.axesTrajectoryOutput, 'on');
artoaGui.trajectoryOutput.linesSoundsources = {};
for o = 1:length(involvedSoundsourceNames)
currentSoundsource = involvedSoundsources.(involvedSoundsourceNames{o});
for i = o + 1:length(involvedSoundsourceNames)
innerSoundsource = involvedSoundsources.(involvedSoundsourceNames{i});
x = [currentSoundsource.position(2) innerSoundsource.position(2)];
y = [currentSoundsource.position(1) innerSoundsource.position(1)];
artoaGui.trajectoryOutput.linesSoundsources{end + 1} = line( ...
artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
x, y, 'Color', [0 0 0] ...
);
end
end
hold(artoaGui.trajectoryOutput.axesTrajectoryOutput, 'off');
end
......@@ -19,6 +19,11 @@ end
artoaWorkspace.trajectoryOutput.tableGeneratedTracksSelectedRow = selectedRow;
artoaWorkspace.trajectoryOutput.tableGeneratedTracksSelectedColumn = selectedColumn;
%% Remove lines between soundsources
if isfield(artoaGui.trajectoryOutput, 'linesSoundsources')
cellfun(@delete, artoaGui.trajectoryOutput.linesSoundsources);
end
%% Check for hiding
if selectedColumn == 1
artoaWorkspace.trajectoryOutput.trajectories{selectedRow}.hidden = ...
......@@ -30,10 +35,12 @@ if selectedColumn == 1
artoaGui.trajectoryOutput.trajectoryHandles{selectedRow}, ...
~artoaWorkspace.trajectoryOutput.trajectories{selectedRow}.hidden ...
);
% Plot again
%artoa.controller.track.trajectoryOutput.plot();
else
% Draw lines between soundsources
artoa.controller.track.trajectoryOutput.plotSoundsourceLines();
end
%% Plot residuals
[ ...
artoaGui.trajectoryOutput.residualsHandles, ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment