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


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

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


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

示例1: effect

boolean GraphicMaster::effect (const Event& e, Tool& tool) {
    boolean flag = true;
    Window* w = e.window();
    if (w != nil) {
        w->cursor(window_cursor);
        Canvas* c = w->canvas();
        long count = _gr_list->count();
        Coord l, b, r, t;
        for (long i = 0; i < count && flag; i++) {
            Graphic* target = _gr_list->item(i);
            target->getbounds(l, b, r, t);
            c->damage(l, b, r, t);
            flag = target->effect(e, tool);
            if (flag) {
                target->getbounds(l, b, r, t);
                c->damage(l, b, r, t);
            }
            target->flush();
            CanvasRep& rep = *c->rep();
            CanvasDamage& cd = rep.damage_;
            rep.start_repair();
            drawclipped(c, cd.left, cd.bottom, cd.right, cd.top);
            rep.finish_repair();
        }
        _gr_list->remove_all();
    } 
    return flag;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:28,代码来源:figure.c

示例2: grasp

boolean GraphicMaster::grasp (const Event& e, Tool& tool) {
    if (window_cursor == nil) {
        window_cursor = e.window()->cursor();
    }
    boolean flag = false;
    unsigned int tool_type = tool.tool();
    switch (tool_type) {
    case Tool::move:
    case Tool::scale:
    case Tool::rotate:
        {
            float tol = 2.0;
            BoxObj box(
                e.pointer_x()-tol, e.pointer_y()-tol, 
                e.pointer_x()+tol, e.pointer_y()+tol
            );
            Graphic* target = last_intersecting(box);
            if (target != nil) {
                Window* w = e.window();
                Canvas* c = w->canvas();
                w->cursor(grabber_cursor);

                ToolState& ts = tool.toolstate();
                total_gs(ts._gs);

                _gr_list->append(target);
                Coord l, b, r, t;
                target->getbounds(l, b, r, t);
                c->damage(l, b, r, t);
                flag = target->grasp(e, tool);
                if (flag) {
                    target->getbounds(l, b, r, t);
                    c->damage(l, b, r, t);
                }
                CanvasRep& rep = *c->rep();
                CanvasDamage& cd = rep.damage_;
                rep.start_repair();
                drawclipped(c, cd.left, cd.bottom, cd.right, cd.top);
                rep.finish_repair();
            }
            break;
        } 
    }
    return flag;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:45,代码来源:figure.c

示例3: manipulating

boolean GraphicMaster::manipulating (const Event& e, Tool& tool) {
    boolean flag = true;
    long count = _gr_list->count();
    Coord l, b, r, t;
    Window* w = e.window();
    Canvas* c = w->canvas();
    for (long i = 0; i < count && flag; i++) {
        Graphic* target = _gr_list->item(i);
        target->getbounds(l, b, r, t);
        c->damage(l, b, r, t);
        flag = target->manipulating(e, tool);
        if (flag) {
            target->getbounds(l, b, r, t);
            c->damage(l, b, r, t);
        }
        CanvasRep& rep = *c->rep();
        CanvasDamage& cd = rep.damage_;
        rep.start_repair();
        drawclipped(c, cd.left, cd.bottom, cd.right, cd.top);
        rep.finish_repair();
        w->display()->flush();
    }
    return flag;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:24,代码来源:figure.c

示例4: last_within

Graphic* PolyGraphic::last_within (BoxObj& gb) {
    GlyphIndex count = _body->count();
    Coord l, b, r, t;

    for (GlyphIndex i = count-1; i >= 0; i--) {
        Graphic* gr = (Graphic*) _body->component(i);
        gr->getbounds(l, b, r, t);

        BoxObj box(l, b, r, t);
	if (box.Within(gb)) {
	    return gr;
	}
    }
    return nil;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:15,代码来源:figure.c


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