comparison Framework/Scene2DViewport/ViewportController.cpp @ 818:e42b491f1fb2

Removed typedefs to shared_ptr by making them explicit. Removed using namespace directives to make usage more explicit, too.
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 29 May 2019 10:51:28 +0200
parents 66ac7a2d1e3a
children 2b245953b44b
comparison
equal deleted inserted replaced
817:68f888812af4 818:e42b491f1fb2
33 , canvasToSceneFactor_(0.0) 33 , canvasToSceneFactor_(0.0)
34 { 34 {
35 scene_ = boost::make_shared<Scene2D>(); 35 scene_ = boost::make_shared<Scene2D>();
36 } 36 }
37 37
38 Scene2DConstPtr ViewportController::GetScene() const 38 boost::shared_ptr<const Scene2D> ViewportController::GetScene() const
39 { 39 {
40 return scene_; 40 return scene_;
41 } 41 }
42 42
43 Scene2DPtr ViewportController::GetScene() 43 boost::shared_ptr<Scene2D> ViewportController::GetScene()
44 { 44 {
45 return scene_; 45 return scene_;
46 } 46 }
47 47
48 bool ViewportController::HandlePointerEvent(PointerEvent e) 48 bool ViewportController::HandlePointerEvent(PointerEvent e)
49 { 49 {
50 throw StoneException(ErrorCode_NotImplemented); 50 throw StoneException(ErrorCode_NotImplemented);
51 } 51 }
52 52
53 std::vector<MeasureToolPtr> ViewportController::HitTestMeasureTools( 53 std::vector<boost::shared_ptr<MeasureTool>> ViewportController::HitTestMeasureTools(
54 ScenePoint2D p) 54 ScenePoint2D p)
55 { 55 {
56 std::vector<MeasureToolPtr> ret; 56 std::vector<boost::shared_ptr<MeasureTool>> ret;
57 57
58 for (size_t i = 0; i < measureTools_.size(); ++i) 58 for (size_t i = 0; i < measureTools_.size(); ++i)
59 { 59 {
60 if (measureTools_[i]->HitTest(p)) 60 if (measureTools_[i]->HitTest(p))
61 ret.push_back(measureTools_[i]); 61 ret.push_back(measureTools_[i]);
89 { 89 {
90 scene_->FitContent(canvasWidth, canvasHeight); 90 scene_->FitContent(canvasWidth, canvasHeight);
91 BroadcastMessage(SceneTransformChanged(*this)); 91 BroadcastMessage(SceneTransformChanged(*this));
92 } 92 }
93 93
94 void ViewportController::PushCommand(TrackerCommandPtr command) 94 void ViewportController::PushCommand(boost::shared_ptr<TrackerCommand> command)
95 { 95 {
96 commandStack_.erase( 96 commandStack_.erase(
97 commandStack_.begin() + numAppliedCommands_, 97 commandStack_.begin() + numAppliedCommands_,
98 commandStack_.end()); 98 commandStack_.end());
99 99
125 bool ViewportController::CanRedo() const 125 bool ViewportController::CanRedo() const
126 { 126 {
127 return numAppliedCommands_ < commandStack_.size(); 127 return numAppliedCommands_ < commandStack_.size();
128 } 128 }
129 129
130 void ViewportController::AddMeasureTool(MeasureToolPtr measureTool) 130 void ViewportController::AddMeasureTool(boost::shared_ptr<MeasureTool> measureTool)
131 { 131 {
132 ORTHANC_ASSERT(std::find(measureTools_.begin(), measureTools_.end(), measureTool) 132 ORTHANC_ASSERT(std::find(measureTools_.begin(), measureTools_.end(), measureTool)
133 == measureTools_.end(), "Duplicate measure tool"); 133 == measureTools_.end(), "Duplicate measure tool");
134 measureTools_.push_back(measureTool); 134 measureTools_.push_back(measureTool);
135 } 135 }
136 136
137 void ViewportController::RemoveMeasureTool(MeasureToolPtr measureTool) 137 void ViewportController::RemoveMeasureTool(boost::shared_ptr<MeasureTool> measureTool)
138 { 138 {
139 ORTHANC_ASSERT(std::find(measureTools_.begin(), measureTools_.end(), measureTool) 139 ORTHANC_ASSERT(std::find(measureTools_.begin(), measureTools_.end(), measureTool)
140 != measureTools_.end(), "Measure tool not found"); 140 != measureTools_.end(), "Measure tool not found");
141 measureTools_.erase( 141 measureTools_.erase(
142 std::remove(measureTools_.begin(), measureTools_.end(), measureTool), 142 std::remove(measureTools_.begin(), measureTools_.end(), measureTool),