25 #include "colors.h" |
25 #include "colors.h" |
26 #include "zz_colorSelectDialog.h" |
26 #include "zz_colorSelectDialog.h" |
27 #include "history.h" |
27 #include "history.h" |
28 |
28 |
29 #define APPLY_COORDS(OBJ, N) \ |
29 #define APPLY_COORDS(OBJ, N) \ |
30 for (short i = 0; i < N; ++i) { \ |
30 for (short i = 0; i < N; ++i) \ |
31 OBJ->vaCoords[i].x = dlg.dsb_coords[(i * 3) + 0]->value (); \ |
31 for (const Axis ax : g_Axes) \ |
32 OBJ->vaCoords[i].y = dlg.dsb_coords[(i * 3) + 1]->value (); \ |
32 OBJ->vaCoords[i][ax] = dlg.dsb_coords[(i * 3) + ax]->value (); |
33 OBJ->vaCoords[i].z = dlg.dsb_coords[(i * 3) + 2]->value (); \ |
|
34 } |
|
35 |
33 |
36 // ============================================================================= |
34 // ============================================================================= |
37 class SubfileListItem : public QTreeWidgetItem { |
35 class SubfileListItem : public QTreeWidgetItem { |
38 public: |
36 public: |
39 SubfileListItem (QTreeWidgetItem* parent, int subfileID) : |
37 SubfileListItem (QTreeWidgetItem* parent, int subfileID) : |
168 break; |
166 break; |
169 } |
167 } |
170 |
168 |
171 // Show a color edit dialog for the types that actually use the color |
169 // Show a color edit dialog for the types that actually use the color |
172 if (defaults->isColored ()) { |
170 if (defaults->isColored ()) { |
173 dColor = (type == OBJ_CondLine || type == OBJ_Line) ? dEdgeColor : dMainColor; |
171 dColor = (type == OBJ_CondLine || type == OBJ_Line) ? edgecolor : maincolor; |
174 |
172 |
175 pb_color = new QPushButton; |
173 pb_color = new QPushButton; |
176 setButtonBackground (pb_color, dColor); |
174 setButtonBackground (pb_color, dColor); |
177 connect (pb_color, SIGNAL (clicked ()), this, SLOT (slot_colorButtonClicked ())); |
175 connect (pb_color, SIGNAL (clicked ()), this, SLOT (slot_colorButtonClicked ())); |
178 } |
176 } |
362 |
360 |
363 case OBJ_Vertex: |
361 case OBJ_Vertex: |
364 { |
362 { |
365 LDVertex* vert = initObj<LDVertex> (obj); |
363 LDVertex* vert = initObj<LDVertex> (obj); |
366 vert->dColor = dlg.dColor; |
364 vert->dColor = dlg.dColor; |
367 vert->vPosition.x = dlg.dsb_coords[0]->value (); |
365 |
368 vert->vPosition.y = dlg.dsb_coords[1]->value (); |
366 for (const Axis ax : g_Axes) |
369 vert->vPosition.z = dlg.dsb_coords[2]->value (); |
367 vert->vPosition[ax] = dlg.dsb_coords[ax]->value (); |
370 } |
368 } |
371 break; |
369 break; |
372 |
370 |
373 case OBJ_Radial: |
371 case OBJ_Radial: |
374 { |
372 { |
375 LDRadial* pRad = initObj<LDRadial> (obj); |
373 LDRadial* pRad = initObj<LDRadial> (obj); |
376 pRad->dColor = dlg.dColor; |
374 pRad->dColor = dlg.dColor; |
377 pRad->vPosition.x = dlg.dsb_coords[0]->value (); |
375 |
378 pRad->vPosition.y = dlg.dsb_coords[1]->value (); |
376 for (const Axis ax : g_Axes) |
379 pRad->vPosition.z = dlg.dsb_coords[2]->value (); |
377 pRad->vPosition[ax] = dlg.dsb_coords[ax]->value (); |
|
378 |
380 pRad->dDivisions = (dlg.cb_radHiRes->checkState () != Qt::Checked) ? 16 : 48; |
379 pRad->dDivisions = (dlg.cb_radHiRes->checkState () != Qt::Checked) ? 16 : 48; |
381 pRad->dSegments = min<short> (dlg.sb_radSegments->value (), pRad->dDivisions); |
380 pRad->dSegments = min<short> (dlg.sb_radSegments->value (), pRad->dDivisions); |
382 pRad->eRadialType = (LDRadial::Type) dlg.bb_radType->value (); |
381 pRad->eRadialType = (LDRadial::Type) dlg.bb_radType->value (); |
383 pRad->dRingNum = dlg.sb_radRingNum->value (); |
382 pRad->dRingNum = dlg.sb_radRingNum->value (); |
384 pRad->mMatrix = g_mIdentity; |
383 pRad->mMatrix = g_mIdentity; |
391 if (~name == 0) |
390 if (~name == 0) |
392 return; // no subfile filename |
391 return; // no subfile filename |
393 |
392 |
394 LDSubfile* ref = initObj<LDSubfile> (obj); |
393 LDSubfile* ref = initObj<LDSubfile> (obj); |
395 ref->dColor = dlg.dColor; |
394 ref->dColor = dlg.dColor; |
396 ref->vPosition.x = dlg.dsb_coords[0]->value (); |
395 |
397 ref->vPosition.y = dlg.dsb_coords[1]->value (); |
396 for (const Axis ax : g_Axes) |
398 ref->vPosition.z = dlg.dsb_coords[2]->value (); |
397 ref->vPosition[ax] = dlg.dsb_coords[ax]->value (); |
|
398 |
399 ref->zFileName = name; |
399 ref->zFileName = name; |
400 ref->mMatrix = g_mIdentity; |
400 ref->mMatrix = g_mIdentity; |
401 ref->pFile = loadSubfile (name); |
401 ref->pFile = loadSubfile (name); |
402 } |
402 } |
403 break; |
403 break; |