ComplexMissionItem.h 2.25 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9

10 11 12
#ifndef ComplexMissionItem_H
#define ComplexMissionItem_H

13
#include "VisualMissionItem.h"
14
#include "QGCGeo.h"
15

16
class ComplexMissionItem : public VisualMissionItem
17 18
{
    Q_OBJECT
19

20
public:
21
    ComplexMissionItem(Vehicle* vehicle, bool flyView, QObject* parent);
22

23 24
    const ComplexMissionItem& operator=(const ComplexMissionItem& other);

25
    Q_PROPERTY(double   complexDistance     READ complexDistance    NOTIFY complexDistanceChanged)
26

27
    /// @return The distance covered the complex mission item in meters.
28
    /// Signals complexDistanceChanged
29
    virtual double complexDistance(void) const = 0;
30

31 32 33
    /// @return The item bounding cube
    /// Signals boundingCubeChanged
    virtual QGCGeoBoundingCube boundingCube(void) const { return QGCGeoBoundingCube(); }
34

35 36
    /// Load the complex mission item from Json
    ///     @param complexObject Complex mission item json object
Don Gagne's avatar
Don Gagne committed
37
    ///     @param sequenceNumber Sequence number for first MISSION_ITEM in survey
38 39
    ///     @param[out] errorString Error if load fails
    /// @return true: load success, false: load failed, errorString set
Don Gagne's avatar
Don Gagne committed
40
    virtual bool load(const QJsonObject& complexObject, int sequenceNumber, QString& errorString) = 0;
41

42 43 44
    /// Get the point of complex mission item furthest away from a coordinate
    ///     @param other QGeoCoordinate to which distance is calculated
    /// @return the greatest distance from any point of the complex item to some coordinate
45
    /// Signals greatestDistanceToChanged
46
    virtual double greatestDistanceTo(const QGeoCoordinate &other) const = 0;
47

Don Gagne's avatar
Don Gagne committed
48 49 50
    /// This mission item attribute specifies the type of the complex item.
    static const char* jsonComplexItemTypeKey;

51 52 53 54
    // Overrides from VisualMissionItem
    double additionalTimeDelay(void) const final { return 0; }


55
signals:
56
    void complexDistanceChanged     (void);
57
    void boundingCubeChanged        (void);
58
    void greatestDistanceToChanged  (void);
59 60 61
};

#endif