src/document.cpp

changeset 205
1a4342d80de7
parent 204
52e10e8d88cc
child 214
8e1fe64ce4e3
equal deleted inserted replaced
204:52e10e8d88cc 205:1a4342d80de7
24 #include "ui/objecteditor.h" 24 #include "ui/objecteditor.h"
25 25
26 EditorTabWidget::EditorTabWidget( 26 EditorTabWidget::EditorTabWidget(
27 Model* model, 27 Model* model,
28 DocumentManager* documents, 28 DocumentManager* documents,
29 const ldraw::ColorTable& colorTable, 29 const ColorTable& colorTable,
30 QWidget* parent) : 30 QWidget* parent) :
31 QWidget{parent}, 31 QWidget{parent},
32 colorTable{colorTable}, 32 colorTable{colorTable},
33 canvas{new Canvas{model, this, documents, colorTable, this}}, 33 canvas{new Canvas{model, this, documents, colorTable, this}},
34 model{model}, 34 model{model},
186 .newElement = Colored<LineSegment>{ 186 .newElement = Colored<LineSegment>{
187 LineSegment{ 187 LineSegment{
188 .p1 = this->drawState.polygon[0], 188 .p1 = this->drawState.polygon[0],
189 .p2 = this->drawState.polygon[1], 189 .p2 = this->drawState.polygon[1],
190 }, 190 },
191 ldraw::EDGE_COLOR, 191 EDGE_COLOR,
192 } 192 }
193 }); 193 });
194 break; 194 break;
195 case 3: 195 case 3:
196 Q_EMIT this->modelAction(AppendToModel{ 196 Q_EMIT this->modelAction(AppendToModel{
198 Triangle{ 198 Triangle{
199 .p1 = this->drawState.polygon[0], 199 .p1 = this->drawState.polygon[0],
200 .p2 = this->drawState.polygon[1], 200 .p2 = this->drawState.polygon[1],
201 .p3 = this->drawState.polygon[2], 201 .p3 = this->drawState.polygon[2],
202 }, 202 },
203 ldraw::MAIN_COLOR, 203 MAIN_COLOR,
204 } 204 }
205 }); 205 });
206 break; 206 break;
207 case 4: 207 case 4:
208 Q_EMIT this->modelAction(AppendToModel{ 208 Q_EMIT this->modelAction(AppendToModel{
211 .p1 = this->drawState.polygon[0], 211 .p1 = this->drawState.polygon[0],
212 .p2 = this->drawState.polygon[1], 212 .p2 = this->drawState.polygon[1],
213 .p3 = this->drawState.polygon[2], 213 .p3 = this->drawState.polygon[2],
214 .p4 = this->drawState.polygon[3], 214 .p4 = this->drawState.polygon[3],
215 }, 215 },
216 ldraw::MAIN_COLOR, 216 MAIN_COLOR,
217 } 217 }
218 }); 218 });
219 break; 219 break;
220 } 220 }
221 } 221 }

mercurial