From 67ca3d150d544aa4e4bd17dc61565f99982ee4f9 Mon Sep 17 00:00:00 2001 From: Adam Rankin Date: Mon, 13 May 2019 12:45:42 -0400 Subject: [PATCH] Copy all metadata to a node as attributes instead of just transform node status entries --- OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx b/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx index 2fdbee6..662d0f3 100644 --- a/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx +++ b/OpenIGTLinkIF/MRML/vtkMRMLIGTLConnectorNode.cxx @@ -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) @@ -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); }