comparison OrthancStone/Sources/Scene2DViewport/CreateLineMeasureTracker.cpp @ 1972:9c0adcc8feec

refactoring to simplify OneGesturePointerTracker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Oct 2022 16:21:28 +0200
parents 7053b8a0aaec
children 07964689cb0b
comparison
equal deleted inserted replaced
1971:e5b31d55206d 1972:9c0adcc8feec
46 CreateLineMeasureTracker::~CreateLineMeasureTracker() 46 CreateLineMeasureTracker::~CreateLineMeasureTracker()
47 { 47 {
48 48
49 } 49 }
50 50
51 void CreateLineMeasureTracker::PointerMove(const PointerEvent& event) 51 void CreateLineMeasureTracker::PointerMove(const PointerEvent& event,
52 const Scene2D& scene)
52 { 53 {
53 if (!alive_) 54 if (!alive_)
54 { 55 {
55 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, 56 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
56 "Internal error: wrong state in CreateLineMeasureTracker::" 57 "Internal error: wrong state in CreateLineMeasureTracker::"
71 assert(concreteThis != NULL);*/ 72 assert(concreteThis != NULL);*/
72 73
73 GetCommand()->SetEnd(scenePos); 74 GetCommand()->SetEnd(scenePos);
74 } 75 }
75 76
76 void CreateLineMeasureTracker::PointerUp(const PointerEvent& e) 77 void CreateLineMeasureTracker::PointerUp(const PointerEvent& e,
78 const Scene2D& scene)
77 { 79 {
78 // TODO: the current app does not prevent multiple PointerDown AND 80 // TODO: the current app does not prevent multiple PointerDown AND
79 // PointerUp to be sent to the tracker. 81 // PointerUp to be sent to the tracker.
80 // Unless we augment the PointerEvent structure with the button index, 82 // Unless we augment the PointerEvent structure with the button index,
81 // we cannot really tell if this pointer up event matches the initial 83 // we cannot really tell if this pointer up event matches the initial
82 // pointer down event. Let's make it simple for now. 84 // pointer down event. Let's make it simple for now.
83 alive_ = false; 85 alive_ = false;
84 } 86 }
85 87
86 void CreateLineMeasureTracker::PointerDown(const PointerEvent& e) 88 void CreateLineMeasureTracker::PointerDown(const PointerEvent& e,
89 const Scene2D& scene)
87 { 90 {
88 LOG(WARNING) << "Additional touches (fingers, pen, mouse buttons...) " 91 LOG(WARNING) << "Additional touches (fingers, pen, mouse buttons...) "
89 "are ignored when the line measure creation tracker is active"; 92 "are ignored when the line measure creation tracker is active";
90 } 93 }
91 94