zz_addObjectDialog.cpp

Wed, 20 Mar 2013 01:58:05 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Wed, 20 Mar 2013 01:58:05 +0200
changeset 40
215b9f8f0cd7
parent 39
110669124caf
child 41
4ca63da5546b
permissions
-rw-r--r--

Added triangle, quad and condline to the add object dialog

39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2013 Santeri `arezey` Piippo
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #include <qgridlayout.h>
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include "gui.h"
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include "zz_addObjectDialog.h"
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include "file.h"
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
24 #define APPLY_COORDS(OBJ, N) \
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
25 for (short i = 0; i < N; ++i) { \
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
26 OBJ->vaCoords[i].x = dlg.qaCoordinates[(i * 3) + 0]->value (); \
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
27 OBJ->vaCoords[i].y = dlg.qaCoordinates[(i * 3) + 1]->value (); \
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
28 OBJ->vaCoords[i].z = dlg.qaCoordinates[(i * 3) + 2]->value (); \
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
29 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
30
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 // =============================================================================
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
33 // =============================================================================
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 AddObjectDialog::AddObjectDialog (const LDObjectType_e type, QWidget* parent) :
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 QDialog (parent)
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36 {
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
37 short dCoordCount = 0;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
38
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39 qTypeIcon = new QLabel;
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 qTypeIcon->setPixmap (QPixmap (g_saObjTypeIcons[type]));
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
42 switch (type) {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
43 case OBJ_Comment:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
44 qCommentLine = new QLineEdit;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
45 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
46 case OBJ_Line:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
47 dCoordCount = 6;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
48 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
49 case OBJ_Triangle:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
50 dCoordCount = 9;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
51 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
52 case OBJ_Quad:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
53 case OBJ_CondLine:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
54 dCoordCount = 12;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
55 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
56 default:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
57 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
58 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
59
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
60 for (short i = 0; i < dCoordCount; ++i) {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
61 qaCoordinates[i] = new QDoubleSpinBox;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
62 qaCoordinates[i]->setMaximumWidth (96);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
63 qaCoordinates[i]->setMinimum (-fMaxCoord);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
64 qaCoordinates[i]->setMaximum (fMaxCoord);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
65 }
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
66
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
67 IMPLEMENT_DIALOG_BUTTONS
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
68
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
69 QGridLayout* const qLayout = new QGridLayout;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
70 qLayout->addWidget (qTypeIcon, 0, 0);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
71
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
72 switch (type) {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
73 case OBJ_Comment:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
74 qLayout->addWidget (qCommentLine, 0, 1);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
75 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
76 default:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
77 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
78 }
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
79
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
80 if (dCoordCount > 0) {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
81 QGridLayout* const qCoordLayout = new QGridLayout;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
82
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
83 for (short i = 0; i < dCoordCount; ++i)
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
84 qCoordLayout->addWidget (qaCoordinates[i], (i / 3), (i % 3));
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
85
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
86 qLayout->addLayout (qCoordLayout, 0, 1);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
87 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
88
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
89 qLayout->addWidget (qButtons, 1, 1);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
90 setLayout (qLayout);
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
91 setWindowTitle (str::mkfmt (APPNAME_DISPLAY " - new %s",
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
92 g_saObjTypeNames[type]).chars());
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
93
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
94 setWindowIcon (QIcon (g_saObjTypeIcons[type]));
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
95 }
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
96
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
97 // =============================================================================
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
99 // =============================================================================
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
100 void AddObjectDialog::staticDialog (const LDObjectType_e type, ForgeWindow* window) {
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
101 AddObjectDialog dlg (type, window);
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
102
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
103 if (dlg.exec ()) {
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
104 switch (type) {
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
105 case OBJ_Comment:
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
106 {
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
107 LDComment* comm = new LDComment;
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
108 comm->zText = dlg.qCommentLine->text ();
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
109 g_CurrentFile->addObject (comm);
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
110 window->refresh ();
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
111 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
112 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
113
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
114 case OBJ_Line:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
115 {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
116 LDLine* line = new LDLine;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
117 line->dColor = dEdgeColor;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
118
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
119 APPLY_COORDS (line, 2)
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
120
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
121 g_CurrentFile->addObject (line);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
122 window->refresh ();
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
123 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
124 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
125
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
126 case OBJ_Triangle:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
127 {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
128 LDTriangle* tri = new LDTriangle;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
129 tri->dColor = dMainColor;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
130
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
131 APPLY_COORDS (tri, 3)
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
132
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
133 g_CurrentFile->addObject (tri);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
134 window->refresh ();
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
135 }
40
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
136 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
137
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
138 case OBJ_Quad:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
139 {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
140 LDQuad* quad = new LDQuad;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
141 quad->dColor = dMainColor;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
142
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
143 APPLY_COORDS (quad, 4)
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
144
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
145 g_CurrentFile->addObject (quad);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
146 window->refresh ();
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
147 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
148 break;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
149
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
150 case OBJ_CondLine:
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
151 {
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
152 LDCondLine* line = new LDCondLine;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
153 line->dColor = dEdgeColor;
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
154
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
155 APPLY_COORDS (line, 4)
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
156
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
157 g_CurrentFile->addObject (line);
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
158 window->refresh ();
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
159 }
215b9f8f0cd7 Added triangle, quad and condline to the add object dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 39
diff changeset
160
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
161 default:
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
162 break;
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
163 }
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
164 }
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
165 }

mercurial