comparison Framework/Scene2DViewport/ViewportController.h @ 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
comparison
equal deleted inserted replaced
1208:00e6bff9ea39 1210:644baa70373d
107 ViewportController(boost::weak_ptr<UndoStack> undoStackW, 107 ViewportController(boost::weak_ptr<UndoStack> undoStackW,
108 boost::shared_ptr<IViewport> viewport); 108 boost::shared_ptr<IViewport> viewport);
109 109
110 ~ViewportController(); 110 ~ViewportController();
111 111
112 void SetInteractor(boost::shared_ptr<IViewportInteractor> interactor);
113
114 /** 112 /**
115 This method returns the list of measure tools containing the supplied point 113 This method returns the list of measure tools containing the supplied point
116 (in scene coords). A tracker can then be requested from the chosen 114 (in scene coords). A tracker can then be requested from the chosen
117 measure tool, if needed 115 measure tool, if needed
118 */ 116 */
195 return *viewport_; 193 return *viewport_;
196 } 194 }
197 195
198 196
199 // Must be expressed in canvas coordinates 197 // Must be expressed in canvas coordinates
200 void HandleMousePress(const PointerEvent& event); 198 void HandleMousePress(IViewportInteractor& interactor,
199 const PointerEvent& event);
201 200
202 // Must be expressed in canvas coordinates 201 // Must be expressed in canvas coordinates
203 void HandleMouseMove(const PointerEvent& event); 202 void HandleMouseMove(const PointerEvent& event);
204 203
205 // Must be expressed in canvas coordinates 204 // Must be expressed in canvas coordinates
208 private: 207 private:
209 double GetCanvasToSceneFactor() const; 208 double GetCanvasToSceneFactor() const;
210 209
211 boost::weak_ptr<UndoStack> undoStackW_; // Global stack, possibly shared by all viewports 210 boost::weak_ptr<UndoStack> undoStackW_; // Global stack, possibly shared by all viewports
212 boost::shared_ptr<IViewport> viewport_; 211 boost::shared_ptr<IViewport> viewport_;
213 boost::shared_ptr<IViewportInteractor> interactor_; // Application-specific factory of trackers
214 std::vector<boost::shared_ptr<MeasureTool> > measureTools_; 212 std::vector<boost::shared_ptr<MeasureTool> > measureTools_;
215 boost::shared_ptr<IFlexiblePointerTracker> activeTracker_; // TODO - Can't this be a "std::auto_ptr"? 213 boost::shared_ptr<IFlexiblePointerTracker> activeTracker_; // TODO - Can't this be a "std::auto_ptr"?
216 214
217 // this is cached 215 // this is cached
218 double canvasToSceneFactor_; 216 double canvasToSceneFactor_;