本文整理汇总了C++中simtk::xml::Element::appendNode方法的典型用法代码示例。如果您正苦于以下问题:C++ Element::appendNode方法的具体用法?C++ Element::appendNode怎么用?C++ Element::appendNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simtk::xml::Element
的用法示例。
在下文中一共展示了Element::appendNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateFromXMLNode
void ModelComponent::updateFromXMLNode(SimTK::Xml::Element& aNode,
int versionNumber) {
if (versionNumber < XMLDocument::getLatestVersion()) {
if (versionNumber < 30506) {
// geometry list property removed. Everything that was in this list
// should be moved to the components list property.
SimTK::Xml::element_iterator geometry = aNode.element_begin("geometry");
if (geometry != aNode.element_end()) {
// We found a list property of geometry.
SimTK::Xml::Element componentsNode;
SimTK::Xml::element_iterator componentsIt = aNode.element_begin("components");
if (componentsIt == aNode.element_end()) {
// This component does not yet have a list property of
// components, so we'll create one.
componentsNode = SimTK::Xml::Element("components");
aNode.insertNodeBefore(aNode.element_begin(), componentsNode);
} else {
componentsNode = *componentsIt;
}
// Copy each node under <geometry> into <components>.
for (auto geomIt = geometry->element_begin();
geomIt != geometry->element_end(); ++geomIt) {
componentsNode.appendNode(geomIt->clone());
}
// Now that we moved over the geometry, we can delete the
// <geometry> element.
aNode.eraseNode(geometry);
}
}
}
Super::updateFromXMLNode(aNode, versionNumber);
}