---------------------------------------------------------------
| 60 | |
| 61 | //--------------------------------------------------------------- |
| 62 | bool ExportSceneGraph::create ( bool exportSelection ) |
| 63 | { |
| 64 | mExportSelection = exportSelection; |
| 65 | |
| 66 | if ( mRootExportNode ) |
| 67 | delete mRootExportNode; |
| 68 | |
| 69 | bool isNotEmpty; |
| 70 | mRootExportNode = create ( mRootNode, 0, isNotEmpty ); |
| 71 | |
| 72 | findReferencedObjects(mRootExportNode); |
| 73 | |
| 74 | bool shouldExportXRefedFiles = mDocumentExporter.getOptions().getIncludeXRefs(); |
| 75 | bool shouldAddInstanceNodesForXRefs = true; |
| 76 | |
| 77 | int xRefFileCount = mRootNode->GetXRefFileCount(); |
| 78 | |
| 79 | for ( int i = 0; i < xRefFileCount; ++i) |
| 80 | { |
| 81 | #ifdef MAX_2010_OR_NEWER |
| 82 | if ( mRootNode->GetXRefFlags(i) & XREF_DISABLED ) |
| 83 | { |
| 84 | continue; |
| 85 | } |
| 86 | #endif |
| 87 | |
| 88 | #ifdef MAX_2010_OR_NEWER |
| 89 | #ifdef UNICODE |
| 90 | std::string XRefFileNameString = COLLADABU::StringUtils::wideString2utf8String(mRootNode->GetXRefFile(i).GetFileName().data()); |
| 91 | const char* XRefFileName = XRefFileNameString.c_str(); |
| 92 | #else |
| 93 | const char* XRefFileName = mRootNode->GetXRefFile(i).GetFileName().data(); |
| 94 | #endif |
| 95 | #else |
| 96 | const char* XRefFileName = mRootNode->GetXRefFileName(i).data(); |
| 97 | #endif |
| 98 | COLLADASW::URI uri(COLLADASW::URI::nativePathToUri(NativeString(XRefFileName))); |
| 99 | |
| 100 | XRefSceneGraph xRefScene; |
| 101 | xRefScene.exportFileBaseName = mXRefExportFileNames.addId(uri.getPathFileBase(), false); |
| 102 | xRefScene.exportSceneGraph = new ExportSceneGraph(mRootNode->GetXRefTree(i), uri, mDocumentExporter, mXRefExportFileNames); |
| 103 | |
| 104 | INode* xRefParent = mRootNode->GetXRefParent(i); |
| 105 | |
| 106 | if ( shouldAddInstanceNodesForXRefs ) |
| 107 | { |
| 108 | mINodeXRefSceneGraphListMap[xRefParent ? xRefParent : mRootNode].push_back(xRefScene); |
| 109 | |
| 110 | isNotEmpty = true; |
| 111 | } |
| 112 | |
| 113 | if ( shouldExportXRefedFiles ) |
| 114 | { |
| 115 | if ( xRefScene.exportSceneGraph->create(false) ) |
| 116 | { |
| 117 | isNotEmpty = true; |
| 118 | } |
| 119 | } |
nothing calls this directly
no test coverage detected