Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/AngleMeasureTool.cpp @ 1314:9b126de2cde2 broker
Since the observer system now uses shared_ptr and many registrations are
done in the constructors, and since we cannot called shared_from_this() in
the constructors, it is mandatory to split construction from registration.
This has been done by making many ctors protected and replacing them
by factory methods that directly return shared_ptrs + added PostConstructor
method when base classes perform shared_from_this() calls too.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 16 Mar 2020 11:19:50 +0100 |
parents | 1f877e0846fe |
children | ab81ee8fce1f |
comparison
equal
deleted
inserted
replaced
1313:f30905f5d246 | 1314:9b126de2cde2 |
---|---|
49 #else | 49 #else |
50 , layerHolder_(boost::shared_ptr<LayerHolder>(new LayerHolder(viewport,1,1))) | 50 , layerHolder_(boost::shared_ptr<LayerHolder>(new LayerHolder(viewport,1,1))) |
51 #endif | 51 #endif |
52 , angleHighlightArea_(AngleHighlightArea_None) | 52 , angleHighlightArea_(AngleHighlightArea_None) |
53 { | 53 { |
54 RefreshScene(); | 54 } |
55 | |
56 boost::shared_ptr<AngleMeasureTool> AngleMeasureTool::Create(IViewport& viewport) | |
57 { | |
58 boost::shared_ptr<AngleMeasureTool> obj(new AngleMeasureTool(viewport)); | |
59 obj->MeasureTool::PostConstructor(); | |
60 obj->RefreshScene(); | |
61 return obj; | |
55 } | 62 } |
56 | 63 |
57 AngleMeasureTool::~AngleMeasureTool() | 64 AngleMeasureTool::~AngleMeasureTool() |
58 { | 65 { |
59 // this measuring tool is a RABI for the corresponding visual layers | 66 // this measuring tool is a RABI for the corresponding visual layers |