本文整理汇总了C++中KisBrushSP::setAutoSpacing方法的典型用法代码示例。如果您正苦于以下问题:C++ KisBrushSP::setAutoSpacing方法的具体用法?C++ KisBrushSP::setAutoSpacing怎么用?C++ KisBrushSP::setAutoSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisBrushSP
的用法示例。
在下文中一共展示了KisBrushSP::setAutoSpacing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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"));
}
bool useAutoSpacing = brushDefinition.attribute("useAutoSpacing", "0").toInt(&result);
if (!result) {
useAutoSpacing = c.toInt(brushDefinition.attribute("useAutoSpacing"));
}
qreal autoSpacingCoeff = brushDefinition.attribute("autoSpacingCoeff", "1.0").toDouble(&result);
if (!result) {
autoSpacingCoeff = c.toDouble(brushDefinition.attribute("autoSpacingCoeff"));
}
KisBrushSP brush = new KisAutoBrush(mask, angle, randomness, density);
brush->setSpacing(spacing);
brush->setAutoSpacing(useAutoSpacing, autoSpacingCoeff);
return brush;
}