# HG changeset patch # User Sebastien Jodogne # Date 1791483181 -7200 # Node ID 6de9b26f78116436df176c53cfd64d584072a874 # Parent 3644864d95ad9319e668c28b9b816ef44485c674 fix build on older compilers diff -r 3644864d95ad -r 6de9b26f7811 OrthancStone/Sources/Scene2DViewport/AngleMeasureTool.cpp --- a/OrthancStone/Sources/Scene2DViewport/AngleMeasureTool.cpp Thu Oct 08 19:52:31 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/AngleMeasureTool.cpp Thu Oct 08 20:13:01 2026 +0200 @@ -72,11 +72,13 @@ std::unique_ptr lock(sharedViewport->Lock()); if (isCreation) { - lock->GetController().PushCommand(boost::make_shared(lock->GetController(), boost::dynamic_pointer_cast(tool_))); + boost::shared_ptr command(new CreateMeasureCommand(lock->GetController(), tool_)); + lock->GetController().PushCommand(command); } else { - editCommand_ = boost::make_shared(lock->GetController(), boost::dynamic_pointer_cast(tool_)); + boost::shared_ptr command(new EditMeasureCommand(lock->GetController(), tool_)); + editCommand_ = command; } } } diff -r 3644864d95ad -r 6de9b26f7811 OrthancStone/Sources/Scene2DViewport/LineMeasureTool.cpp --- a/OrthancStone/Sources/Scene2DViewport/LineMeasureTool.cpp Thu Oct 08 19:52:31 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/LineMeasureTool.cpp Thu Oct 08 20:13:01 2026 +0200 @@ -70,11 +70,13 @@ std::unique_ptr lock(sharedViewport->Lock()); if (isCreation) { - lock->GetController().PushCommand(boost::make_shared(lock->GetController(), boost::dynamic_pointer_cast(tool_))); + boost::shared_ptr command(new CreateMeasureCommand(lock->GetController(), tool_)); + lock->GetController().PushCommand(command); } else { - editCommand_ = boost::make_shared(lock->GetController(), boost::dynamic_pointer_cast(tool_)); + boost::shared_ptr command(new EditMeasureCommand(lock->GetController(), tool_)); + editCommand_ = command; } } } diff -r 3644864d95ad -r 6de9b26f7811 OrthancStone/Sources/Scene2DViewport/MeasureTool.cpp --- a/OrthancStone/Sources/Scene2DViewport/MeasureTool.cpp Thu Oct 08 19:52:31 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/MeasureTool.cpp Thu Oct 08 20:13:01 2026 +0200 @@ -20,16 +20,16 @@ * . **/ + #include "MeasureTool.h" +#include "../Viewport/IViewport.h" + #include #include #include #include -#include - -#include "../Viewport/IViewport.h" namespace OrthancStone { diff -r 3644864d95ad -r 6de9b26f7811 OrthancStone/Sources/Scene2DViewport/MeasureToolsToolbox.cpp --- a/OrthancStone/Sources/Scene2DViewport/MeasureToolsToolbox.cpp Thu Oct 08 19:52:31 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/MeasureToolsToolbox.cpp Thu Oct 08 20:13:01 2026 +0200 @@ -21,19 +21,20 @@ **/ #include "MeasureToolsToolbox.h" + +#include "../Scene2D/Scene2D.h" +#include "../Scene2D/TextSceneLayer.h" +#include "../StoneException.h" #include "LayerHolder.h" -#include "ViewportController.h" - -#include "../Scene2D/TextSceneLayer.h" -#include "../Scene2D/Scene2D.h" -#include "../StoneException.h" #include -namespace -{ - double g_pi = boost::math::constants::pi(); -} + +static const double g_pi = boost::math::constants::pi(); +static const uint8_t TEXT_COLOR_RED = 0; +static const uint8_t TEXT_COLOR_GREEN = 223; +static const uint8_t TEXT_COLOR_BLUE = 81; + namespace OrthancStone { diff -r 3644864d95ad -r 6de9b26f7811 OrthancStone/Sources/Scene2DViewport/ViewportController.h --- a/OrthancStone/Sources/Scene2DViewport/ViewportController.h Thu Oct 08 19:52:31 2026 +0200 +++ b/OrthancStone/Sources/Scene2DViewport/ViewportController.h Thu Oct 08 20:13:01 2026 +0200 @@ -44,10 +44,6 @@ const double HANDLE_SIDE_LENGTH_CANVAS_COORD = 10.0; const double HIT_TEST_MAX_DISTANCE_CANVAS_COORD = 15.0; - const uint8_t TEXT_COLOR_RED = 0; - const uint8_t TEXT_COLOR_GREEN = 223; - const uint8_t TEXT_COLOR_BLUE = 81; - const uint8_t TOOL_ANGLE_LINES_COLOR_RED = 0; const uint8_t TOOL_ANGLE_LINES_COLOR_GREEN = 183; const uint8_t TOOL_ANGLE_LINES_COLOR_BLUE = 17;