MCPcopy Create free account
hub / github.com/RenderKit/embree / XMLWriter

Method XMLWriter

tutorials/common/scenegraph/xml_writer.cpp:774–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 5

storeFunction · 0.85
addExtMethod · 0.80
calculateInDegreeMethod · 0.80
resetInDegreeMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected