MCPcopy Create free account
hub / github.com/MITK/MITK / OnPointSetSelectionChanged

Method OnPointSetSelectionChanged

Modules/QtWidgetsExt/src/QmitkPointListView.cpp:105–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void QmitkPointListView::OnPointSetSelectionChanged()
106{
107 const mitk::PointSet *pointSet = m_PointListModel->GetPointSet();
108 if (pointSet == nullptr)
109 return;
110
111 // update this view's selection status as a result to changes in the point set data structure
112 m_SelfCall = true;
113 int timeStep = m_PointListModel->GetTimeStep();
114
115 if (pointSet->GetNumberOfSelected(timeStep) > 1)
116 {
117 MITK_ERROR << "Point set has multiple selected points. This view is not designed for more than one selected point.";
118 }
119
120 int selectedIndex = pointSet->SearchSelectedPoint(timeStep);
121
122 if (selectedIndex == -1) // no selected point is found
123 {
124 m_SelfCall = false;
125 return;
126 }
127
128 QModelIndex index;
129
130 bool modelIndexOkay = m_PointListModel->GetModelIndexForPointID(selectedIndex, index);
131
132 if (modelIndexOkay == true)
133 QListView::selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
134
135 emit SignalPointSelectionChanged();
136
137 m_SelfCall = false;
138}
139
140void QmitkPointListView::OnListViewSelectionChanged(const QItemSelection &selected,
141 const QItemSelection & /*deselected*/)

Callers

nothing calls this directly

Calls 5

GetNumberOfSelectedMethod · 0.80
SearchSelectedPointMethod · 0.80
GetPointSetMethod · 0.45
GetTimeStepMethod · 0.45

Tested by

no test coverage detected