304 int colon; |
304 int colon; |
305 |
305 |
306 if (line.endsWith ("\n")) |
306 if (line.endsWith ("\n")) |
307 line.chop (1); |
307 line.chop (1); |
308 |
308 |
309 if (line.length() == 0 || line[0] == '#') |
309 if (line.length() == 0 or line[0] == '#') |
310 continue; |
310 continue; |
311 |
311 |
312 if ((colon = line.indexOf (":")) == -1) |
312 if ((colon = line.indexOf (":")) == -1) |
313 { |
313 { |
314 if (cat && cat->isValidToInclude()) |
314 if (cat and cat->isValidToInclude()) |
315 g_PrimitiveCategories << cat; |
315 g_PrimitiveCategories << cat; |
316 |
316 |
317 cat = new PrimitiveCategory (line); |
317 cat = new PrimitiveCategory (line); |
318 } |
318 } |
319 elif (cat != null) |
319 elif (cat != null) |
508 } |
508 } |
509 } |
509 } |
510 |
510 |
511 // If this is not a full circle, we need a conditional line at the other |
511 // If this is not a full circle, we need a conditional line at the other |
512 // end, too. |
512 // end, too. |
513 if (segs < divs && condLineSegs.size() != 0) |
513 if (segs < divs and condLineSegs.size() != 0) |
514 condLineSegs << segs; |
514 condLineSegs << segs; |
515 |
515 |
516 for (int i : condLineSegs) |
516 for (int i : condLineSegs) |
517 { |
517 { |
518 Vertex v0 (radialPoint (i, divs, cos), 0.0f, radialPoint (i, divs, sin)), |
518 Vertex v0 (radialPoint (i, divs, cos), 0.0f, radialPoint (i, divs, sin)), |
575 |
575 |
576 // Compose some general information: prefix, fraction, root, ring number |
576 // Compose some general information: prefix, fraction, root, ring number |
577 QString prefix = (divs == g_lores) ? "" : format ("%1/", divs); |
577 QString prefix = (divs == g_lores) ? "" : format ("%1/", divs); |
578 QString frac = format ("%1-%2", numer, denom); |
578 QString frac = format ("%1-%2", numer, denom); |
579 QString root = g_radialNameRoots[type]; |
579 QString root = g_radialNameRoots[type]; |
580 QString numstr = (type == Ring || type == Cone) ? format ("%1", num) : ""; |
580 QString numstr = (type == Ring or type == Cone) ? format ("%1", num) : ""; |
581 |
581 |
582 // Truncate the root if necessary (7-16rin4.dat for instance). |
582 // Truncate the root if necessary (7-16rin4.dat for instance). |
583 // However, always keep the root at least 2 characters. |
583 // However, always keep the root at least 2 characters. |
584 int extra = (frac.length() + numstr.length() + root.length()) - 8; |
584 int extra = (frac.length() + numstr.length() + root.length()) - 8; |
585 root.chop (clamp (extra, 0, 2)); |
585 root.chop (clamp (extra, 0, 2)); |
680 { |
680 { |
681 ui->sb_segs->setMaximum (on ? g_hires : g_lores); |
681 ui->sb_segs->setMaximum (on ? g_hires : g_lores); |
682 |
682 |
683 // If the current value is 16 and we switch to hi-res, default the |
683 // If the current value is 16 and we switch to hi-res, default the |
684 // spinbox to 48. |
684 // spinbox to 48. |
685 if (on && ui->sb_segs->value() == g_lores) |
685 if (on and ui->sb_segs->value() == g_lores) |
686 ui->sb_segs->setValue (g_hires); |
686 ui->sb_segs->setValue (g_hires); |
687 } |
687 } |
688 |
688 |
689 // ============================================================================= |
689 // ============================================================================= |
690 // |
690 // |