97 lines
2.6 KiB
Objective-C
Executable File
97 lines
2.6 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 QGraphicsEllipse;
|
|
class QGraphicsScene;
|
|
|
|
namespace SituationMap
|
|
{
|
|
namespace RB
|
|
{
|
|
|
|
/**
|
|
@class RubberbandEllipseHandle rubberband_line_handle.h
|
|
@brief Implementation of a line handle for rubberband internal use.
|
|
@see RubberbandHandle
|
|
*/
|
|
class RubberbandEllipseHandle : public RubberbandHandle
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
RubberbandEllipseHandle(Esri::ArcGISRuntime::MapGraphicsView * mapView ,QGraphicsScene * scene);
|
|
~RubberbandEllipseHandle();
|
|
|
|
bool isPositionInside(const QPointF &scenePosition) const override;
|
|
|
|
// virtual void updateCoordinates(const QVector<QPointF> &scenePositionVector);
|
|
// virtual void updateCoordinate(unsigned index, const QPointF &scenePosition);
|
|
|
|
QPointF getRadius();
|
|
|
|
void setRect(const RubberbandDrawable::RubberbandCoordinate ¢er,
|
|
qreal radiusX, qreal radiusY,
|
|
qreal sin, qreal cos,
|
|
const QPointF & sectorStart = QPointF(), const QPointF & sectorEnd = QPointF());
|
|
|
|
|
|
void dottedLine(bool on = true) { _dottedLine = on; }
|
|
|
|
protected:
|
|
|
|
QGraphicsEllipseItem *_ellipseSymbol{nullptr};
|
|
QPen _lineStyle;
|
|
RubberbandDrawable::RubberbandCoordinate _center;
|
|
qreal _radiusX{0.0};
|
|
qreal _radiusY{0.0};
|
|
qreal _sinRect{0.0};
|
|
qreal _cosRect{0.0};
|
|
QPointF _sectorStart;
|
|
QPointF _sectorEnd;
|
|
|
|
bool _dottedLine{false};
|
|
|
|
void updateGraphic() override;
|
|
|
|
void adjustCoordinates() override;
|
|
void adjustWindow(const QRectF&) override;
|
|
|
|
|
|
}; // RubberbandEllipseHandle
|
|
|
|
}
|
|
} // namespace SituationMap::RB
|