103 lines
3.3 KiB
Objective-C
Executable File
103 lines
3.3 KiB
Objective-C
Executable File
/**
|
|
**
|
|
** @RDE_HEADER@
|
|
** Definition of rubberband class to define multiple 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 .........:
|
|
**
|
|
** 18.06.2015, JT : First edition for use with Qt5
|
|
**
|
|
** -----------------------------------------------------------------------------------------------
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <limits>
|
|
|
|
#include "rubberband_point_feature.h"
|
|
|
|
|
|
namespace SituationMap { namespace RB
|
|
{
|
|
|
|
/**
|
|
@class RubberbandPointCluster rubberband_point_cluster.h
|
|
@brief Implementation of a rubberband to input single coodinates for building point feature clusters
|
|
@see Rubberband, RubberbandPointFeature
|
|
*/
|
|
class SITUATIONMAP_EXPORT RubberbandPointCluster : public RubberbandPointFeature
|
|
{
|
|
Q_OBJECT
|
|
/**
|
|
@name Construction & Destruction
|
|
@{
|
|
*/
|
|
|
|
friend class RubberbandFactory;
|
|
|
|
RubberbandPointCluster( SituationMap::Map * map, QObject * parent, bool isActive = true );
|
|
|
|
RubberbandPointCluster( SituationMap::Map * map
|
|
, unsigned int maxCoordinates = std::numeric_limits<unsigned int>::max()
|
|
, QObject * parent = nullptr
|
|
, bool isActive = true );
|
|
|
|
public:
|
|
|
|
virtual ~RubberbandPointCluster();
|
|
|
|
RubberbandPointCluster(const RubberbandPointCluster &) = delete;
|
|
RubberbandPointCluster & operator = (const RubberbandPointCluster &) = delete;
|
|
/** @} */
|
|
|
|
bool setCoordinateAction( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool deleteAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
|
|
|
|
/**
|
|
Defines the minimum number of coordinates to input. Default is 1
|
|
*/
|
|
inline void minimumPointCount(unsigned int n) { _minimalPointCount = (n > 0) ? n : 1; }
|
|
|
|
/**
|
|
Returns the setting for minimum number of coordinates to input.
|
|
*/
|
|
inline unsigned int getMinimumPointCount() { return _minimalPointCount; }
|
|
|
|
void setCoordinateVector(const QVector<QPointF> & coordinateVector, CoordinateSystem cs = CoordinateSystem::Geo ) override;
|
|
|
|
protected:
|
|
|
|
/*
|
|
Forward declaration of InternalData to hold private member variables. Becareful the base class Rubberband
|
|
has similary a class for internal data member with name "InternalData". Don't be confused it is not the same.
|
|
*/
|
|
struct InternalData;
|
|
|
|
InternalData * _internal;
|
|
unsigned int _minimalPointCount;
|
|
|
|
void activateButtons() override;
|
|
|
|
void update() override;
|
|
|
|
}; /* RubberbandPointCluster */
|
|
|
|
} } /* namespace SituationMap::RB */
|