Mercurial > hg > orthanc-stone
diff Framework/Scene2DViewport/ViewportController.cpp @ 1210:644baa70373d broker
removing interactor from the ViewportController members
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Dec 2019 16:13:10 +0100 |
parents | 00e6bff9ea39 |
children | 86a8266b8888 |
line wrap: on
line diff
--- a/Framework/Scene2DViewport/ViewportController.cpp Tue Dec 03 18:51:03 2019 +0100 +++ b/Framework/Scene2DViewport/ViewportController.cpp Wed Dec 04 16:13:10 2019 +0100 @@ -72,20 +72,12 @@ { throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); } - - interactor_.reset(new DefaultViewportInteractor); } ViewportController::~ViewportController() { } - void ViewportController::SetInteractor(boost::shared_ptr<IViewportInteractor> interactor) - { - activeTracker_.reset(); - interactor_ = interactor; - } - void ViewportController::PushCommand(boost::shared_ptr<MeasureCommand> command) { boost::shared_ptr<UndoStack> undoStack = undoStackW_.lock(); @@ -251,7 +243,8 @@ } - void ViewportController::HandleMousePress(const PointerEvent& event) + void ViewportController::HandleMousePress(IViewportInteractor& interactor, + const PointerEvent& event) { if (activeTracker_) { @@ -276,14 +269,7 @@ } // No measure tool, create new tracker from the interactor - if (interactor_) - { - activeTracker_.reset(interactor_->CreateTracker(shared_from_this(), event)); - } - else - { - activeTracker_.reset(); - } + activeTracker_.reset(interactor.CreateTracker(shared_from_this(), event)); } }