MCPcopy Create free account
hub / github.com/assimp/assimp / AddNodePrefixesChecked

Method AddNodePrefixesChecked

code/Common/SceneCombiner.cpp:145–163  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Add a name prefix to all nodes in a hierarchy if a hash match is found

Source from the content-addressed store, hash-verified

143// ------------------------------------------------------------------------------------------------
144// Add a name prefix to all nodes in a hierarchy if a hash match is found
145void SceneCombiner::AddNodePrefixesChecked(aiNode *node, const char *prefix, unsigned int len,
146 std::vector<SceneHelper> &input, unsigned int cur) {
147 ai_assert(nullptr != prefix);
148
149 const unsigned int hash = SuperFastHash(node->mName.data, static_cast<uint32_t>(node->mName.length));
150
151 // Check whether we find a positive match in one of the given sets
152 for (unsigned int i = 0; i < input.size(); ++i) {
153 if (cur != i && input[i].hashes.find(hash) != input[i].hashes.end()) {
154 PrefixString(node->mName, prefix, len);
155 break;
156 }
157 }
158
159 // Process all children recursively
160 for (unsigned int i = 0; i < node->mNumChildren; ++i) {
161 AddNodePrefixesChecked(node->mChildren[i], prefix, len, input, cur);
162 }
163}
164
165// ------------------------------------------------------------------------------------------------
166// Add an offset to all mesh indices in a node graph

Callers

nothing calls this directly

Calls 4

SuperFastHashFunction · 0.85
PrefixStringFunction · 0.85
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected