| 772 | } |
| 773 | |
| 774 | XMLWriter::XMLWriter(Ref<SceneGraph::Node> root, const FileName& fileName, bool embedTextures, bool referenceMaterials, bool binaryFormat) |
| 775 | : ident(0), currentNodeID(0), embedTextures(embedTextures), referenceMaterials(referenceMaterials), binaryFormat(binaryFormat) |
| 776 | { |
| 777 | xml.exceptions (std::fstream::failbit | std::fstream::badbit); |
| 778 | xml.open (fileName, std::fstream::out); |
| 779 | |
| 780 | if (binaryFormat) |
| 781 | { |
| 782 | const FileName binFileName = fileName.addExt(".bin"); |
| 783 | bin.exceptions (std::fstream::failbit | std::fstream::badbit); |
| 784 | bin.open (binFileName, std::fstream::out | std::fstream::binary); |
| 785 | } |
| 786 | |
| 787 | xml << "<?xml version=\"1.0\"?>" << std::endl; |
| 788 | root->calculateInDegree(); |
| 789 | open("scene"); |
| 790 | store(root); |
| 791 | close("scene"); |
| 792 | root->resetInDegree(); |
| 793 | } |
| 794 | |
| 795 | void SceneGraph::storeXML(Ref<SceneGraph::Node> root, const FileName& fileName, bool embedTextures, bool referenceMaterials, bool binaryFormat) { |
| 796 | XMLWriter(root,fileName,embedTextures,referenceMaterials,binaryFormat); |
nothing calls this directly
no test coverage detected