| 149 | } |
| 150 | |
| 151 | QVariant QmitkPointListModel::data(const QModelIndex &index, int role) const |
| 152 | { |
| 153 | mitk::PointSet::Pointer pointSet = this->CheckForPointSetInNode(m_PointSetNode); |
| 154 | |
| 155 | if (pointSet.IsNull()) |
| 156 | { |
| 157 | return QVariant(); |
| 158 | } |
| 159 | |
| 160 | if (!index.isValid()) |
| 161 | { |
| 162 | return QVariant(); |
| 163 | } |
| 164 | |
| 165 | if (index.row() >= pointSet->GetSize(m_TimeStep)) |
| 166 | { |
| 167 | return QVariant(); |
| 168 | } |
| 169 | |
| 170 | if (role == Qt::DisplayRole) |
| 171 | { |
| 172 | mitk::PointSet::PointsContainer::ElementIdentifier id; |
| 173 | mitk::PointSet::PointType p; |
| 174 | bool pointFound = this->GetPointForModelIndex(index, p, id); |
| 175 | if (pointFound == false) |
| 176 | return QVariant(); |
| 177 | |
| 178 | QString s = QString("%0: (%1, %2, %3)").arg(id, 3).arg(p[0], 0, 'f', 3).arg(p[1], 0, 'f', 3).arg(p[2], 0, 'f', 3); |
| 179 | return QVariant(s); |
| 180 | } |
| 181 | else |
| 182 | { |
| 183 | return QVariant(); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | QVariant QmitkPointListModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 188 | { |
no test coverage detected