Mercurial > hg > orthanc-stone
changeset 2357:7d2877f8e978 refactoring tip
reimplement missing methods
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Wed, 07 Oct 2026 09:23:35 +0200 |
| parents | 2ffbba6497f0 |
| children | |
| files | OrthancStone/Sources/Scene2DViewport/ViewportController.cpp OrthancStone/Sources/Scene2DViewport/ViewportController.h |
| diffstat | 2 files changed, 32 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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<IViewport> sharedViewport(viewport_.lock());
--- 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> 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 */
