void StencilComp::Read (istream& in) { GraphicComp::Read(in); Bitmap* image = ReadBitmap(in); Bitmap* mask = nil; Skip(in); int m; in >> m; if (m == valid_mask) { mask = ReadBitmap(in); } else if (m == mask_equals_image) { mask = image; } UStencil* stencil = new UStencil(image, mask); stencil->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); stencil->SetColors(fg, bg); Transformer* t = ReadTransformer(in); stencil->SetTransformer(t); Unref(t); SetGraphic(stencil); _filename = ReadString(in); }
void LinkComp::Read (istream& in) { GraphicComp::Read(in); Line* line = new Line(0, 0, 1, 1); Transformer* t = ReadTransformer(in); line->SetTransformer(t); Unref(t); _conn1 = (Connector*) unidraw->GetCatalog()->ReadComponent(in); _conn2 = (Connector*) unidraw->GetCatalog()->ReadComponent(in); Graphic* parent = new Picture; parent->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); parent->SetColors(fg, bg); parent->SetBrush(ReadBrush(in)); t = ReadTransformer(in); parent->SetTransformer(t); Unref(t); parent->Append(line, _conn1->GetGraphic(), _conn2->GetGraphic()); SetGraphic(parent); }
void LineComp::Read (istream& in) { GraphicComp::Read(in); Coord x0, y0, x1, y1; in >> x0 >> y0 >> x1 >> y1; Line* line = new Line(x0, y0, x1, y1); line->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); line->SetColors(fg, bg); line->SetBrush(ReadBrush(in)); Transformer* t = ReadTransformer(in); line->SetTransformer(t); Unref(t); SetGraphic(line); }
void RectComp::Read (istream& in) { GraphicComp::Read(in); Coord x0, y0, x1, y1; in >> x0 >> y0 >> x1 >> y1; SF_Rect* rect = new SF_Rect(x0, y0, x1, y1); rect->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); rect->SetColors(fg, bg); rect->SetBrush(ReadBrush(in)); rect->SetPattern(ReadPattern(in)); Transformer* t = ReadTransformer(in); rect->SetTransformer(t); Unref(t); SetGraphic(rect); }
void TextComp::Read (istream& in) { GraphicComp::Read(in); int lineHt; in >> lineHt; char* string = ReadString(in); TextGraphic* text = new TextGraphic(string, lineHt); delete string; text->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); text->SetColors(fg, bg); text->SetFont(ReadFont(in)); Transformer* t = ReadTransformer(in); text->SetTransformer(t); Unref(t); SetGraphic(text); }
void PadComp::Read (istream& in) { Connector::Read(in); Coord l, b, r, t; int mobility; in >> l >> b >> r >> t >> mobility; PadGraphic* pad = new PadGraphic(l, b, r, t); _mobility = Mobility(mobility); pad->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); pad->SetColors(fg, bg); pad->SetBrush(ReadBrush(in)); Transformer* xf = ReadTransformer(in); pad->SetTransformer(xf); Unref(xf); SetGraphic(pad); }
void EllipseComp::Read (istream& in) { GraphicComp::Read(in); Coord x0, y0; int r1, r2; in >> x0 >> y0 >> r1 >> r2; SF_Ellipse* ellipse = new SF_Ellipse(x0, y0, r1, r2); ellipse->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); ellipse->SetColors(fg, bg); ellipse->SetBrush(ReadBrush(in)); ellipse->SetPattern(ReadPattern(in)); Transformer* t = ReadTransformer(in); ellipse->SetTransformer(t); Unref(t); SetGraphic(ellipse); }
void PinComp::Read (istream& in) { Connector::Read(in); Coord x0, y0; int mobility; in >> x0 >> y0 >> mobility; PinGraphic* pin = new PinGraphic(x0, y0); _mobility = Mobility(mobility); pin->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); pin->SetColors(fg, bg); pin->SetBrush(ReadBrush(in)); Transformer* t = ReadTransformer(in); pin->SetTransformer(t); Unref(t); SetGraphic(pin); }
void MultiLineComp::Read (istream& in) { VerticesComp::Read(in); Coord* x, *y; int count; ReadVertices(in, x, y, count); SF_MultiLine* ml = new SF_MultiLine(x, y, count); delete x; delete y; ml->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); ml->SetColors(fg, bg); ml->SetBrush(ReadBrush(in)); ml->SetPattern(ReadPattern(in)); Transformer* t = ReadTransformer(in); ml->SetTransformer(t); Unref(t); SetGraphic(ml); }
void SplineComp::Read (istream& in) { VerticesComp::Read(in); Coord* x, *y; int count; ReadVertices(in, x, y, count); SFH_OpenBSpline* spline = new SFH_OpenBSpline(x, y, count); delete x; delete y; spline->FillBg(ReadBgFilled(in)); PSColor* fg = ReadColor(in); PSColor* bg = ReadColor(in); spline->SetColors(fg, bg); spline->SetBrush(ReadBrush(in)); spline->SetPattern(ReadPattern(in)); Transformer* t = ReadTransformer(in); spline->SetTransformer(t); Unref(t); SetGraphic(spline); }