Skip to content

Commit 1331e91

Browse files
smlptskalarproduktraum
authored andcommitted
Added reset view button
1 parent 30df45e commit 1331e91

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/kotlin/sc/iview/commands/analysis/CellTrackingBase.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ open class CellTrackingBase(
137137
var deleteGraphCallback: (() -> Unit)? = null
138138
/** Deletes all annotations from this timepoint. */
139139
var deleteTimepointCallback: (() -> Unit)? = null
140+
/** Recenter and set default scaling for volume, then center camera on volume. */
141+
var resetViewCallback: (() -> Unit)? = null
140142

141143
enum class HedgehogVisibility { Hidden, PerTimePoint, Visible }
142144

@@ -229,6 +231,7 @@ open class CellTrackingBase(
229231
inputSetup()
230232

231233
cellTrackingActive = true
234+
rebuildGeometryCallback?.invoke()
232235
launchUpdaterThread()
233236
}
234237

@@ -476,8 +479,15 @@ open class CellTrackingBase(
476479
color = color, pressedColor = pressedColor, touchingColor = touchingColor
477480
)
478481

482+
val resetViewButton = Button(
483+
"Recenter", command = {
484+
resetViewCallback?.invoke()
485+
}, byTouch = true, depressDelay = 250,
486+
color = color, pressedColor = pressedColor, touchingColor = touchingColor
487+
)
488+
479489
val timeControlRow = Row(goToFirstBtn, playSlowerBtn, togglePlaybackDirBtn, playFasterBtn, goToLastBtn)
480-
val undoRedoRow = Row(undoButton, redoButton)
490+
val undoRedoRow = Row(undoButton, redoButton, resetViewButton)
481491
generalMenu = createWristMenuColumn(timeControlRow, undoRedoRow, name = "Left Undo Menu")
482492
generalMenu?.visible = false
483493

@@ -1106,6 +1116,7 @@ open class CellTrackingBase(
11061116

11071117
sciview.toggleVRRendering()
11081118
logger.info("Shut down and disabled VR environment.")
1119+
rebuildGeometryCallback?.invoke()
11091120
}
11101121

11111122
}

0 commit comments

Comments
 (0)