131 lines
4.6 KiB
Objective-C
Executable File
131 lines
4.6 KiB
Objective-C
Executable File
/**
|
|
**
|
|
** @RDE_HEADER@
|
|
** Definition of rubberband class to define multi point feature geoemtry with Arrow
|
|
** $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 .........:
|
|
**
|
|
** 21.08.2015, JT : First edition for use with Qt5
|
|
**
|
|
** -----------------------------------------------------------------------------------------------
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "rubberband_multi_point_feature.h"
|
|
|
|
|
|
namespace SituationMap { namespace RB
|
|
{
|
|
|
|
class RubberbandLineHandle;
|
|
class RubberbandFrameHandle;
|
|
|
|
/**
|
|
@class RubberbandArrow rubberband_arrow.h
|
|
@brief Implementation of a rubberband for lines with arrow.
|
|
@see RubberbandFactory, Rubberband, RubberbandMultiPointFeature
|
|
|
|
Implementation of rubberbands used to input corridors. There are two different modes \c InputCenterLine and \c InputBoundary. In the
|
|
InputCenterLine mode the center line of the corridor has to be defined. The rubberband displays then the border geometry.
|
|
In the InputBoundary mode one side of the border has to be defined. The \c coordinateVector methodes always working on the input geometry.
|
|
*/
|
|
class SITUATIONMAP_EXPORT RubberbandArrow : public RubberbandMultiPointFeature
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/**
|
|
@name Construction & Destruction
|
|
@{
|
|
*/
|
|
private:
|
|
|
|
friend class RubberbandFactory;
|
|
explicit RubberbandArrow( SituationMap::Map * map, QObject * parent = nullptr );
|
|
|
|
public:
|
|
~RubberbandArrow();
|
|
/** @} */
|
|
|
|
|
|
/**
|
|
Sets coordinates to modify to internal coordinate list.
|
|
|
|
@param coordinateVec List of coordinates to modify.
|
|
@param cs Defines the coordinate system of returned coordinates.
|
|
*/
|
|
void setCoordinateVector( const QVector<QPointF> & coordinateVec, CoordinateSystem cs = CoordinateSystem::Geo ) override;
|
|
|
|
/**
|
|
Sets coordinates to modify to internal coordinate list. In \c InputCenterLine mode the coordinates will be interpreted as
|
|
center line of the corridor. In \c InputBoundary the coordinates are defining one border. Id \c corridorWidth is negative
|
|
the coordinates are the right border otherwise the left one.
|
|
|
|
@param coordinateVec List of coordinates to modify.
|
|
@param arrowHalfWidth Half width of arrow in pixel.
|
|
@param arrowLength Length of arrow in pixel.
|
|
@param cs Defines the coordinate system of returned coordinates.
|
|
*/
|
|
void setCoordinateVectorArrow(const QVector<QPointF> & coordinateVec, unsigned int arrowHalfWidth, unsigned int arrowLength, CoordinateSystem cs = CoordinateSystem::Geo );
|
|
|
|
|
|
/**
|
|
Return the width of the corridor.
|
|
*/
|
|
unsigned int arrowHalfWidth() const;
|
|
unsigned int arrowLength() const;
|
|
|
|
|
|
bool selectAction ( AbstractEventDispatcher * causer, int x, int y ) override;
|
|
bool setCoordinateAction ( 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 completeStateAction ( AbstractEventDispatcher * causer, int x, int y ) 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 _arrowSceneHalfWidth;
|
|
unsigned int _arrowSceneLength;
|
|
|
|
void update() override;
|
|
|
|
|
|
void updateArrowPath();
|
|
void updateHandleScenePosition();
|
|
|
|
void constructArrow( const QPointF & p );
|
|
void constructArrowHandle();
|
|
|
|
QPointF getArrowHandleScenePosition();
|
|
QPointF getArrowHandlePosition();
|
|
|
|
|
|
|
|
}; /* RubberbandCorridor */
|
|
|
|
} } /* namespace SituationMap::RB */
|