From ec52a0c86c64276b27ce51aace4d352a89d36958 Mon Sep 17 00:00:00 2001 From: kradchen Date: Mon, 7 Jul 2025 10:16:57 +0800 Subject: [PATCH] fix: fix measure terminate can't stop placing measure bug --- src/src/Rendering/Measure/Measure.cpp | 5 +++++ src/src/Rendering/Measure/Measure.h | 2 +- src/src/Rendering/Measure/OpenPolyAnnotationActor.cpp | 4 ---- src/src/Rendering/Measure/OpenPolyAnnotationActor.h | 2 -- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/src/Rendering/Measure/Measure.cpp b/src/src/Rendering/Measure/Measure.cpp index 0454df4..4ba5476 100644 --- a/src/src/Rendering/Measure/Measure.cpp +++ b/src/src/Rendering/Measure/Measure.cpp @@ -12,3 +12,8 @@ void Measure::SetPlacing(bool p) this->Placing = p; MeasureHelper::measuring = Placing; } + +void Measure::onTerminate(vtkRenderWindowInteractor *){ + this->Placing = false; + MeasureHelper::measuring = Placing; +} diff --git a/src/src/Rendering/Measure/Measure.h b/src/src/Rendering/Measure/Measure.h index 7227c32..d5a3dfb 100644 --- a/src/src/Rendering/Measure/Measure.h +++ b/src/src/Rendering/Measure/Measure.h @@ -33,7 +33,7 @@ public: virtual bool onMeasureLeftButtonUp(vtkRenderWindowInteractor *) { return false; }; //not used - virtual void onTerminate(vtkRenderWindowInteractor *) {}; + virtual void onTerminate(vtkRenderWindowInteractor *); bool isMeasurePlacing() { return this->Placing; diff --git a/src/src/Rendering/Measure/OpenPolyAnnotationActor.cpp b/src/src/Rendering/Measure/OpenPolyAnnotationActor.cpp index 0a19124..a0d3b6b 100644 --- a/src/src/Rendering/Measure/OpenPolyAnnotationActor.cpp +++ b/src/src/Rendering/Measure/OpenPolyAnnotationActor.cpp @@ -225,7 +225,3 @@ void OpenPolyAnnotationActor::UpdatePerimeterAndAreaText() bool OpenPolyAnnotationActor::Valid() { return Closed == 0 ? BaseDataPoints->GetNumberOfPoints() > 1 : BaseDataPoints->GetNumberOfPoints() > 2; } - -void OpenPolyAnnotationActor::onTerminate(vtkRenderWindowInteractor *){ - -} diff --git a/src/src/Rendering/Measure/OpenPolyAnnotationActor.h b/src/src/Rendering/Measure/OpenPolyAnnotationActor.h index daaa0c3..6d5cc88 100644 --- a/src/src/Rendering/Measure/OpenPolyAnnotationActor.h +++ b/src/src/Rendering/Measure/OpenPolyAnnotationActor.h @@ -38,8 +38,6 @@ public: bool onMeasureLeftButtonUp(vtkRenderWindowInteractor *) override; - void onTerminate(vtkRenderWindowInteractor *) override; - Measure *GetNextMeasure() override { auto m = OpenPolyAnnotationActor::New();