void PostScriptView::Brush (ostream& out) { PSBrush* brush = (PSBrush*) GetGraphicComp()->GetGraphic()->GetBrush(); if (brush == nil) { out << MARK << " b u\n"; } else if (brush->None()) { out << "none SetB " << MARK << " b n\n"; } else { int p = brush->GetLinePattern(); out << MARK << " b " << p << "\n"; float w = brush->width(); out << w << " " << false << " " << false << " "; const int* dashpat = brush->GetDashPattern(); int dashpatsize = brush->GetDashPatternSize(); int dashoffset = brush->GetDashOffset(); if (dashpatsize <= 0) { out << "[] " << dashoffset << " "; } else { out << "["; int i; for (i = 0; i < dashpatsize - 1; i++) { out << dashpat[i] << " "; } out << dashpat[i] << "] " << dashoffset << " "; } out << "SetB\n"; } }
void PSArrowLine::Brush (ostream& out) { ArrowLineComp* comp = (ArrowLineComp*) GetSubject(); PSBrush* brush = (PSBrush*) GetGraphicComp()->GetGraphic()->GetBrush(); boolean head, tail; head = comp->GetArrowLine()->Head(); tail = comp->GetArrowLine()->Tail(); if (brush == nil) { out << MARK << " b u\n"; } else if (brush->None()) { out << "none SetB " << MARK << " b n\n"; } else { int p = brush->GetLinePattern(); out << MARK << " b " << p << "\n"; int w = brush->Width(); out << w << " " << head << " " << tail << " "; const int* dashpat = brush->GetDashPattern(); int dashpatsize = brush->GetDashPatternSize(); int dashoffset = brush->GetDashOffset(); if (dashpatsize <= 0) { out << "[] " << dashoffset << " "; } else { out << "["; for (int i = 0; i < dashpatsize - 1; i++) { out << dashpat[i] << " "; } out << dashpat[i] << "] " << dashoffset << " "; } out << "SetB\n"; } }