# HG changeset patch # User Sebastien Jodogne # Date 1791357815 -7200 # Node ID 7d2877f8e978fc58ccb823bd5d4a156659bc3949 # Parent 2ffbba6497f034aee993c1cb1251ec419dae7794 reimplement missing methods diff -r 2ffbba6497f0 -r 7d2877f8e978 OrthancStone/Sources/Scene2DViewport/ViewportController.cpp --- a/OrthancStone/Sources/Scene2DViewport/ViewportController.cpp Wed Oct 07 09:06:23 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/ViewportController.cpp Wed Oct 07 09:23:35 2026 +0200 @@ -168,6 +168,30 @@ } + double ViewportController::GetHandleSideLengthS() const + { + return HANDLE_SIDE_LENGTH_CANVAS_COORD * scene_->GetCanvasToSceneTransform().ComputeZoom(); + } + + + double ViewportController::GetAngleToolArcRadiusS() const + { + return ARC_RADIUS_CANVAS_COORD * scene_->GetCanvasToSceneTransform().ComputeZoom(); + } + + + double ViewportController::GetHitTestMaximumDistanceS() const + { + return HIT_TEST_MAX_DISTANCE_CANVAS_COORD * scene_->GetCanvasToSceneTransform().ComputeZoom(); + } + + + double ViewportController::GetAngleTopTextLabelDistanceS() const + { + return TEXT_CENTER_DISTANCE_CANVAS_COORD * scene_->GetCanvasToSceneTransform().ComputeZoom(); + } + + void ViewportController::InvalidateViewport() { boost::shared_ptr sharedViewport(viewport_.lock()); diff -r 2ffbba6497f0 -r 7d2877f8e978 OrthancStone/Sources/Scene2DViewport/ViewportController.h --- a/OrthancStone/Sources/Scene2DViewport/ViewportController.h Wed Oct 07 09:06:23 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/ViewportController.h Wed Oct 07 09:23:35 2026 +0200 @@ -130,11 +130,15 @@ void RemoveMeasureTool(boost::shared_ptr measureTool); /** + TODO Refactoring - Remove this? + The square handle side length in *scene* coordinates */ double GetHandleSideLengthS() const; /** + TODO Refactoring - Remove this? + The angle measure too arc radius in *scene* coordinates Note: you might wonder why this is not part of the AngleMeasureTool itself, @@ -143,6 +147,8 @@ double GetAngleToolArcRadiusS() const; /** + TODO Refactoring - Remove this? + The hit test maximum distance in *scene* coordinates. If a pointer event is less than GetHandleSideLengthS() to a GUI element, the hit test for this GUI element is seen as true @@ -150,6 +156,8 @@ double GetHitTestMaximumDistanceS() const; /** + TODO Refactoring - Remove this? + Distance between the top of the angle measuring tool and the center of the label showing the actual measure, in *scene* coordinates */