Skip to content
Snippets Groups Projects
Commit b4961381 authored by Mark Winter's avatar Mark Winter
Browse files

GraphEditResetHulls now has options to reset only outgoing or incoming edges.

parent fc346373
Branches
Tags
No related merge requests found
% GraphEditsResetHulls(hulls)
% Resets (zeros) all user edits into and out of a hull, updates associated
% cached costs.
% Resets (zeros) all user edits into (bResetBack) and out of (bResetForward)
% a hull, updates associated cached costs.
function GraphEditsResetHulls(hulls)
function GraphEditsResetHulls(hulls, bResetForward, bResetBack)
global Costs GraphEdits
if ( ~exist('bResetForward','var') )
bResetForward = 1;
end
if ( ~exist('bResetBack','var') )
bResetBack = 1;
end
toHulls = hulls;
fromHulls = hulls;
if ( ~bResetForward && ~bResetBack )
return;
end
for i=1:length(hulls)
toHulls = union(toHulls, find((Costs(hulls(i),:) > 0) | (GraphEdits(hulls(i),:) > 0)));
fromHulls = union(fromHulls, find((Costs(:,hulls(i)) > 0) | (GraphEdits(:,hulls(i)) > 0)));
end
if ( bResetForward )
for i=1:length(hulls)
GraphEdits(hulls(i),:) = 0;
GraphEdits(:,hulls(i)) = 0;
end
end
toHulls = union(toHulls, find(Costs(hulls(i),:) > 0));
fromHulls = union(fromHulls, find(Costs(:,hulls(i)) > 0));
if ( bResetBack )
for i=1:length(hulls)
GraphEdits(:,hulls(i)) = 0;
end
end
Tracker.UpdateCachedCosts(fromHulls, toHulls);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment