comparison OrthancStone/Sources/Scene2DViewport/ViewportController.h @ 1684:fb62c1522193

Scene2D must be built first and deleted last!
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 25 Nov 2020 12:16:33 +0100
parents 874e178f34e9
children d4a8e2b19a65
comparison
equal deleted inserted replaced
1683:6594c9709d33 1684:fb62c1522193
231 } 231 }
232 232
233 private: 233 private:
234 double GetCanvasToSceneFactor() const; 234 double GetCanvasToSceneFactor() const;
235 235
236 // The scene can be used by the higher-level objects (including the
237 // measuring tools), possibly in their destructor, and so it must be
238 // deleted last (and, thus, constructed first)
239 std::unique_ptr<Scene2D> scene_;
240
236 boost::weak_ptr<IViewport> viewport_; 241 boost::weak_ptr<IViewport> viewport_;
242
237 boost::weak_ptr<UndoStack> undoStackW_; // Global stack, possibly shared by all viewports 243 boost::weak_ptr<UndoStack> undoStackW_; // Global stack, possibly shared by all viewports
238 std::vector<boost::shared_ptr<MeasureTool> > measureTools_; 244 std::vector<boost::shared_ptr<MeasureTool> > measureTools_;
239 boost::shared_ptr<IFlexiblePointerTracker> activeTracker_; // TODO - Couldn't this be a "std::unique_ptr"? 245 boost::shared_ptr<IFlexiblePointerTracker> activeTracker_; // TODO - Couldn't this be a "std::unique_ptr"?
240 246
241 std::unique_ptr<Scene2D> scene_;
242 247
243 // this is cached 248 // this is cached
244 double canvasToSceneFactor_; 249 double canvasToSceneFactor_;
245 }; 250 };
246 } 251 }