555 |
555 |
556 case LDObject::Line: |
556 case LDObject::Line: |
557 { |
557 { |
558 LDLine* line = static_cast<LDLine*> (obj); |
558 LDLine* line = static_cast<LDLine*> (obj); |
559 descr.format ("%s, %s", |
559 descr.format ("%s, %s", |
560 line->vaCoords[0].stringRep (true).chars(), |
560 line->coords[0].stringRep (true).chars(), |
561 line->vaCoords[1].stringRep (true).chars()); |
561 line->coords[1].stringRep (true).chars()); |
562 } |
562 } |
563 break; |
563 break; |
564 |
564 |
565 case LDObject::Triangle: |
565 case LDObject::Triangle: |
566 { |
566 { |
567 LDTriangle* triangle = static_cast<LDTriangle*> (obj); |
567 LDTriangle* triangle = static_cast<LDTriangle*> (obj); |
568 descr.format ("%s, %s, %s", |
568 descr.format ("%s, %s, %s", |
569 triangle->vaCoords[0].stringRep (true).chars(), |
569 triangle->coords[0].stringRep (true).chars(), |
570 triangle->vaCoords[1].stringRep (true).chars(), |
570 triangle->coords[1].stringRep (true).chars(), |
571 triangle->vaCoords[2].stringRep (true).chars()); |
571 triangle->coords[2].stringRep (true).chars()); |
572 } |
572 } |
573 break; |
573 break; |
574 |
574 |
575 case LDObject::Quad: |
575 case LDObject::Quad: |
576 { |
576 { |
577 LDQuad* quad = static_cast<LDQuad*> (obj); |
577 LDQuad* quad = static_cast<LDQuad*> (obj); |
578 descr.format ("%s, %s, %s, %s", |
578 descr.format ("%s, %s, %s, %s", |
579 quad->vaCoords[0].stringRep (true).chars(), |
579 quad->coords[0].stringRep (true).chars(), |
580 quad->vaCoords[1].stringRep (true).chars(), |
580 quad->coords[1].stringRep (true).chars(), |
581 quad->vaCoords[2].stringRep (true).chars(), |
581 quad->coords[2].stringRep (true).chars(), |
582 quad->vaCoords[3].stringRep (true).chars()); |
582 quad->coords[3].stringRep (true).chars()); |
583 } |
583 } |
584 break; |
584 break; |
585 |
585 |
586 case LDObject::CondLine: |
586 case LDObject::CondLine: |
587 { |
587 { |
588 LDCondLine* line = static_cast<LDCondLine*> (obj); |
588 LDCondLine* line = static_cast<LDCondLine*> (obj); |
589 descr.format ("%s, %s, %s, %s", |
589 descr.format ("%s, %s, %s, %s", |
590 line->vaCoords[0].stringRep (true).chars(), |
590 line->coords[0].stringRep (true).chars(), |
591 line->vaCoords[1].stringRep (true).chars(), |
591 line->coords[1].stringRep (true).chars(), |
592 line->vaCoords[2].stringRep (true).chars(), |
592 line->coords[2].stringRep (true).chars(), |
593 line->vaCoords[3].stringRep (true).chars()); |
593 line->coords[3].stringRep (true).chars()); |
594 } |
594 } |
595 break; |
595 break; |
596 |
596 |
597 case LDObject::Gibberish: |
597 case LDObject::Gibberish: |
598 descr.format ("ERROR: %s", |
598 descr.format ("ERROR: %s", |
599 static_cast<LDGibberish*> (obj)->zContents.chars()); |
599 static_cast<LDGibberish*> (obj)->contents.chars()); |
600 break; |
600 break; |
601 |
601 |
602 case LDObject::Vertex: |
602 case LDObject::Vertex: |
603 descr.format ("%s", static_cast<LDVertex*> (obj)->vPosition.stringRep (true).chars()); |
603 descr.format ("%s", static_cast<LDVertex*> (obj)->pos.stringRep (true).chars()); |
604 break; |
604 break; |
605 |
605 |
606 case LDObject::Subfile: |
606 case LDObject::Subfile: |
607 { |
607 { |
608 LDSubfile* ref = static_cast<LDSubfile*> (obj); |
608 LDSubfile* ref = static_cast<LDSubfile*> (obj); |
609 |
609 |
610 descr.format ("%s %s, (", |
610 descr.format ("%s %s, (", |
611 ref->zFileName.chars(), ref->vPosition.stringRep (true).chars()); |
611 ref->fileName.chars(), ref->pos.stringRep (true).chars()); |
612 |
612 |
613 for (short i = 0; i < 9; ++i) |
613 for (short i = 0; i < 9; ++i) |
614 descr.appendformat ("%s%s", |
614 descr.appendformat ("%s%s", |
615 ftoa (ref->mMatrix[i]).chars(), |
615 ftoa (ref->transform[i]).chars(), |
616 (i != 8) ? " " : ""); |
616 (i != 8) ? " " : ""); |
617 |
617 |
618 descr += ')'; |
618 descr += ')'; |
619 } |
619 } |
620 break; |
620 break; |
655 // Color gibberish orange on red so it stands out. |
655 // Color gibberish orange on red so it stands out. |
656 if (obj->getType() == LDObject::Gibberish) { |
656 if (obj->getType() == LDObject::Gibberish) { |
657 item->setBackground (QColor ("#AA0000")); |
657 item->setBackground (QColor ("#AA0000")); |
658 item->setForeground (QColor ("#FFAA00")); |
658 item->setForeground (QColor ("#FFAA00")); |
659 } else if (lv_colorize && obj->isColored () && |
659 } else if (lv_colorize && obj->isColored () && |
660 obj->dColor != maincolor && obj->dColor != edgecolor) |
660 obj->color != maincolor && obj->color != edgecolor) |
661 { |
661 { |
662 // If the object isn't in the main or edge color, draw this |
662 // If the object isn't in the main or edge color, draw this |
663 // list entry in said color. |
663 // list entry in said color. |
664 color* col = getColor (obj->dColor); |
664 color* col = getColor (obj->color); |
665 if (col) |
665 if (col) |
666 item->setForeground (col->qColor); |
666 item->setForeground (col->qColor); |
667 } |
667 } |
668 |
668 |
669 obj->qObjListEntry = item; |
669 obj->qObjListEntry = item; |
757 std::vector<ulong> indices; |
757 std::vector<ulong> indices; |
758 std::vector<short> colors; |
758 std::vector<short> colors; |
759 short newColor = col->index (); |
759 short newColor = col->index (); |
760 |
760 |
761 for (LDObject* obj : m_sel) { |
761 for (LDObject* obj : m_sel) { |
762 if (obj->dColor == -1) |
762 if (obj->color == -1) |
763 continue; // uncolored object |
763 continue; // uncolored object |
764 |
764 |
765 indices.push_back (obj->getIndex (g_curfile)); |
765 indices.push_back (obj->getIndex (g_curfile)); |
766 colors.push_back (obj->dColor); |
766 colors.push_back (obj->color); |
767 |
767 |
768 obj->dColor = newColor; |
768 obj->color = newColor; |
769 } |
769 } |
770 |
770 |
771 History::addEntry (new SetColorHistory (indices, colors, newColor)); |
771 History::addEntry (new SetColorHistory (indices, colors, newColor)); |
772 refresh (); |
772 refresh (); |
773 } |
773 } |