Skip to content

Commit

Permalink
replace invalid characters in VRML string with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 21, 2016
1 parent 9b33f41 commit 928cc7b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Gui/ViewProvider.cpp
Expand Up @@ -265,7 +265,21 @@ SbMatrix ViewProvider::convert(const Base::Matrix4D &rcMatrix) const

void ViewProvider::addDisplayMaskMode(SoNode *node, const char* type)
{
node->setName(type);
if (type) {
std::string name = type;
for (std::string::iterator it = name.begin(); it != name.end(); ++it) {
if (it == name.begin()) {
if (!SbName::isBaseNameStartChar(*it))
*it = '_';
}
else {
if (!SbName::isBaseNameChar(*it))
*it = '_';
}
}
node->setName(name.c_str());
}

_sDisplayMaskModes[type] = pcModeSwitch->getNumChildren();
pcModeSwitch->addChild(node);
}
Expand Down

0 comments on commit 928cc7b

Please sign in to comment.