Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/CreateAngleMeasureTracker.cpp @ 738:8e31b174ab26
removing using namespace
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 22 May 2019 08:54:38 +0200 |
parents | 28b9e3a54200 |
children | e42b491f1fb2 |
comparison
equal
deleted
inserted
replaced
737:4d69256d2a46 | 738:8e31b174ab26 |
---|---|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 #include "CreateAngleMeasureTracker.h" | 21 #include "CreateAngleMeasureTracker.h" |
22 #include <Core/OrthancException.h> | 22 #include <Core/OrthancException.h> |
23 | |
24 using namespace Orthanc; | |
25 | 23 |
26 namespace OrthancStone | 24 namespace OrthancStone |
27 { | 25 { |
28 CreateAngleMeasureTracker::CreateAngleMeasureTracker( | 26 CreateAngleMeasureTracker::CreateAngleMeasureTracker( |
29 MessageBroker& broker, | 27 MessageBroker& broker, |
47 { | 45 { |
48 assert(GetScene()); | 46 assert(GetScene()); |
49 | 47 |
50 if (!alive_) | 48 if (!alive_) |
51 { | 49 { |
52 throw OrthancException(ErrorCode_InternalError, | 50 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
53 "Internal error: wrong state in CreateAngleMeasureTracker::" | 51 "Internal error: wrong state in CreateAngleMeasureTracker::" |
54 "PointerMove: active_ == false"); | 52 "PointerMove: active_ == false"); |
55 } | 53 } |
56 | 54 |
57 ScenePoint2D scenePos = event.GetMainPosition().Apply( | 55 ScenePoint2D scenePos = event.GetMainPosition().Apply( |
64 break; | 62 break; |
65 case CreatingSide2: | 63 case CreatingSide2: |
66 GetCommand()->SetSide2End(scenePos); | 64 GetCommand()->SetSide2End(scenePos); |
67 break; | 65 break; |
68 default: | 66 default: |
69 throw OrthancException(ErrorCode_InternalError, | 67 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
70 "Wrong state in CreateAngleMeasureTracker::" | 68 "Wrong state in CreateAngleMeasureTracker::" |
71 "PointerMove: state_ invalid"); | 69 "PointerMove: state_ invalid"); |
72 } | 70 } |
73 //LOG(TRACE) << "scenePos.GetX() = " << scenePos.GetX() << " " << | 71 //LOG(TRACE) << "scenePos.GetX() = " << scenePos.GetX() << " " << |
74 // "scenePos.GetY() = " << scenePos.GetY(); | 72 // "scenePos.GetY() = " << scenePos.GetY(); |
86 { | 84 { |
87 case CreatingSide1: | 85 case CreatingSide1: |
88 state_ = CreatingSide2; | 86 state_ = CreatingSide2; |
89 break; | 87 break; |
90 case CreatingSide2: | 88 case CreatingSide2: |
91 throw OrthancException(ErrorCode_InternalError, | 89 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
92 "Wrong state in CreateAngleMeasureTracker::" | 90 "Wrong state in CreateAngleMeasureTracker::" |
93 "PointerUp: state_ == CreatingSide2 ; this should not happen"); | 91 "PointerUp: state_ == CreatingSide2 ; this should not happen"); |
94 break; | 92 break; |
95 default: | 93 default: |
96 throw OrthancException(ErrorCode_InternalError, | 94 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
97 "Wrong state in CreateAngleMeasureTracker::" | 95 "Wrong state in CreateAngleMeasureTracker::" |
98 "PointerMove: state_ invalid"); | 96 "PointerMove: state_ invalid"); |
99 } | 97 } |
100 } | 98 } |
101 | 99 |
102 void CreateAngleMeasureTracker::PointerDown(const PointerEvent& e) | 100 void CreateAngleMeasureTracker::PointerDown(const PointerEvent& e) |
103 { | 101 { |
104 switch (state_) | 102 switch (state_) |
105 { | 103 { |
106 case CreatingSide1: | 104 case CreatingSide1: |
107 throw OrthancException(ErrorCode_InternalError, | 105 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
108 "Wrong state in CreateAngleMeasureTracker::" | 106 "Wrong state in CreateAngleMeasureTracker::" |
109 "PointerDown: state_ == CreatingSide1 ; this should not happen"); | 107 "PointerDown: state_ == CreatingSide1 ; this should not happen"); |
110 break; | 108 break; |
111 case CreatingSide2: | 109 case CreatingSide2: |
112 // we are done | 110 // we are done |
113 alive_ = false; | 111 alive_ = false; |
114 break; | 112 break; |
115 default: | 113 default: |
116 throw OrthancException(ErrorCode_InternalError, | 114 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
117 "Wrong state in CreateAngleMeasureTracker::" | 115 "Wrong state in CreateAngleMeasureTracker::" |
118 "PointerMove: state_ invalid"); | 116 "PointerMove: state_ invalid"); |
119 } | 117 } |
120 } | 118 } |
121 | 119 |