| 106 | } |
| 107 | |
| 108 | void QmitkSynchronizedWidgetConnector::SynchronizeWidget(QmitkSynchronizedNodeSelectionWidget* nodeSelectionWidget) const |
| 109 | { |
| 110 | // We need to explicitly differentiate when "Select All" is active, since the internal selection |
| 111 | // might not contain all nodes. When no selection widget is synchronized, the m_InternalSelection |
| 112 | // won't be updated. |
| 113 | if (m_SelectAll) |
| 114 | { |
| 115 | nodeSelectionWidget->SelectAll(); |
| 116 | } |
| 117 | else |
| 118 | { |
| 119 | nodeSelectionWidget->SetCurrentSelection(m_InternalSelection); |
| 120 | } |
| 121 | |
| 122 | nodeSelectionWidget->SetSelectAll(m_SelectAll); |
| 123 | |
| 124 | // Need to explicitly set visibility true, since selected but invisible nodes in the sync group don't trigger selection changes |
| 125 | for (auto& node : nodeSelectionWidget->GetSelectedNodes()) |
| 126 | { |
| 127 | nodeSelectionWidget->SetNodeVisibility(node, true); |
| 128 | } |
| 129 | |
| 130 | for (auto& node : this->m_InternalInvisibles) |
| 131 | { |
| 132 | nodeSelectionWidget->SetNodeVisibility(node, false); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | QmitkSynchronizedWidgetConnector::NodeList QmitkSynchronizedWidgetConnector::GetNodeSelection() const |
| 137 | { |