# HG changeset patch # User Sebastien Jodogne # Date 1791480500 -7200 # Node ID 7b815ead4e7d767807784f962878d5a2898fb9fb # Parent f510260c4ffaa3fbfe3da9ce807e80277b1d93c0 removed useless files diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake --- a/OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake Thu Oct 08 19:26:55 2026 +0200 +++ b/OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake Thu Oct 08 19:28:20 2026 +0200 @@ -321,11 +321,6 @@ ${ORTHANC_STONE_ROOT}/Scene2DViewport/AngleMeasureTool.cpp ${ORTHANC_STONE_ROOT}/Scene2DViewport/BaseFlexiblePointerTracker.cpp - #${ORTHANC_STONE_ROOT}/Scene2DViewport/CreateAngleMeasureCommand.cpp - #${ORTHANC_STONE_ROOT}/Scene2DViewport/CreateAngleMeasureTracker.cpp - #${ORTHANC_STONE_ROOT}/Scene2DViewport/CreateMeasureTracker.cpp - ${ORTHANC_STONE_ROOT}/Scene2DViewport/EditAngleMeasureCommand.cpp - ${ORTHANC_STONE_ROOT}/Scene2DViewport/EditAngleMeasureTracker.cpp ${ORTHANC_STONE_ROOT}/Scene2DViewport/LayerHolder.cpp ${ORTHANC_STONE_ROOT}/Scene2DViewport/LineMeasureTool.cpp ${ORTHANC_STONE_ROOT}/Scene2DViewport/MeasureCommands.cpp diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureCommand.cpp --- a/OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureCommand.cpp Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#include "CreateAngleMeasureCommand.h" - -#include -#include - -namespace OrthancStone -{ - CreateAngleMeasureCommand::CreateAngleMeasureCommand( - boost::weak_ptr viewport, - ScenePoint2D point) - : CreateMeasureCommand(viewport) - , measureTool_(AngleMeasureTool::Create(viewport)) - { - - std::unique_ptr lock(GetViewportLock()); - ViewportController& controller = lock->GetController(); - - controller.AddMeasureTool(measureTool_); - measureTool_->SetSide1End(point); - measureTool_->SetCenter(point); - measureTool_->SetSide2End(point); - } - - /** This method sets center*/ - void CreateAngleMeasureCommand::SetCenter(ScenePoint2D scenePos) - { - measureTool_->SetCenter(scenePos); - } - - /** This method sets end of side 2*/ - void CreateAngleMeasureCommand::SetSide2End(ScenePoint2D scenePos) - { - measureTool_->SetSide2End(scenePos); - } -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureCommand.h --- a/OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureCommand.h Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ -#pragma once - -#include "MeasureCommands.h" - -namespace OrthancStone -{ - class CreateAngleMeasureCommand : public CreateMeasureCommand - { - public: - /** Ctor sets end of side 1*/ - CreateAngleMeasureCommand( - boost::weak_ptr viewport, - ScenePoint2D point); - - /** This method sets center*/ - void SetCenter(ScenePoint2D scenePos); - - /** This method sets end of side 2*/ - void SetSide2End(ScenePoint2D scenePos); - - private: - virtual boost::shared_ptr GetMeasureTool() ORTHANC_OVERRIDE - { - return measureTool_; - } - - boost::shared_ptr measureTool_; - }; -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureTracker.cpp --- a/OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureTracker.cpp Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#include "CreateAngleMeasureTracker.h" -#include "CreateAngleMeasureCommand.h" - -#include - -namespace OrthancStone -{ - CreateAngleMeasureTracker::CreateAngleMeasureTracker(boost::weak_ptr viewport, - const PointerEvent& e) : - CreateMeasureTracker(viewport), - state_(CreatingSide1) - { - ScenePoint2D point; - - { - std::unique_ptr lock(GetViewportLock()); - const Scene2D& scene = lock->GetController().GetScene(); - point = e.GetMainPosition().Apply(scene.GetCanvasToSceneTransform()); - } - - command_.reset(new CreateAngleMeasureCommand(viewport, point)); - } - - CreateAngleMeasureTracker::~CreateAngleMeasureTracker() - { - } - - bool CreateAngleMeasureTracker::PointerMove(const PointerEvent& event, - Scene2D& scene) - { - if (!alive_) - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, - "Internal error: wrong state in CreateAngleMeasureTracker::" - "PointerMove: active_ == false"); - } - - - { - std::unique_ptr lock(GetViewportLock()); - ViewportController& controller = lock->GetController(); - - ScenePoint2D scenePos = event.GetMainPosition().Apply( - controller.GetScene().GetCanvasToSceneTransform()); - - switch (state_) - { - case CreatingSide1: - GetCommand()->SetCenter(scenePos); - break; - case CreatingSide2: - GetCommand()->SetSide2End(scenePos); - break; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, - "Wrong state in CreateAngleMeasureTracker::" - "PointerMove: state_ invalid"); - } - //LOG(TRACE) << "scenePos.GetX() = " << scenePos.GetX() << " " << - // "scenePos.GetY() = " << scenePos.GetY(); - lock->Invalidate(); - return true; - } - } - - void CreateAngleMeasureTracker::PointerUp(const PointerEvent& e, - Scene2D& scene) - { - // TODO: the current app does not prevent multiple PointerDown AND - // PointerUp to be sent to the tracker. - // Unless we augment the PointerEvent structure with the button index, - // we cannot really tell if this pointer up event matches the initial - // pointer down event. Let's make it simple for now. - - switch (state_) - { - case CreatingSide1: - state_ = CreatingSide2; - break; - case CreatingSide2: - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, - "Wrong state in CreateAngleMeasureTracker::" - "PointerUp: state_ == CreatingSide2 ; this should not happen"); - break; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, - "Wrong state in CreateAngleMeasureTracker::" - "PointerMove: state_ invalid"); - } - } - - void CreateAngleMeasureTracker::PointerDown(const PointerEvent& e, - Scene2D& scene) - { - switch (state_) - { - case CreatingSide1: - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, - "Wrong state in CreateAngleMeasureTracker::" - "PointerDown: state_ == CreatingSide1 ; this should not happen"); - break; - case CreatingSide2: - // we are done - alive_ = false; - break; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, - "Wrong state in CreateAngleMeasureTracker::" - "PointerMove: state_ invalid"); - } - } - - boost::shared_ptr CreateAngleMeasureTracker::GetCommand() - { - return boost::dynamic_pointer_cast(command_); - } - -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureTracker.h --- a/OrthancStone/Sources/Scene2DViewport/CreateAngleMeasureTracker.h Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#pragma once - -#include "CreateAngleMeasureCommand.h" -#include "MeasureTrackers.h" -#include "MeasureCommands.h" - - -namespace OrthancStone -{ - class CreateAngleMeasureTracker : public CreateMeasureTracker - { - public: - /** - When you create this tracker, you need to supply it with the undo stack - where it will store the commands that perform the actual measure tool - creation and modification. - In turn, a container for these commands to store the actual measuring - must be supplied, too - */ - CreateAngleMeasureTracker( - boost::weak_ptr viewport, - const PointerEvent& e); - - ~CreateAngleMeasureTracker(); - - virtual bool PointerMove(const PointerEvent& e, - Scene2D& scene) ORTHANC_OVERRIDE; - - virtual void PointerUp(const PointerEvent& e, - Scene2D& scene) ORTHANC_OVERRIDE; - - virtual void PointerDown(const PointerEvent& e, - Scene2D& scene) ORTHANC_OVERRIDE; - - private: - boost::shared_ptr GetCommand(); - - enum State - { - CreatingSide1, - CreatingSide2, - Finished // just for debug - }; - State state_; - - }; -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/CreateMeasureTracker.cpp --- a/OrthancStone/Sources/Scene2DViewport/CreateMeasureTracker.cpp Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/CreateMeasureTracker.h --- a/OrthancStone/Sources/Scene2DViewport/CreateMeasureTracker.h Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#pragma once - diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/EditAngleMeasureCommand.cpp --- a/OrthancStone/Sources/Scene2DViewport/EditAngleMeasureCommand.cpp Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#include "EditAngleMeasureCommand.h" - -namespace OrthancStone -{ - EditAngleMeasureCommand::EditAngleMeasureCommand(const boost::shared_ptr& measureTool, - boost::weak_ptr viewport) : - EditMeasureCommand(measureTool, viewport) - { - } - - void EditAngleMeasureCommand::SetCenter(ScenePoint2D scenePos) - { - dynamic_cast(GetMeasureTool()).SetCenter(scenePos); - SetMementoModified(GetMeasureTool().CreateMemento()); - } - - - void EditAngleMeasureCommand::SetSide1End(ScenePoint2D scenePos) - { - dynamic_cast(GetMeasureTool()).SetSide1End(scenePos); - SetMementoModified(GetMeasureTool().CreateMemento()); - } - - - void EditAngleMeasureCommand::SetSide2End(ScenePoint2D scenePos) - { - dynamic_cast(GetMeasureTool()).SetSide2End(scenePos); - SetMementoModified(GetMeasureTool().CreateMemento()); - } -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/EditAngleMeasureCommand.h --- a/OrthancStone/Sources/Scene2DViewport/EditAngleMeasureCommand.h Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ -#pragma once - -#include "MeasureCommands.h" - -namespace OrthancStone -{ - class EditAngleMeasureCommand : public EditMeasureCommand - { - public: - /** Ctor sets end of side 1*/ - EditAngleMeasureCommand(const boost::shared_ptr& measureTool, - boost::weak_ptr viewport); - - /** This method sets center*/ - void SetCenter(ScenePoint2D scenePos); - - /** This method sets end of side 1*/ - void SetSide1End(ScenePoint2D scenePos); - - /** This method sets end of side 2*/ - void SetSide2End(ScenePoint2D scenePos); - }; -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/EditAngleMeasureTracker.cpp --- a/OrthancStone/Sources/Scene2DViewport/EditAngleMeasureTracker.cpp Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#include "EditAngleMeasureTracker.h" -#include "EditAngleMeasureCommand.h" - -#include "../StoneException.h" - -namespace OrthancStone -{ - EditAngleMeasureTracker::EditAngleMeasureTracker( - boost::shared_ptr measureTool, - boost::weak_ptr viewport, - const PointerEvent& e) - : EditMeasureTracker(viewport, e) - { - ScenePoint2D scenePos; - - { - std::unique_ptr lock(GetViewportLock()); - ViewportController& controller = lock->GetController(); - scenePos = e.GetMainPosition().Apply(controller.GetScene().GetCanvasToSceneTransform()); - } - - modifiedZone_ = dynamic_cast(*measureTool).AngleHitTest(scenePos); - command_.reset(new EditAngleMeasureCommand(measureTool, viewport)); - } - - EditAngleMeasureTracker::~EditAngleMeasureTracker() - { - - } - - bool EditAngleMeasureTracker::PointerMove(const PointerEvent& e, - Scene2D& scene) - { - std::unique_ptr lock(GetViewportLock()); - - ViewportController& controller = lock->GetController(); - const Scene2D& scene2 = controller.GetScene(); - - ScenePoint2D scenePos = e.GetMainPosition().Apply( - scene2.GetCanvasToSceneTransform()); - - ScenePoint2D delta = scenePos - GetOriginalClickPosition(); - - const AngleMeasureTool::Memento& memento = - dynamic_cast(command_->GetMementoOriginal()); - - switch (modifiedZone_) - { - case AngleMeasureTool::AngleHighlightArea_Center: - { - ScenePoint2D newCenter = memento.GetCenter() + delta; - GetCommand()->SetCenter(newCenter); - break; - } - - case AngleMeasureTool::AngleHighlightArea_Side1: - case AngleMeasureTool::AngleHighlightArea_Side2: - { - ScenePoint2D newCenter = memento.GetCenter() + delta; - ScenePoint2D newSide1End = memento.GetSide1End() + delta; - ScenePoint2D newSide2End = memento.GetSide2End() + delta; - GetCommand()->SetCenter(newCenter); - GetCommand()->SetSide1End(newSide1End); - GetCommand()->SetSide2End(newSide2End); - break; - } - - case AngleMeasureTool::AngleHighlightArea_Side1End: - { - ScenePoint2D newSide1End = memento.GetSide1End() + delta; - GetCommand()->SetSide1End(newSide1End); - break; - } - - case AngleMeasureTool::AngleHighlightArea_Side2End: - { - ScenePoint2D newSide2End = memento.GetSide2End() + delta; - GetCommand()->SetSide2End(newSide2End); - break; - } - - default: - LOG(WARNING) << "Warning: please retry the measuring tool editing operation!"; - break; - } - - return true; - } - - void EditAngleMeasureTracker::PointerUp(const PointerEvent& e, - Scene2D& scene) - { - alive_ = false; - } - - void EditAngleMeasureTracker::PointerDown(const PointerEvent& e, - Scene2D& scene) - { - LOG(WARNING) << "Additional touches (fingers, pen, mouse buttons...) " - "are ignored when the edit angle tracker is active"; - } - - boost::shared_ptr EditAngleMeasureTracker::GetCommand() - { - boost::shared_ptr ret = boost::dynamic_pointer_cast(command_); - ORTHANC_ASSERT(ret.get() != NULL, "Internal error in EditAngleMeasureTracker::GetCommand()"); - return ret; - } -} diff -r f510260c4ffa -r 7b815ead4e7d OrthancStone/Sources/Scene2DViewport/EditAngleMeasureTracker.h --- a/OrthancStone/Sources/Scene2DViewport/EditAngleMeasureTracker.h Thu Oct 08 19:26:55 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/** - * Stone of Orthanc - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - **/ - -#pragma once - -#include "MeasureTrackers.h" - -namespace OrthancStone -{ - class EditAngleMeasureCommand; - - class EditAngleMeasureTracker : public EditMeasureTracker - { - public: - /** - When you create this tracker, you need to supply it with the undo stack - where it will store the commands that perform the actual measure tool - creation and modification. - In turn, a container for these commands to store the actual measuring - must be supplied, too - */ - EditAngleMeasureTracker( - boost::shared_ptr measureTool, - boost::weak_ptr viewport, - const PointerEvent& e); - - ~EditAngleMeasureTracker(); - - virtual bool PointerMove(const PointerEvent& e, - Scene2D& scene) ORTHANC_OVERRIDE; - - virtual void PointerUp(const PointerEvent& e, - Scene2D& scene) ORTHANC_OVERRIDE; - - virtual void PointerDown(const PointerEvent& e, - Scene2D& scene) ORTHANC_OVERRIDE; - - private: - AngleMeasureTool::AngleHighlightArea modifiedZone_; - - boost::shared_ptr GetCommand(); - }; -}