Added support for stripping all by text nodes from a p3d xml file, and merging of an original and stripped p3d xml file for the purpose of using external editors to fix spelling mistakes

This commit is contained in:
Robert Osfield
2010-04-30 19:42:43 +00:00
parent 400aa8ebcd
commit ed5f0578b8
3 changed files with 207 additions and 0 deletions

View File

@@ -436,6 +436,31 @@ int main( int argc, char **argv )
return 1;
}
if (arguments.read("--strip-text",filename))
{
p3d::XmlPatcher patcher;
// patcher.stripP3dXml(filename, osg::notify(osg::NOTICE));
osg::ref_ptr<osgDB::XmlNode> newNode = patcher.simplifyP3dXml(filename);
if (newNode.valid())
{
newNode->write(std::cout);
}
return 1;
}
std::string lhs_filename, rhs_filename;
if (arguments.read("--merge",lhs_filename, rhs_filename))
{
p3d::XmlPatcher patcher;
osg::ref_ptr<osgDB::XmlNode> newNode = patcher.mergeP3dXml(lhs_filename, rhs_filename);
if (newNode.valid())
{
newNode->write(std::cout);
}
return 1;
}
// construct the viewer.
osgViewer::Viewer viewer(arguments);