本文整理汇总了C++中SVGNumberList::parse方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGNumberList::parse方法的具体用法?C++ SVGNumberList::parse怎么用?C++ SVGNumberList::parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGNumberList
的用法示例。
在下文中一共展示了SVGNumberList::parse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseAttribute
void SVGFEColorMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value);
return;
}
if (name == SVGNames::typeAttr) {
ColorMatrixType propertyValue = SVGPropertyTraits<ColorMatrixType>::fromString(value);
if (propertyValue > 0)
setTypeBaseValue(propertyValue);
return;
}
if (name == SVGNames::inAttr) {
setIn1BaseValue(value);
return;
}
if (name == SVGNames::valuesAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedValuesListWrappers(newList.size());
setValuesBaseValue(newList);
return;
}
ASSERT_NOT_REACHED();
}
示例2: parseMappedAttribute
void SVGTextPositioningElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == SVGNames::xAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeWidth);
detachAnimatedXListWrappers(newList.size());
setXBaseValue(newList);
} else if (attr->name() == SVGNames::yAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeHeight);
detachAnimatedYListWrappers(newList.size());
setYBaseValue(newList);
} else if (attr->name() == SVGNames::dxAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeWidth);
detachAnimatedDxListWrappers(newList.size());
setDxBaseValue(newList);
} else if (attr->name() == SVGNames::dyAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeHeight);
detachAnimatedDyListWrappers(newList.size());
setDyBaseValue(newList);
} else if (attr->name() == SVGNames::rotateAttr) {
SVGNumberList newList;
newList.parse(attr->value());
detachAnimatedRotateListWrappers(newList.size());
setRotateBaseValue(newList);
} else
SVGTextContentElement::parseMappedAttribute(attr);
}
示例3: parseMappedAttribute
void SVGComponentTransferFunctionElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::typeAttr) {
if (value == "identity")
setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_IDENTITY);
else if (value == "table")
setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_TABLE);
else if (value == "discrete")
setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_DISCRETE);
else if (value == "linear")
setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_LINEAR);
else if (value == "gamma")
setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_GAMMA);
} else if (attr->name() == SVGNames::tableValuesAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedTableValuesListWrappers(newList.size());
setTableValuesBaseValue(newList);
} else if (attr->name() == SVGNames::slopeAttr)
setSlopeBaseValue(value.toFloat());
else if (attr->name() == SVGNames::interceptAttr)
setInterceptBaseValue(value.toFloat());
else if (attr->name() == SVGNames::amplitudeAttr)
setAmplitudeBaseValue(value.toFloat());
else if (attr->name() == SVGNames::exponentAttr)
setExponentBaseValue(value.toFloat());
else if (attr->name() == SVGNames::offsetAttr)
setOffsetBaseValue(value.toFloat());
else
SVGElement::parseMappedAttribute(attr);
}
示例4: parseAttribute
void SVGTextPositioningElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
SVGTextContentElement::parseAttribute(name, value);
return;
}
if (name == SVGNames::xAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeWidth);
detachAnimatedXListWrappers(newList.size());
setXBaseValue(newList);
return;
}
if (name == SVGNames::yAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeHeight);
detachAnimatedYListWrappers(newList.size());
setYBaseValue(newList);
return;
}
if (name == SVGNames::dxAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeWidth);
detachAnimatedDxListWrappers(newList.size());
setDxBaseValue(newList);
return;
}
if (name == SVGNames::dyAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeHeight);
detachAnimatedDyListWrappers(newList.size());
setDyBaseValue(newList);
return;
}
if (name == SVGNames::rotateAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedRotateListWrappers(newList.size());
setRotateBaseValue(newList);
return;
}
ASSERT_NOT_REACHED();
}
示例5: parseMappedAttribute
void SVGFEConvolveMatrixElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
setIn1BaseValue(value);
else if (attr->name() == SVGNames::orderAttr) {
float x, y;
if (parseNumberOptionalNumber(value, x, y)) {
setOrderXBaseValue(x);
setOrderYBaseValue(y);
}
} else if (attr->name() == SVGNames::edgeModeAttr) {
if (value == "duplicate")
setEdgeModeBaseValue(EDGEMODE_DUPLICATE);
else if (value == "wrap")
setEdgeModeBaseValue(EDGEMODE_WRAP);
else if (value == "none")
setEdgeModeBaseValue(EDGEMODE_NONE);
} else if (attr->name() == SVGNames::kernelMatrixAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedKernelMatrixListWrappers(newList.size());
kernelMatrixBaseValue() = newList;
} else if (attr->name() == SVGNames::divisorAttr)
setDivisorBaseValue(value.toFloat());
else if (attr->name() == SVGNames::biasAttr)
setBiasBaseValue(value.toFloat());
else if (attr->name() == SVGNames::targetXAttr)
setTargetXBaseValue(value.toUIntStrict());
else if (attr->name() == SVGNames::targetYAttr)
setTargetYBaseValue(value.toUIntStrict());
else if (attr->name() == SVGNames::kernelUnitLengthAttr) {
float x, y;
if (parseNumberOptionalNumber(value, x, y)) {
setKernelUnitLengthXBaseValue(x);
setKernelUnitLengthYBaseValue(y);
}
} else if (attr->name() == SVGNames::preserveAlphaAttr) {
if (value == "true")
setPreserveAlphaBaseValue(true);
else if (value == "false")
setPreserveAlphaBaseValue(false);
} else
SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
}
示例6: parseAttribute
void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value);
return;
}
if (name == SVGNames::inAttr) {
setIn1BaseValue(value);
return;
}
if (name == SVGNames::orderAttr) {
float x, y;
if (parseNumberOptionalNumber(value, x, y) && x >= 1 && y >= 1) {
setOrderXBaseValue(x);
setOrderYBaseValue(y);
} else
document().accessSVGExtensions()->reportWarning(
"feConvolveMatrix: problem parsing order=\"" + value
+ "\". Filtered element will not be displayed.");
return;
}
if (name == SVGNames::edgeModeAttr) {
EdgeModeType propertyValue = SVGPropertyTraits<EdgeModeType>::fromString(value);
if (propertyValue > 0)
setEdgeModeBaseValue(propertyValue);
else
document().accessSVGExtensions()->reportWarning(
"feConvolveMatrix: problem parsing edgeMode=\"" + value
+ "\". Filtered element will not be displayed.");
return;
}
if (name == SVGNames::kernelMatrixAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedKernelMatrixListWrappers(newList.size());
setKernelMatrixBaseValue(newList);
return;
}
if (name == SVGNames::divisorAttr) {
float divisor = value.toFloat();
if (divisor)
setDivisorBaseValue(divisor);
else
document().accessSVGExtensions()->reportWarning(
"feConvolveMatrix: problem parsing divisor=\"" + value
+ "\". Filtered element will not be displayed.");
return;
}
if (name == SVGNames::biasAttr) {
setBiasBaseValue(value.toFloat());
return;
}
if (name == SVGNames::targetXAttr) {
setTargetXBaseValue(value.string().toUIntStrict());
return;
}
if (name == SVGNames::targetYAttr) {
setTargetYBaseValue(value.string().toUIntStrict());
return;
}
if (name == SVGNames::kernelUnitLengthAttr) {
float x, y;
if (parseNumberOptionalNumber(value, x, y) && x > 0 && y > 0) {
setKernelUnitLengthXBaseValue(x);
setKernelUnitLengthYBaseValue(y);
} else
document().accessSVGExtensions()->reportWarning(
"feConvolveMatrix: problem parsing kernelUnitLength=\"" + value
+ "\". Filtered element will not be displayed.");
return;
}
if (name == SVGNames::preserveAlphaAttr) {
if (value == "true")
setPreserveAlphaBaseValue(true);
else if (value == "false")
setPreserveAlphaBaseValue(false);
else
document().accessSVGExtensions()->reportWarning(
"feConvolveMatrix: problem parsing preserveAlphaAttr=\"" + value
+ "\". Filtered element will not be displayed.");
return;
}
ASSERT_NOT_REACHED();
}