replace invalid characters in VRML string with underscore
This commit is contained in:
parent
9b33f4130b
commit
928cc7bcc4
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user