Skip to content

Commit

Permalink
Copy all metadata to a node as attributes instead of just transform n…
Browse files Browse the repository at this point in the history
…ode status entries
  • Loading branch information
adamrankin committed May 13, 2019
1 parent ff3f6c0 commit 67ca3d1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,6 @@ void vtkMRMLIGTLConnectorNode::vtkInternal::ProcessIncomingDeviceModifiedEvent(
transfromMatrix->DeepCopy(transformDevice->GetContent().transform);
transformNode->SetMatrixTransformToParent(transfromMatrix.GetPointer());
transformNode->Modified();

// Copy transform status from metadata to node attributes
for (igtl::MessageBase::MetaDataMap::const_iterator iter = modifiedDevice->GetMetaData().begin(); iter != modifiedDevice->GetMetaData().end(); ++iter)
{
if (iter->first.find("Status") != std::string::npos)
{
transformNode->SetAttribute(iter->first.c_str(), iter->second.second.c_str());
}
}
}
}
else if (strcmp(deviceType.c_str(), "POLYDATA") == 0)
Expand Down Expand Up @@ -433,6 +424,12 @@ void vtkMRMLIGTLConnectorNode::vtkInternal::ProcessIncomingDeviceModifiedEvent(
queryNode->InvokeEvent(vtkMRMLIGTLQueryNode::ResponseEvent);
}

// Copy all device metadata to node attributes
for (igtl::MessageBase::MetaDataMap::const_iterator iter = modifiedDevice->GetMetaData().begin(); iter != modifiedDevice->GetMetaData().end(); ++iter)
{
modifiedNode->SetAttribute(iter->first.c_str(), iter->second.second.c_str());
}

this->IncomingNodeClientIDMap[modifiedNode->GetName()] = modifiedDevice->GetClientID();
modifiedNode->EndModify(wasModifyingNode);
}
Expand Down

0 comments on commit 67ca3d1

Please sign in to comment.