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

82 lines
2.4 KiB
Objective-C
Executable File

/**
**
** @RDE_HEADER@
** Definition of base class for rubberband handles
** $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
**
** -----------------------------------------------------------------------------------------------
*/
#pragma once
#include <QtCore/QPointF>
#include <QtGui/QPen>
#include "rubberband_handle.h"
class QGraphicsItem;
class QGraphicsScene;
namespace SituationMap { namespace RB
{
/**
@class RubberbandLineHandle rubberband_line_handle.h
@brief Implementation of a line handle for rubberband internal use.
@see RubberbandHandle
*/
class RubberbandLineHandle : public RubberbandHandle
{
Q_OBJECT
public:
RubberbandLineHandle( Esri::ArcGISRuntime::MapGraphicsView * mapView ,QGraphicsScene * scene , const QPointF & p1, const QPointF & p2, unsigned int lineWidth = 2, bool dottedLine = false );
~RubberbandLineHandle();
bool isPositionInside( const QPointF & scenePosition ) const override;
virtual void updateCoordinates( const QVector<QPointF> & scenePositionVector );
virtual void updateCoordinate( unsigned index, const QPointF & scenePosition );
virtual QVector<RubberbandCoordinate> getCoordinates() const;
virtual RubberbandCoordinate getCoordinate( unsigned index ) const;
void dottedLine(bool on = true) { _dottedLine = on; }
protected:
QGraphicsItem * _lineSymbol;
QPen _lineStyle;
QVector<RubberbandCoordinate> _coordinates;
bool _dottedLine;
void updateGraphic() override;
void adjustCoordinates() override;
void adjustWindow( const QRectF& ) override;
}; /* RubberbandLineHandle */
} } /* namespace SituationMap::RB */