void vvLandmarksPanel::Load()
{
QString file = QFileDialog::getOpenFileName(this,tr("Load Landmarks"),
- mCurrentPath.c_str(),tr("Landmarks ( *.txt)"));
+ mCurrentPath.c_str(),tr("Landmarks ( *.txt *.pts)"));
if (!file.isEmpty())
- mCurrentLandmarks->LoadFile(file.toStdString());
+ LoadFromFile(file.toStdString());
+}
+
+void vvLandmarksPanel::LoadFromFile(std::string file)
+{
+ mCurrentLandmarks->LoadFile(file);
SetCurrentLandmarks(mCurrentLandmarks,2);
emit UpdateRenderWindows();
}
}
else {
// we're using single-selection mode
- mCurrentLandmarks->RemoveLandmark(items[0]->row());
- tableWidget->removeRow(items[0]->row());
+ int row = items[0]->row();
+ mCurrentLandmarks->RemoveLandmark(row);
+ tableWidget->removeRow(row);
+
+ for (int i = row; i < tableWidget->rowCount(); i++) {
+ QTableWidgetItem* iItem = tableWidget->item(i, 0);
+ iItem->setText(QString::number(i));
+ }
+
}
emit UpdateRenderWindows();
}