src/dialogs/subfilereferenceeditor.h

Thu, 10 May 2018 14:57:23 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 10 May 2018 14:57:23 +0300
changeset 1386
c59dac18b06b
parent 1326
69a90bd2dba2
child 1391
5fa4bf1fc781
permissions
-rw-r--r--

added scaling vector editing into the subfile editing dialog

1326
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
1 /*
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
2 * LDForge: LDraw parts authoring CAD
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
3 * Copyright (C) 2013 - 2018 Teemu Piippo
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
4 *
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
5 * This program is free software: you can redistribute it and/or modify
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
6 * it under the terms of the GNU General Public License as published by
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
8 * (at your option) any later version.
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
9 *
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
10 * This program is distributed in the hope that it will be useful,
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
13 * GNU General Public License for more details.
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
14 *
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
15 * You should have received a copy of the GNU General Public License
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
17 */
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1297
diff changeset
18
1297
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 #pragma once
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 #include <QDialog>
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 #include "../main.h"
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22
1386
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
23 class QDoubleSpinBox;
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
24
1297
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 class SubfileReferenceEditor : public QDialog
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 {
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 Q_OBJECT
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 public:
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 SubfileReferenceEditor(class LDSubfileReference* reference, QWidget *parent = nullptr);
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
31 ~SubfileReferenceEditor();
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33 void accept() override;
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 void setPrimitivesTree(class PrimitiveManager* primitives);
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35
1386
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
36 private slots:
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
37 void scalingChanged();
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
38 void matrixChanged();
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
39
1297
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
40 private:
1386
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
41 QDoubleSpinBox* matrixCell(int row, int column) const;
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
42 double matrixScaling(int column) const;
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
43 QPair<int, int> cellPosition(QDoubleSpinBox* cellWidget);
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
44 QDoubleSpinBox* vectorElement(int index);
c59dac18b06b added scaling vector editing into the subfile editing dialog
Teemu Piippo <teemu@hecknology.net>
parents: 1326
diff changeset
45
1297
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
46 class Ui_SubfileReferenceEditor& ui;
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
47 class LDSubfileReference* const reference;
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
48 LDColor color;
389516787a4c added subfile reference editor
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
49 };

mercurial