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


C++ device::label方法代码示例

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


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

示例1: draw

/**
 * Draw the enlarged schema. This methods can only
 * be called after the block have been placed
 */
void decorateSchema::draw(device& dev)
{
    assert(placed());

    fSchema->draw(dev);
#if 0
    // draw enlarge input wires
    for (unsigned int i=0; i<inputs(); i++) {
        point p = inputPoint(i);
        point q = fSchema->inputPoint(i);
        dev.trait(p.x, p.y, q.x, q.y);
    }

    // draw enlarge output wires
    for (unsigned int i=0; i<outputs(); i++) {
        point p = outputPoint(i);
        point q = fSchema->outputPoint(i);
        dev.trait(p.x, p.y, q.x, q.y);
    }
#endif
    // define the coordinates of the frame
    double tw = (2+fText.size())*dLetter*0.75;
    double x0 = x() + fMargin/2;				// left
    double y0 = y() + fMargin/2;				// top
    double x1 = x() + width() - fMargin/2;		// right
    double y1 = y() + height() - fMargin/2;		// bottom
    //double tl = x0 + 2*dWire;					// left of text zone
    double tl = x() + fMargin;					// left of text zone
    double tr = min(tl+tw, x1);					// right of text zone

    // draw the surronding frame
    dev.dasharray(x0, y0, x0, y1);				// left line
    dev.dasharray(x0, y1, x1, y1);				// bottom line
    dev.dasharray(x1, y1, x1, y0);				// right line
    dev.dasharray(x0, y0, tl, y0);				// top segment before text
    dev.dasharray(tr, y0, x1, y0);				// top segment after text

    // draw the label
    dev.label(tl, y0, fText.c_str());	//
}
开发者ID:EBone,项目名称:faust-1,代码行数:44,代码来源:decorateSchema.cpp


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