Tue, 09 Sep 2014 02:39:04 +0300
- removed the clock timer I forgot in the previous commit
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
844
11587d419d2f
- changed copyright lines to use my legal name instead of my nickname
Teemu Piippo <crimsondusk64@gmail.com>
parents:
830
diff
changeset
|
3 | * Copyright (C) 2013, 2014 Teemu Piippo |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #pragma once |
830
a741a0b9df49
- updated filenames
Santeri Piippo <crimsondusk64@gmail.com>
parents:
824
diff
changeset
|
20 | #include "abstractEditMode.h" |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
21 | #include "../basics.h" |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include <QMap> |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include <QVector> |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
25 | class MagicWandMode : public AbstractSelectMode |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | { |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
844
diff
changeset
|
27 | QMap<Vertex, QVector<LDObjectPtr>> m_vertices; |
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
844
diff
changeset
|
28 | QVector<LDObjectPtr> m_selection; |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
30 | DEFINE_CLASS (MagicWandMode, AbstractSelectMode) |
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
31 | |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | public: |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | using BoundaryType = std::tuple<Vertex, Vertex>; |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | enum MagicType |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | { |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | Set, |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | Additive, |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | Subtractive, |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | InternalRecursion |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | }; |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
42 | MagicWandMode (GLRenderer* renderer); |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | void doMagic (LDObjectPtr obj, MagicType type); |
823
1a2f593f0c02
- saving work done on edit mode revamp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
818
diff
changeset
|
44 | virtual EditModeType type() const override; |
824
6add2126e7ff
- more work on edit modes
Santeri Piippo <crimsondusk64@gmail.com>
parents:
823
diff
changeset
|
45 | virtual bool mouseReleased (MouseEventData const& data) override; |
818
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
47 | private: |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | void fillBoundaries (LDObjectPtr obj, QVector<BoundaryType>& boundaries, QVector<LDObjectPtr>& candidates); |
748ba8818af8
- added the magic wand tool
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | }; |