Example #1
0
boolean PSLink::Definition (ostream& out) {
    LinkComp* comp = (LinkComp*) GetSubject();
    Graphic* link = comp->GetGraphic();
    Line* line = comp->GetLine();

    Transformer* link_t = link->GetTransformer();
    Transformer* line_t = line->GetTransformer();
    Transformer* temp_t = new Transformer(line_t);

    Resource::ref(link_t);
    temp_t->postmultiply(*link_t);
    link->SetTransformer(temp_t);

    Coord x0, y0, x1, y1;
    line->GetOriginal(x0, y0, x1, y1);

    out << "Begin " << MARK << " Line\n";
    MinGS(out);
    out << MARK << "\n";
    out << x0 << " " << y0 << " " << x1 << " " << y1 << " Line\n";
    out << "End\n\n";

    link->SetTransformer(link_t);
    Resource::unref(link_t);
    Resource::unref(temp_t);

    return out.good();
}
Example #2
0
File: line.cpp Project: PNCG/neuron
bool PSLine::Definition (ostream& out) {
    Coord x0, y0, x1, y1;

    LineComp* comp = (LineComp*) GetSubject();
    comp->GetLine()->GetOriginal(x0, y0, x1, y1);

    out << "Begin " << MARK << " Line\n";
    MinGS(out);
    out << MARK << "\n";
    out << x0 << " " << y0 << " " << x1 << " " << y1 << " Line\n";
    out << "End\n\n";

    return out.good();
}    
Example #3
0
File: rect.cpp Project: PNCG/neuron
bool PSRect::Definition (ostream& out) {
    Coord l, b, r, t;

    RectComp* comp = (RectComp*) GetSubject();
    comp->GetRect()->GetOriginal(l, b, r, t);

    out << "Begin " << MARK << " Rect\n";
    MinGS(out);
    out << MARK << "\n";
    out << l << " " << b << " " << r << " " << t << " Rect\n";
    out << "End\n\n";

    return out.good();
}
Example #4
0
bool PSEllipse::Definition (ostream& out) {
    Coord x0, y0;
    int rx, ry;

    EllipseComp* comp = (EllipseComp*) GetSubject();
    comp->GetEllipse()->GetOriginal(x0, y0, rx, ry);

    out << "Begin " << MARK << " Elli\n";
    MinGS(out);
    out << MARK << "\n";
    out << x0 << " " << y0 << " " << rx << " " << ry << " Elli\n";
    out << "End\n\n";

    return out.good();
}
Example #5
0
boolean PSArrowLine::Definition (ostream& out) {
    ArrowLineComp* comp = (ArrowLineComp*) GetSubject();
    ArrowLine* aline = comp->GetArrowLine();

    Coord x0, y0, x1, y1;
    aline->GetOriginal(x0, y0, x1, y1);
    float arrow_scale = aline->ArrowScale();

    out << "Begin " << MARK << " Line\n";
    MinGS(out);
    out << MARK << "\n";
    out << x0 << " " << y0 << " " << x1 << " " << y1 << " Line\n";
    out << MARK << " " << arrow_scale << "\n";
    out << "End\n\n";

    return out.good();
}
Example #6
0
boolean PSArrowSpline::Definition (ostream& out) {
    ArrowSplineComp* comp = (ArrowSplineComp*) GetSubject();
    ArrowOpenBSpline* aml = comp->GetArrowOpenBSpline();

    const Coord* x, *y;
    int n = aml->GetOriginal(x, y);
    float arrow_scale = aml->ArrowScale();

    out << "Begin " << MARK << " " << Name() << "\n";
    MinGS(out);
    out << MARK << " " << n << "\n";
    for (int i = 0; i < n; i++) {
        out << x[i] << " " << y[i] << "\n";
    }
    out << n << " " << Name() << "\n";
    out << MARK << " " << arrow_scale << "\n";
    out << "End\n\n";

    return out.good();
}