100 lines
3.3 KiB
Objective-C
Executable File
100 lines
3.3 KiB
Objective-C
Executable File
/**
|
|
**
|
|
** @RDE_HEADER@
|
|
** Definition of rubberband class to define point feature geoemtry
|
|
** $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 <limits>
|
|
|
|
#include "rubberband.h"
|
|
|
|
|
|
namespace SituationMap { namespace RB
|
|
{
|
|
|
|
/**
|
|
@class RubberbandPointFeature rubberband_point_feature.h
|
|
@brief Implementation of a rubberband to input single coodinates for building point features
|
|
@see Rubberband
|
|
*/
|
|
class SITUATIONMAP_EXPORT RubberbandPointFeature : public Rubberband
|
|
{
|
|
Q_OBJECT
|
|
/**
|
|
@name Construction & Destruction
|
|
@{
|
|
*/
|
|
|
|
friend class RubberbandFactory;
|
|
friend class RubberbandPointCluster;
|
|
|
|
explicit RubberbandPointFeature( SituationMap::Map * map, QObject * parent = nullptr, bool isActive = true );
|
|
|
|
public:
|
|
~RubberbandPointFeature();
|
|
/** @} */
|
|
|
|
bool selectAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool setCoordinateAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool moveAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool movePickedAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool contextMenuAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool completeStateAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool deleteAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool undoAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
|
|
|
|
/**
|
|
Defines the maximum number of coordinates to input. Default is 1
|
|
*/
|
|
inline void maximumPointCount(unsigned int n) { _maximalPointCount = (n > 0) ? n : std::numeric_limits<unsigned int>::max(); }
|
|
|
|
/**
|
|
Returns the setting for maximum number of coordinates to input.
|
|
*/
|
|
inline unsigned int getMaximumPointCount() { return _maximalPointCount; }
|
|
|
|
|
|
QVector<QPointF> coordinateVector( CoordinateSystem cs = CoordinateSystem::Geo ) const override;
|
|
QVector<QPointF> coordinateVectorPixel() const;
|
|
|
|
QPointF singleCoordinate( unsigned int idx = 0, CoordinateSystem cs = CoordinateSystem::Geo ) const override;
|
|
|
|
void setCoordinateVector( const QVector<QPointF> & coordinateVector, CoordinateSystem cs = CoordinateSystem::Geo ) override;
|
|
|
|
protected:
|
|
|
|
virtual bool buttonProxyActive( const QPointF & scenePos) const { Q_UNUSED(scenePos); return false; }
|
|
|
|
|
|
unsigned int _maximalPointCount;
|
|
|
|
|
|
}; /* RubberbandPointFeature */
|
|
|
|
} } /* namespace SituationMap::RB */
|