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

103 lines
3.3 KiB
Objective-C
Executable File

/**
**
** @RDE_HEADER@
** Definition of rubberband class for free hand drawing
** $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 .........:
**
** 06.10.2015, JT : First edition for use with Qt5
**
** -----------------------------------------------------------------------------------------------
*/
#pragma once
#include "rubberband.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 RubberbandFreeHand : public Rubberband
{
Q_OBJECT
/**
@name Construction & Destruction
@{
*/
friend class RubberbandFactory;
explicit RubberbandFreeHand( SituationMap::Map * map, QObject * parent = nullptr );
public:
~RubberbandFreeHand();
/** @} */
bool selectAction ( AbstractEventDispatcher * causer, int x, int y ) override;
bool movePickedAction ( AbstractEventDispatcher * causer, int x, int y ) override;
bool moveAction ( AbstractEventDispatcher * causer, int x, int y ) override;
bool setCoordinateAction ( AbstractEventDispatcher * causer, int x, int y ) override;
bool completeStateAction ( AbstractEventDispatcher * causer, int x, int y ) override;
bool undoAction ( AbstractEventDispatcher * causer, int x, int y ) override;
unsigned int coordinateCount() const override;
virtual QVector<QPointF> coordinateVector( CoordinateSystem cs = CoordinateSystem::Geo ) const override;
virtual QPointF singleCoordinate( unsigned int idx = 0, CoordinateSystem cs = CoordinateSystem::Geo ) const override;
/**
If set to true a polygon the rubberband draws a polygon otherwise a polyline.
*/
inline void enableClosed( bool flag ) { _isClosed = flag; }
/**
Gets the value of the close flag
*/
inline bool isClosedEnabled() const { return _isClosed; }
private:
virtual void setCoordinateVector( const QVector<QPointF> & /*pntList*/, CoordinateSystem /*cs*/ = CoordinateSystem::Geo ) override {}
protected:
/*
Forward declaration of internal container class for member variables. The derived classes of Rubberband
often have also a declaration of InternalData for there own internal members.
*/
struct InternalData;
InternalData * _internal;
bool _isClosed;
void activateButtons() override;
void update() override;
}; /* RubberbandFreeHand */
} } /* namespace SituationMap::RB */