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


C++ Graphic31类代码示例

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


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

示例1: getextent_gs

void PolyGraphic::getextent_gs (
    Coord& l, Coord& b, Coord& cx, Coord& cy, float& tol, Graphic31* gs
) {
    Extent e;
    l = b = cx = cy = tol = 0.0;
        
    Graphic31 gstemp;
    Transformer ttemp;
    Extent te;
    gstemp.transformer(&ttemp);

    GlyphIndex count = _body->count();
    for (GlyphIndex i = 0; i < count; i++) {
        Graphic31* gr = (Graphic31*) _body->component(i);
        
        concatgs_(gr, gr, gs, &gstemp);
        concatXform_(gr, nil, gr->transformer(), &ttemp);
        getextent_(gr, te._left, te._bottom, te._cx, te._cy, te._tol, &gstemp);
        e.Merge(te);
    }
    gstemp.transformer(nil); // to avoid deleting ttemp explicitly
    l = e._left; b = e._bottom; cx = l+(e._cx-l)*2.0; cy = b+(e._cy-b)*2.0;
    tol = e._tol;

    Transformer* tx = gs->transformer();
    if (tx != nil) {
        corners(l, b, cx, cy, *tx);
    }
    cx = (cx + l)/2.0;
    cy = (cy + b)/2.0;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:31,代码来源:figure.c

示例2: remove_

void PolyGraphic::remove_ (GlyphIndex i) { 
    Graphic31* gr = (Graphic31*)_body->component(i);
    if (gr != nil) {
        gr->parent(nil);
    }
    _body->remove(i); 
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:7,代码来源:figure.c

示例3: effect

boolean GraphicMaster::effect (const Event& e, Tool31& 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++) {
            Graphic31* 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:jmzaleski,项目名称:ivtools-1.2,代码行数:28,代码来源:figure.c

示例4: GraphicMaster

Glyph* GraphicMaster::clone () const {
    Graphic31* pg = new GraphicMaster((Graphic31*)this);

    GlyphIndex count = _body->count();
    for (GlyphIndex i = 0; i < count; i++) {
        Glyph* gr = _body->component(i);
        pg->append(gr->clone());
    }
    return pg;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:10,代码来源:figure.c

示例5: parent

void Graphic31::parentXform (Transformer& t) {
    Transformer identity;
    Graphic31* p = parent();

    if (p == nil) {
        *(&t) = *(&identity);
    } else {
        p->eqv_transformer(t);
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:10,代码来源:figure.c

示例6: count_

void PolyGraphic::flush () {
    GlyphIndex count = count_();
    
    for (GlyphIndex i = 0; i < count; i++) {
        Graphic31* gr = component_(i);
        concat_(gr, gr, this, gr);
        gr->flush();
    }
    Graphic31 n;
    *((Graphic31*) this) = *(&n);
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:11,代码来源:figure.c

示例7: last_intersecting

Graphic31* PolyGraphic::last_intersecting (BoxObj& b) {
    GlyphIndex count = _body->count();

    for (GlyphIndex i = count-1; i >= 0; i--) {
        Graphic31* gr = (Graphic31*) _body->component(i);

	if (gr->intersects(b)) {
	    return gr;
	}
    }
    return nil;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:12,代码来源:figure.c

示例8: last_containing

Graphic31* PolyGraphic::last_containing (PointObj& pt) {
    GlyphIndex count = _body->count();

    for (GlyphIndex i = count-1; i >= 0; i--) {
        Graphic31* gr = (Graphic31*) _body->component(i);

	if (gr->contains(pt)) {
	    return gr;
	}
    }
    return nil;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:12,代码来源:figure.c

示例9: last_within

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

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

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

示例10: event

boolean GlyphGrabber::event (Event& e) {
    Graphic31* root = _gviewer->root();
    Tool31& tool = _gviewer->tool();
    Canvas* c = e.window()->canvas();
    c->push_clipping();
    c->clip_rect(_a->left(), _a->bottom(), _a->right(), _a->top());
    boolean ok = root->grasp(e, tool);
    Event ev;
    Session* s = Session::instance();
    while(ok) {
        s->read(ev);
        ok = root->manipulating(ev, tool);
    }
    ok = root->effect(ev, tool);
    c->pop_clipping();
    return ok;
}    
开发者ID:barak,项目名称:ivtools-cvs,代码行数:17,代码来源:glyphviewer.c

示例11: switch

boolean GraphicMaster::grasp (const Event& e, Tool31& tool) {
    if (window_cursor == nil) {
        window_cursor = e.window()->cursor();
    }
    boolean flag = false;
    unsigned int tool_type = tool.tool();
    switch (tool_type) {
    case Tool31::move:
    case Tool31::scale:
    case Tool31::rotate:
        {
            float tol = 2.0;
            BoxObj box(
                e.pointer_x()-tol, e.pointer_y()-tol, 
                e.pointer_x()+tol, e.pointer_y()+tol
            );
            Graphic31* 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:jmzaleski,项目名称:ivtools-1.2,代码行数:45,代码来源:figure.c

示例12: intersects_gs

boolean PolyGraphic::intersects_gs (BoxObj& box, Graphic31* gs) {
    GlyphIndex count = _body->count();
    Graphic31 gstemp;
    Transformer ttemp;

    gstemp.transformer(&ttemp);
    for (GlyphIndex i = 0; i < count; i++) {
        Graphic31* gr = (Graphic31*) _body->component(i);
        concat_(gr, gr, gs, &gstemp);
        
        if (intersects_(gr, box, &gstemp)) {
            gstemp.transformer(nil);
            return true;
        }
    }
    gstemp.transformer(nil); /* to avoid deleting ttemp explicitly*/
    return false;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:18,代码来源:figure.c

示例13: Transformer

void Graphic31::draw(Canvas* c, const Allocation& a) const {
    if (c != nil) {
        boolean no_transformer = !_t;
        if (no_transformer) {
	  ((Graphic31*)this)->_t = new Transformer();
	  _t->Translate(a.x(), a.y());
	}
	Graphic31* gr = (Graphic31*) this;
        CanvasDamage& cd = c->rep()->damage_;
        gr->drawclipped(
            c, cd.left, cd.bottom, cd.right, cd.top
        );
	if (no_transformer) {
	  _t->Translate(-a.x(), -a.y());
	  delete _t;
	  ((Graphic31*)this)->_t = nil;
	}
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:19,代码来源:figure.c

示例14: manipulating

boolean GraphicMaster::manipulating (const Event& e, Tool31& 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++) {
        Graphic31* 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:jmzaleski,项目名称:ivtools-1.2,代码行数:24,代码来源:figure.c

示例15: replace_

void PolyGraphic::replace_ (GlyphIndex i, Graphic31* g) { 
    Graphic31* gr = (Graphic31*) _body->component(i);
    gr->parent(nil);
    _body->replace(i, g); 
    g->parent(this);
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:6,代码来源:figure.c


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