当前位置: 首页>>代码示例>>C++>>正文


C++ Graphic::SetTransformer方法代码示例

本文整理汇总了C++中Graphic::SetTransformer方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::SetTransformer方法的具体用法?C++ Graphic::SetTransformer怎么用?C++ Graphic::SetTransformer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Graphic的用法示例。


在下文中一共展示了Graphic::SetTransformer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Definition

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();
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:28,代码来源:link.c

示例2: Picture

LinkComp::LinkComp (Line* line) {
    if (line != nil) {
        Coord x0, y0, x1, y1;
        float fx0, fy0, fx1, fy1;

        line->GetOriginal(x0, y0, x1, y1);
        Transformer* t = line->GetTransformer();
        Graphic* parent = new Picture(line);
        parent->SetTransformer(nil);

        if (t == nil) {
            fx0 = x0; fy0 = y0; fx1 = x1; fy1 = y1;
        } else {
            t->Transform(float(x0), float(y0), fx0, fy0);
            t->Transform(float(x1), float(y1), fx1, fy1);
        }
        delete line;
        line = new Line(0, 0, 1, 1);
        InitLine(line, fx0, fy0, fx1, fy1);

        PinGraphic* pg1 = new PinGraphic;
        PinGraphic* pg2 = new PinGraphic;
        pg1->SetBrush(psnonebr);
        pg2->SetBrush(psnonebr);
        pg1->Translate(fx0, fy0);
        pg2->Translate(fx1, fy1);

        _conn1 = new PinComp(pg1);
        _conn2 = new PinComp(pg2);

        parent->Append(line, pg1, pg2);
        SetGraphic(parent);
    }
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:34,代码来源:link.c

示例3: Read

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);
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:26,代码来源:link.c


注:本文中的Graphic::SetTransformer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。