本文整理汇总了C++中EFXFixture::loadXML方法的典型用法代码示例。如果您正苦于以下问题:C++ EFXFixture::loadXML方法的具体用法?C++ EFXFixture::loadXML怎么用?C++ EFXFixture::loadXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFXFixture
的用法示例。
在下文中一共展示了EFXFixture::loadXML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadXML
bool EFX::loadXML(const QDomElement& root)
{
if (root.tagName() != KXMLQLCFunction)
{
qWarning() << "Function node not found!";
return false;
}
if (root.attribute(KXMLQLCFunctionType) != typeToString(Function::EFX))
{
qWarning("Function is not an EFX!");
return false;
}
/* Load EFX contents */
QDomNode node = root.firstChild();
while (node.isNull() == false)
{
QDomElement tag = node.toElement();
if (tag.tagName() == KXMLQLCBus)
{
/* Bus */
QString str = tag.attribute(KXMLQLCBusRole);
if (str == KXMLQLCBusFade)
m_legacyFadeBus = tag.text().toUInt();
else if (str == KXMLQLCBusHold)
m_legacyHoldBus = tag.text().toUInt();
}
else if (tag.tagName() == KXMLQLCFunctionSpeed)
{
loadXMLSpeed(tag);
}
else if (tag.tagName() == KXMLQLCEFXFixture)
{
EFXFixture* ef = new EFXFixture(this);
ef->loadXML(tag);
if (ef->fixture() != Fixture::invalidId())
{
if (addFixture(ef) == false)
delete ef;
}
}
else if (tag.tagName() == KXMLQLCEFXPropagationMode)
{
/* Propagation mode */
setPropagationMode(stringToPropagationMode(tag.text()));
}
else if (tag.tagName() == KXMLQLCEFXAlgorithm)
{
/* Algorithm */
setAlgorithm(stringToAlgorithm(tag.text()));
}
else if (tag.tagName() == KXMLQLCFunctionDirection)
{
loadXMLDirection(tag);
}
else if (tag.tagName() == KXMLQLCFunctionRunOrder)
{
loadXMLRunOrder(tag);
}
else if (tag.tagName() == KXMLQLCEFXWidth)
{
/* Width */
setWidth(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXHeight)
{
/* Height */
setHeight(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXRotation)
{
/* Rotation */
setRotation(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXStartOffset)
{
/* StartOffset */
setStartOffset(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXAxis)
{
/* Axes */
loadXMLAxis(tag);
}
else
{
qWarning() << "Unknown EFX tag:" << tag.tagName();
}
node = node.nextSibling();
}
return true;
}
示例2: loadXML
bool EFX::loadXML(const QDomElement* root)
{
QString str;
QDomNode node;
QDomElement tag;
Q_ASSERT(root != NULL);
if (root->tagName() != KXMLQLCFunction)
{
qWarning() << "Function node not found!";
return false;
}
/* Load EFX contents */
node = root->firstChild();
while (node.isNull() == false)
{
tag = node.toElement();
if (tag.tagName() == KXMLQLCBus)
{
/* Bus */
str = tag.attribute(KXMLQLCBusRole);
setBus(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXFixture)
{
EFXFixture* ef = new EFXFixture(this);
ef->loadXML(&tag);
if (ef->fixture() != KNoID)
{
if (addFixture(ef) == false)
delete ef;
}
}
else if (tag.tagName() == KXMLQLCEFXPropagationMode)
{
/* Propagation mode */
setPropagationMode(stringToPropagationMode(tag.text()));
}
else if (tag.tagName() == KXMLQLCEFXAlgorithm)
{
/* Algorithm */
setAlgorithm(tag.text());
}
else if (tag.tagName() == KXMLQLCFunctionDirection)
{
/* Direction */
setDirection(Function::stringToDirection(tag.text()));
}
else if (tag.tagName() == KXMLQLCFunctionRunOrder)
{
/* Run Order */
setRunOrder(Function::stringToRunOrder(tag.text()));
}
else if (tag.tagName() == KXMLQLCEFXWidth)
{
/* Width */
setWidth(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXHeight)
{
/* Height */
setHeight(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXRotation)
{
/* Rotation */
setRotation(tag.text().toInt());
}
else if (tag.tagName() == KXMLQLCEFXStartScene)
{
/* Start scene */
setStartScene(tag.text().toInt());
if (tag.attribute(KXMLQLCFunctionEnabled) ==
KXMLQLCTrue)
setStartSceneEnabled(true);
else
setStartSceneEnabled(false);
}
else if (tag.tagName() == KXMLQLCEFXStopScene)
{
/* Stop scene */
setStopScene(tag.text().toInt());
if (tag.attribute(KXMLQLCFunctionEnabled) ==
KXMLQLCTrue)
setStopSceneEnabled(true);
else
setStopSceneEnabled(false);
}
else if (tag.tagName() == KXMLQLCEFXAxis)
{
/* Axes */
loadXMLAxis(&tag);
}
else
{
//.........这里部分代码省略.........
示例3: loadXML
bool EFX::loadXML(QXmlStreamReader &root)
{
if (root.name() != KXMLQLCFunction)
{
qWarning() << "Function node not found!";
return false;
}
if (root.attributes().value(KXMLQLCFunctionType).toString() != typeToString(Function::EFX))
{
qWarning("Function is not an EFX!");
return false;
}
/* Load EFX contents */
while (root.readNextStartElement())
{
if (root.name() == KXMLQLCBus)
{
/* Bus */
QString str = root.attributes().value(KXMLQLCBusRole).toString();
if (str == KXMLQLCBusFade)
m_legacyFadeBus = root.readElementText().toUInt();
else if (str == KXMLQLCBusHold)
m_legacyHoldBus = root.readElementText().toUInt();
}
else if (root.name() == KXMLQLCFunctionSpeed)
{
loadXMLSpeed(root);
}
else if (root.name() == KXMLQLCEFXFixture)
{
EFXFixture* ef = new EFXFixture(this);
ef->loadXML(root);
if (ef->head().isValid())
{
if (addFixture(ef) == false)
delete ef;
}
}
else if (root.name() == KXMLQLCEFXPropagationMode)
{
/* Propagation mode */
setPropagationMode(stringToPropagationMode(root.readElementText()));
}
else if (root.name() == KXMLQLCEFXAlgorithm)
{
/* Algorithm */
setAlgorithm(stringToAlgorithm(root.readElementText()));
}
else if (root.name() == KXMLQLCFunctionDirection)
{
loadXMLDirection(root);
}
else if (root.name() == KXMLQLCFunctionRunOrder)
{
loadXMLRunOrder(root);
}
else if (root.name() == KXMLQLCEFXWidth)
{
/* Width */
setWidth(root.readElementText().toInt());
}
else if (root.name() == KXMLQLCEFXHeight)
{
/* Height */
setHeight(root.readElementText().toInt());
}
else if (root.name() == KXMLQLCEFXRotation)
{
/* Rotation */
setRotation(root.readElementText().toInt());
}
else if (root.name() == KXMLQLCEFXStartOffset)
{
/* StartOffset */
setStartOffset(root.readElementText().toInt());
}
else if (root.name() == KXMLQLCEFXIsRelative)
{
/* IsRelative */
setIsRelative(root.readElementText().toInt() != 0);
}
else if (root.name() == KXMLQLCEFXAxis)
{
/* Axes */
loadXMLAxis(root);
}
else
{
qWarning() << "Unknown EFX tag:" << root.name();
root.skipCurrentElement();
}
}
return true;
}