Files
qt5-legatus-legacy/Lts/Viewer/SituationMap/Rubberbands/rubberband_internal.cpp
T
2026-08-13 18:33:10 +02:00

99 lines
2.5 KiB
C++
Executable File

/**
**
** @RDE_HEADER@
** Definition of internal data of base class for rubberbands
** $Id$
** $HeadURL$
** $Author$
**
** -----------------------------------------------------------------------------------------------
**
** Hardware-Environment: Intel-PC
** Software-Environment: Windows 7, Qt 5.4. ArcGIS 10.2.5
**
** Language ........: C++ 11
**
** -----------------------------------------------------------------------------------------------
**
** Author ...........: Joerg Turla, SPD G, Tel. 3132
**
** -----------------------------------------------------------------------------------------------
**
** Notes .........:
**
** 16.06.2015, JT : First edition for use with Qt5
**
** -----------------------------------------------------------------------------------------------
*/
#include "rubberband_internal.h"
#include "rubberband.h"
#include "rubberband_drawable.h"
#include "rubberband_handle.h"
#include "rubberband_handle_proxy.h"
#include <Map/map.h>
#include <MapImpl/map_impl.h>
namespace SituationMap { namespace RB
{
Rubberband::InternalData::InternalData( SituationMap::Map * map )
: _mapView(nullptr)
, _mapScene(nullptr)
, _handleList()
, _constructionObjectDraw(nullptr)
, _connectedPreviewPixmap(nullptr)
, _lastClickPosition(-1,-1)
, _constrainFailedMarker(nullptr)
, _logger(getLogger("Rubberband"))
{
SituationMap::MapImpl * mapImpl = dynamic_cast<SituationMap::MapImpl*>(map);
if (mapImpl)
{
_mapView = mapImpl -> getEsriMapGraphicsView();
if (_mapView != nullptr)
{
_mapScene = _mapView -> scene();
}
}
} /* InternalData */
Rubberband::InternalData::~InternalData()
{
/* Because of using shared RefPointer we don't need to call delete for every handle,
* just clear the handle-list.
for (auto handle : _handleList)
{
handle = nullptr;;
}
*/
_handleList.clear();
delete _constructionObjectDraw;
_constructionObjectDraw = nullptr;
if (_mapScene)
{
if (nullptr != _connectedPreviewPixmap)
{
_mapScene->removeItem( _connectedPreviewPixmap );
delete _connectedPreviewPixmap;
_connectedPreviewPixmap = nullptr;
}
delete _constrainFailedMarker;
}
_mapView = nullptr;
_mapScene = nullptr;
} /* ~InternalData */
} } /* namespace SituationMap::RB */