22 #include <QMap> |
22 #include <QMap> |
23 #include <QVector> |
23 #include <QVector> |
24 |
24 |
25 class MagicWandMode : public AbstractSelectMode |
25 class MagicWandMode : public AbstractSelectMode |
26 { |
26 { |
27 QMap<Vertex, QVector<LDObjectPtr>> m_vertices; |
27 QMap<Vertex, QVector<LDObject*>> m_vertices; |
28 QVector<LDObjectPtr> m_selection; |
28 QVector<LDObject*> m_selection; |
29 |
29 |
30 DEFINE_CLASS (MagicWandMode, AbstractSelectMode) |
30 DEFINE_CLASS (MagicWandMode, AbstractSelectMode) |
31 |
31 |
32 public: |
32 public: |
33 using BoundaryType = std::tuple<Vertex, Vertex>; |
33 using BoundaryType = std::tuple<Vertex, Vertex>; |
38 Subtractive, |
38 Subtractive, |
39 InternalRecursion |
39 InternalRecursion |
40 }; |
40 }; |
41 |
41 |
42 MagicWandMode (GLRenderer* renderer); |
42 MagicWandMode (GLRenderer* renderer); |
43 void doMagic (LDObjectPtr obj, MagicType type); |
43 void doMagic (LDObject* obj, MagicType type); |
44 virtual EditModeType type() const override; |
44 virtual EditModeType type() const override; |
45 virtual bool mouseReleased (MouseEventData const& data) override; |
45 virtual bool mouseReleased (MouseEventData const& data) override; |
46 |
46 |
47 private: |
47 private: |
48 void fillBoundaries (LDObjectPtr obj, QVector<BoundaryType>& boundaries, QVector<LDObjectPtr>& candidates); |
48 void fillBoundaries (LDObject* obj, QVector<BoundaryType>& boundaries, QVector<LDObject*>& candidates); |
49 }; |
49 }; |