zz_addObjectDialog.cpp

changeset 41
4ca63da5546b
parent 40
215b9f8f0cd7
child 42
499c25af0303
equal deleted inserted replaced
40:215b9f8f0cd7 41:4ca63da5546b
51 break; 51 break;
52 case OBJ_Quad: 52 case OBJ_Quad:
53 case OBJ_CondLine: 53 case OBJ_CondLine:
54 dCoordCount = 12; 54 dCoordCount = 12;
55 break; 55 break;
56 case OBJ_Vertex:
57 dCoordCount = 3;
56 default: 58 default:
57 break; 59 break;
58 } 60 }
59 61
60 for (short i = 0; i < dCoordCount; ++i) { 62 for (short i = 0; i < dCoordCount; ++i) {
89 qLayout->addWidget (qButtons, 1, 1); 91 qLayout->addWidget (qButtons, 1, 1);
90 setLayout (qLayout); 92 setLayout (qLayout);
91 setWindowTitle (str::mkfmt (APPNAME_DISPLAY " - new %s", 93 setWindowTitle (str::mkfmt (APPNAME_DISPLAY " - new %s",
92 g_saObjTypeNames[type]).chars()); 94 g_saObjTypeNames[type]).chars());
93 95
94 setWindowIcon (QIcon (g_saObjTypeIcons[type])); 96 setWindowIcon (QIcon (str::mkfmt ("icons/add-%s.png", g_saObjTypeIcons[type]).chars ()));
95 } 97 }
96 98
97 // ============================================================================= 99 // =============================================================================
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
99 // ============================================================================= 101 // =============================================================================
155 APPLY_COORDS (line, 4) 157 APPLY_COORDS (line, 4)
156 158
157 g_CurrentFile->addObject (line); 159 g_CurrentFile->addObject (line);
158 window->refresh (); 160 window->refresh ();
159 } 161 }
162 break;
163
164 case OBJ_Vertex:
165 {
166 LDVertex* vert = new LDVertex;
167 vert->dColor = dMainColor;
168 vert->vPosition.x = dlg.qaCoordinates[0]->value ();
169 vert->vPosition.y = dlg.qaCoordinates[1]->value ();
170 vert->vPosition.z = dlg.qaCoordinates[2]->value ();
171
172 g_CurrentFile->addObject (vert);
173 window->refresh ();
174 }
175 break;
160 176
161 default: 177 default:
162 break; 178 break;
163 } 179 }
164 } 180 }

mercurial