2 #include <VisionX/gui-plugins/UserAssistedSegmenterGui/widgets/ui_PointCloudSegmentsTable.h>
13 return static_cast<int>(f * 255.f);
16 static QColor qcolor(std::size_t
id)
36 header <<
"ID" <<
"#Points" <<
"C";
37 setHorizontalHeaderLabels(header);
38 setEditTriggers(QAbstractItemView::NoEditTriggers);
39 setColumnWidth(0, 45);
40 setColumnWidth(1, 75);
41 setColumnWidth(2, 30);
51 const pcl::PointCloud<pcl::PointXYZRGBL>& pointCloud,
bool excludeZero)
58 const std::map<PointCloudSegmentsTable::Label, pcl::PointIndices>& segmentMap)
61 setRowCount(
static_cast<int>(segmentMap.size()));
66 for (
const auto& [segmentID,
indices] : segmentMap)
68 std::size_t size =
indices.indices.size();
70 QTableWidgetItem* itemID =
new QTableWidgetItem();
71 itemID->setData(Qt::EditRole, segmentID);
72 itemID->setTextAlignment(Qt::AlignCenter);
73 setItem(row, 0, itemID);
75 QTableWidgetItem* itemSize =
new QTableWidgetItem();
76 itemSize->setData(Qt::EditRole,
static_cast<int>(size));
77 itemSize->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter);
78 setItem(row, 1, itemSize);
80 QTableWidgetItem* itemColor =
new QTableWidgetItem(QString(
""));
81 itemColor->setBackgroundColor(qcolor(segmentID));
82 setItem(row, 2, itemColor);