本文整理汇总了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;
}
示例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;
}
示例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;
}