Commit fe1b744f authored by Mark Winter's avatar Mark Winter

Fix for multi-tree selection problem if a cell had just been selected.

parent 111ebb48
...@@ -35,7 +35,8 @@ function ContextAddToExtendedFamily(hullIDs) ...@@ -35,7 +35,8 @@ function ContextAddToExtendedFamily(hullIDs)
if ~isempty(CellFamilies(familyID).extFamily) if ~isempty(CellFamilies(familyID).extFamily)
xfam = CellFamilies(familyID).extFamily; xfam = CellFamilies(familyID).extFamily;
if length(xfam) > 1 if length(xfam) > 1
warn = sprintf('Track %d is already in an extended family', trackID); rootTrackID = CellFamilies(familyID).rootTrackID;
warn = sprintf('Track %d is already in an extended family', rootTrackID);
warndlg(warn); warndlg(warn);
return; return;
end end
...@@ -48,6 +49,10 @@ function ContextAddToExtendedFamily(hullIDs) ...@@ -48,6 +49,10 @@ function ContextAddToExtendedFamily(hullIDs)
newTrackIDLocal = answer{1}; newTrackIDLocal = answer{1};
newTrackID = UI.LocalToTrack(revLocalLabels, newTrackIDLocal); newTrackID = UI.LocalToTrack(revLocalLabels, newTrackIDLocal);
newFamilyID = CellTracks(newTrackID).familyID;
bInExtFamily = ismember(trackIDs,CellFamilies(newFamilyID).tracks);
trackIDs = trackIDs(~bInExtFamily);
if ( isnan(newTrackID) || newTrackID > length(CellTracks) ) if ( isnan(newTrackID) || newTrackID > length(CellTracks) )
warn = sprintf('Track %s does not exist.',newTrackIDLocal); warn = sprintf('Track %s does not exist.',newTrackIDLocal);
...@@ -67,7 +72,6 @@ function ContextAddToExtendedFamily(hullIDs) ...@@ -67,7 +72,6 @@ function ContextAddToExtendedFamily(hullIDs)
return; return;
end end
newFamilyID = CellTracks(newTrackID).familyID;
newExtFamily = union(CellFamilies(newFamilyID).extFamily, [familyIDs newFamilyID]); newExtFamily = union(CellFamilies(newFamilyID).extFamily, [familyIDs newFamilyID]);
[CellFamilies(newExtFamily).extFamily] = deal(newExtFamily); [CellFamilies(newExtFamily).extFamily] = deal(newExtFamily);
......
function AddCellSelection(hullID)
global Figures
bAlreadySelected = (Figures.cells.selectedHulls == hullID);
if ( any(bAlreadySelected) )
return;
end
Figures.cells.selectedHulls = [Figures.cells.selectedHulls hullID];
end
...@@ -54,6 +54,10 @@ function FigureCellDown(src,evnt, labelID) ...@@ -54,6 +54,10 @@ function FigureCellDown(src,evnt, labelID)
else else
Editor.AddHull(2); Editor.AddHull(2);
end end
elseif (strcmp(selectionType,'alt'))
if ( Figures.cells.downHullID > 0 )
UI.AddCellSelection(Figures.cells.downHullID);
end
end end
end end
......
...@@ -50,7 +50,7 @@ Figures.tree.handle = figure(); ...@@ -50,7 +50,7 @@ Figures.tree.handle = figure();
Figures.cells.selectedHulls = []; Figures.cells.selectedHulls = [];
Figures.controlDown = false; %control key is currently down? for selecting cells and fine adjustment Figures.controlDown = false; %control key is currently down? for selecting cells and fine adjustment
Figures.downHullID = -1; Figures.cells.downHullID = -1;
Figures.downClickPoint = [0 0]; Figures.downClickPoint = [0 0];
whitebg(Figures.cells.handle,'k'); whitebg(Figures.cells.handle,'k');
......
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