In OpenMesh, once a named property is added to an element, it will be permanent in the sense that the property survives the scope of the property manager as explained here.
My question is:
1.
Now I was adding a PROPERTY by property manager.
auto GroupMark = FProp<bool>(*this, "shellGroupMark");
Will GroupMark be initialized?
2.
When someFuncA() ends, the GroupMark is removed from the mesh.
Why can’t I use GroupMark inside someFuncB()?
void someFuncA()
{
auto GroupMark = FProp<bool>(*this, "shellGroupMark");
for (const SmartFaceHandle& face : faces())
{
if (!shellGroupMark[face])
{
if(someFuncB(face))
{
Some action;
}
}
}
}
bool someFuncB(const SmartFaceHandle& startFace)
{
//GroupMark cannot be used without undoing the annotation.
//someFuncA() is not finished, why can't GroupMark be used?
//auto GroupMark = FProp<bool>(*this, "shellGroupMark");
for(const SmartFaceHandle& face : faces())
{
shellGroupMark[face] = true;
}
}
It would be greatly appreciated if you could explain the details.
Thanks.
zhang yichi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.