73 lines
2.2 KiB
C++
Executable File
73 lines
2.2 KiB
C++
Executable File
/**
|
|
**
|
|
** @RDE_HEADER@
|
|
** Definition of ellipse drawable
|
|
** $Id$
|
|
** $HeadURL$
|
|
** $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "rubberband_drawable.h"
|
|
|
|
#include <arcgis/Map.h>
|
|
|
|
|
|
namespace SituationMap { namespace RB
|
|
{
|
|
class DrawableEllipse : public RubberbandDrawable
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
explicit DrawableEllipse( Esri::ArcGISRuntime::MapGraphicsView * );
|
|
explicit DrawableEllipse( Esri::ArcGISRuntime::MapGraphicsView *, QGraphicsScene * );
|
|
~DrawableEllipse();
|
|
|
|
DrawableEllipse(const RubberbandDrawable &) = delete;
|
|
DrawableEllipse & operator = (const RubberbandDrawable &) = delete;
|
|
|
|
|
|
inline void setRect(const QPointF & center, qreal radiusX, qreal radiusY, qreal sin, qreal cos, const QPointF & sectorStart = QPointF(), const QPointF & sectorEnd = QPointF() )
|
|
{
|
|
// p1,p2 = corner points of unrotated ellipse in scene coordinates
|
|
_center = RubberbandCoordinate( _mapView, convert(center, _mapView->map()->spatialReference()) );
|
|
_radiusX = radiusX;
|
|
_radiusY = radiusY;
|
|
|
|
_sinRect = sin;
|
|
_cosRect = cos;
|
|
|
|
_sectorStart = sectorStart;
|
|
_sectorEnd = sectorEnd;
|
|
updateGraphic();
|
|
}
|
|
|
|
qreal radiusX() { return _radiusX; }
|
|
qreal radiusY() { return _radiusY; }
|
|
|
|
protected:
|
|
|
|
QGraphicsEllipseItem * _elliItem;
|
|
QGraphicsEllipseItem * _sectItem;
|
|
RubberbandDrawable::RubberbandCoordinate _center;
|
|
qreal _radiusX;
|
|
qreal _radiusY;
|
|
QPen _elliStyle;
|
|
qreal _sinRect;
|
|
qreal _cosRect;
|
|
QPointF _sectorStart;
|
|
QPointF _sectorEnd;
|
|
|
|
void updateGraphic() override;
|
|
|
|
|
|
void adjustCoordinates() override;
|
|
void adjustWindow( const QRectF& ) override;
|
|
|
|
}; /* DrawableEllipse */
|
|
|
|
} } /* namespace SituationMap::RB */
|