diff Samples/Common/MeasureCommands.cpp @ 654:462a5074f914

Turned the scene into an observable to be able to dynamically react to scene to canvas transform changes --> now the handles and angle measure adornments are immune to zoom changes
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 14 May 2019 13:51:00 +0200
parents 1e9ed656318e
children
line wrap: on
line diff
--- a/Samples/Common/MeasureCommands.cpp	Tue May 14 13:49:12 2019 +0200
+++ b/Samples/Common/MeasureCommands.cpp	Tue May 14 13:51:00 2019 +0200
@@ -48,9 +48,12 @@
   }
 
   CreateLineMeasureCommand::CreateLineMeasureCommand(
-    Scene2D& scene, MeasureToolList& measureTools, ScenePoint2D point)
+    MessageBroker&    broker, 
+    Scene2D&          scene, 
+    MeasureToolList&  measureTools, 
+    ScenePoint2D      point)
     : CreateMeasureCommand(scene, measureTools)
-    , measureTool_(new LineMeasureTool(scene))
+    , measureTool_(new LineMeasureTool(broker,scene))
   {
     measureTools_.push_back(measureTool_);
     measureTool_->Set(point, point);
@@ -62,9 +65,12 @@
   }
 
   CreateAngleMeasureCommand::CreateAngleMeasureCommand(
-    Scene2D& scene, MeasureToolList& measureTools, ScenePoint2D point)
+    MessageBroker&    broker, 
+    Scene2D&          scene, 
+    MeasureToolList&  measureTools, 
+    ScenePoint2D      point)
     : CreateMeasureCommand(scene, measureTools)
-    , measureTool_(new AngleMeasureTool(scene))
+    , measureTool_(new AngleMeasureTool(broker,scene))
   {
     measureTools_.push_back(measureTool_);
     measureTool_->SetSide1End(point);