From f0721389864b5d9e0c6a8ef42d8b030c3772aa6a Mon Sep 17 00:00:00 2001 From: Samuel Pantze <83579186+smlpt@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:01:50 +0200 Subject: [PATCH] Use lazylogger instead of Logservice --- .../iview/commands/demo/advanced/CellTrackingBase.kt | 10 +++++++++- .../sc/iview/commands/demo/advanced/TrackingTest.kt | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/sc/iview/commands/demo/advanced/CellTrackingBase.kt b/src/main/kotlin/sc/iview/commands/demo/advanced/CellTrackingBase.kt index 93871111..694bf2a6 100644 --- a/src/main/kotlin/sc/iview/commands/demo/advanced/CellTrackingBase.kt +++ b/src/main/kotlin/sc/iview/commands/demo/advanced/CellTrackingBase.kt @@ -8,6 +8,7 @@ import graphics.scenery.primitives.Cylinder import graphics.scenery.utils.MaybeIntersects import graphics.scenery.utils.SystemHelpers import graphics.scenery.utils.extensions.minus +import graphics.scenery.utils.lazyLogger import graphics.scenery.volumes.RAIVolume import graphics.scenery.volumes.Volume import org.joml.Math @@ -27,7 +28,7 @@ import kotlin.concurrent.thread open class CellTrackingBase( open var sciview: SciView ) { - lateinit var logger: LogService + val logger by lazyLogger() lateinit var sessionId: String lateinit var sessionDirectory: Path @@ -49,6 +50,7 @@ open class CellTrackingBase( var volumeScaleFactor = 1.0f + // determines whether the volume and hedgehogs should keep listening for updates or not var cellTrackingActive: Boolean = false open var linkCreationCallback: ((HedgehogAnalysis.SpineGraphVertex) -> Unit)? = null @@ -62,6 +64,12 @@ open class CellTrackingBase( Backward } + init { + logger.info("we constructed celltrackingbase now. Lets toggle VR") + sciview.toggleVRRendering() + logger.info("yeah we toggled vr alright") + } + fun addHedgehog() { logger.info("added hedgehog") val hedgehog = Cylinder(0.005f, 1.0f, 16) diff --git a/src/main/kotlin/sc/iview/commands/demo/advanced/TrackingTest.kt b/src/main/kotlin/sc/iview/commands/demo/advanced/TrackingTest.kt index 0fc0a445..4d93f8e7 100644 --- a/src/main/kotlin/sc/iview/commands/demo/advanced/TrackingTest.kt +++ b/src/main/kotlin/sc/iview/commands/demo/advanced/TrackingTest.kt @@ -283,8 +283,8 @@ class TrackingTest( ) val count = samples.filterNotNull().count { it > 0.002f } - logger.info("count of samples: "+ count.toString()) - logger.info(samples) + logger.info("count of samples: $count") + logger.info(samples.joinToString { ", " }) // spine.metadata["spine"] = metadata // spine.instancedProperties["ModelMatrix"] = { spine.spatial().world }