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

89 lines
2.5 KiB
C++
Executable File

/**
**
** @RDE_HEADER@
** Implementation of preview for tactical symbols
** $Id$
** $HeadURL$
** $Author$
**
** -----------------------------------------------------------------------------------------------
**
** Hardware-Environment: Intel-PC
** Software-Environment: Windows 7, Qt 5.4. ArcGIS 10.2.5
**
** Language ........: C++ 11
**
** -----------------------------------------------------------------------------------------------
**
** Author ...........: Jörg Turla, SPD G, Tel. 3132
**
** -----------------------------------------------------------------------------------------------
**
** Notes .........:
**
** 27.03.2015, JT : First edition for use with Qt5
**
** -----------------------------------------------------------------------------------------------
*/
#include "transient_tactical_symbol.h"
#include <Map/situation_map_types.h>
#include <MapImpl/sidc_symbol_impl.h>
#include <MapImpl/layer_factory_impl.h>
namespace SituationMap { namespace RB
{
TransientTacticalSymbol::TransientTacticalSymbol( MapImpl * mapImpl, const QString & sidc )
{
QString layerIdent;
if (mapImpl)
{
layerIdent = mapImpl->layerFactoryImpl().rubberbandLayer();
}
if (layerIdent.isEmpty())
{
qWarning() << LOGFUNCTION << "not layername found";
}
_tacticalRubberbandObj = new SidcSymbolImpl( sidc, QStringLiteral("TransientTacticalSymbol:sidc=%1").arg(sidc) );
_tacticalRubberbandObj -> init( mapImpl, layerIdent );
//_tacticalRubberbandObj -> setDrawOrder( 2000 );
} /* PreviewTaticalSymbol::PreviewTaticalSymbol */
TransientTacticalSymbol::~TransientTacticalSymbol()
{
delete _tacticalRubberbandObj;
} /* TransientTacticalSymbol::~TransientTacticalSymbol */
void TransientTacticalSymbol::update(const QVector<RubberbandDrawable::RubberbandCoordinate> & coordinateVector)
{
PositionCont controlPoints;
controlPoints.reserve(coordinateVector.size());
for (const RubberbandDrawable::RubberbandCoordinate &pos : coordinateVector)
{
const Esri::ArcGISRuntime::Point & p = pos._mapCoordinate;
controlPoints.append(Point3D(p.x(), p.y(), p.z()));
}
_tacticalRubberbandObj -> setPositionsTranslated( controlPoints );
try
{
_tacticalRubberbandObj -> updateView();
}
catch (...)
{
qWarning() << LOGFUNCTION << "Exception from TacticalAppearance::updateView() catched!!!!";
}
} /* TransientTacticalSymbol::update */
} } /* namespace SituationMap::RB */