Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/MeasureTrackers.cpp @ 727:853e30d17cae
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 May 2019 11:45:06 +0200 |
parents | 28b9e3a54200 |
children | 8e31b174ab26 |
comparison
equal
deleted
inserted
replaced
726:4f2416d519b4 | 727:853e30d17cae |
---|---|
24 using namespace Orthanc; | 24 using namespace Orthanc; |
25 | 25 |
26 namespace OrthancStone | 26 namespace OrthancStone |
27 { | 27 { |
28 | 28 |
29 CreateMeasureTracker::CreateMeasureTracker( | 29 CreateMeasureTracker::CreateMeasureTracker(ViewportControllerWPtr controllerW) |
30 ViewportControllerWPtr controllerW, | |
31 std::vector<TrackerCommandPtr>& undoStack, | |
32 std::vector<MeasureToolPtr>& measureTools) | |
33 : controllerW_(controllerW) | 30 : controllerW_(controllerW) |
34 , alive_(true) | 31 , alive_(true) |
35 , undoStack_(undoStack) | |
36 , measureTools_(measureTools) | |
37 , commitResult_(true) | 32 , commitResult_(true) |
38 { | 33 { |
39 } | 34 } |
40 | 35 |
41 void CreateMeasureTracker::Cancel() | 36 void CreateMeasureTracker::Cancel() |
54 // if the tracker completes successfully, we add the command | 49 // if the tracker completes successfully, we add the command |
55 // to the undo stack | 50 // to the undo stack |
56 | 51 |
57 // otherwise, we simply undo it | 52 // otherwise, we simply undo it |
58 if (commitResult_) | 53 if (commitResult_) |
59 undoStack_.push_back(command_); | 54 controllerW_.lock()->PushCommand(command_); |
60 else | 55 else |
61 command_->Undo(); | 56 command_->Undo(); |
62 } | 57 } |
63 | |
64 | 58 |
65 OrthancStone::Scene2DPtr CreateMeasureTracker::GetScene() | 59 OrthancStone::Scene2DPtr CreateMeasureTracker::GetScene() |
66 { | 60 { |
67 return controllerW_.lock()->GetScene(); | 61 return controllerW_.lock()->GetScene(); |
68 } | 62 } |