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


C++ KisBrushSP::setSpacing方法代码示例

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


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

示例1: getOrCreateBrush

KisBrushSP KisPredefinedBrushFactory::getOrCreateBrush(const QDomElement& brushDefinition)
{
    KoResourceServer<KisBrush> *rServer = KisBrushServer::instance()->brushServer();
    QString brushFileName = brushDefinition.attribute("filename", "");
    KisBrushSP brush = rServer->resourceByFilename(brushFileName);

    //Fallback for files that still use the old format
    if(!brush) {
        QFileInfo info(brushFileName);
        brush = rServer->resourceByFilename(info.fileName());
    }

    if(!brush) {
        brush = rServer->resources().first();
    }

    Q_ASSERT(brush);

    double spacing = brushDefinition.attribute("spacing", "0.25").toDouble();
    brush->setSpacing(spacing);

    double angle = brushDefinition.attribute("angle", "0.0").toDouble();
    brush->setAngle(angle);

    double scale = brushDefinition.attribute("scale", "1.0").toDouble();
    brush->setScale(scale);

    return brush;
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:29,代码来源:kis_predefined_brush_factory.cpp

示例2: getOrCreateBrush

KisBrushSP KisAutoBrushFactory::getOrCreateBrush(const QDomElement& brushDefinition)
{
    KisMaskGenerator* mask = KisMaskGenerator::fromXML(brushDefinition.firstChildElement("MaskGenerator"));
    bool result;
    QLocale c(QLocale::German);

    double angle = brushDefinition.attribute("angle", "0.0").toDouble(&result);
    if (!result) {
        angle = c.toDouble(brushDefinition.attribute("angle"));
    }

    double randomness = brushDefinition.attribute("randomness", "0.0").toDouble(&result);
    if (!result) {
        randomness = c.toDouble(brushDefinition.attribute("randomness"));
    }

    qreal density = brushDefinition.attribute("density", "1.0").toDouble(&result);
    if (!result) {
        density = c.toDouble(brushDefinition.attribute("density"));
    }

    double spacing = brushDefinition.attribute("spacing", "1.0").toDouble(&result);
    if (!result) {
        spacing = c.toDouble(brushDefinition.attribute("spacing"));
    }

    KisBrushSP brush = new KisAutoBrush(mask, angle, randomness, density);
    brush->setSpacing(spacing);
    return brush;
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例3: getOrCreateBrush

KisBrushSP KisAbrBrushFactory::getOrCreateBrush(const QDomElement& brushDefinition)
{
    KoResourceServer<KisBrush>* rServer = KisBrushServer::instance()->brushServer();
    QString brushName = brushDefinition.attribute("name", "test_1");
    
    KisBrushSP brush = rServer->getResourceByName(brushName);
    if (!brush){
        return 0;
    }
    
    double spacing = brushDefinition.attribute("spacing", "0.25").toDouble();
    brush->setSpacing(spacing);

    return brush;

}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:16,代码来源:kis_abr_brush_factory.cpp


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