本文整理汇总了C++中ImageItem::getControlPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageItem::getControlPoints方法的具体用法?C++ ImageItem::getControlPoints怎么用?C++ ImageItem::getControlPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageItem
的用法示例。
在下文中一共展示了ImageItem::getControlPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onAddConstraintDialogClosed
void StitcherWorkspace::onAddConstraintDialogClosed() {
QStandardItemModel * model = qobject_cast<QStandardItemModel *>(constraintsTree->model());
AddConstraintDialog * d = qobject_cast<AddConstraintDialog *>(sender());
QList<QPair<int,ImageItem *> > points = d->selectedPoints();
if(points.isEmpty()) {
delete d;
return;
}
QStandardItem *parentItem = model->invisibleRootItem();
QStandardItem * itemName = new QStandardItem("Type");
// This seems a bit too much
QList<QVariant> point_details;
QList<QVariant> item_details;
for(int i = 0; i<points.size(); i++) {
ImageItem * item = points[i].second;
QPointF pos = item->getControlPoints()[points[i].first];
item_details.append(QVariant::fromValue(item));
point_details.append(QVariant::fromValue(pos));
}
// itemName->setData(QVariant::fromValue(d));
itemName->setData(QVariant::fromValue(item_details),Qt::UserRole + 1);
itemName->setData(QVariant::fromValue(point_details),Qt::UserRole + 2);
itemName->setData(QVariant::fromValue((int)d->constraintType()),Qt::UserRole + 3);
QStandardItem * itemValue;
if(d->constraintType() == RadialLineConstraint) {
itemValue = new QStandardItem("Radial Line");
} else {
itemValue = new QStandardItem("Centered Circle");
}
parentItem->appendRow(QList<QStandardItem *>() << itemName << itemValue);
parentItem = itemName;
for(int i = 0; i<points.size(); i++) {
itemName = new QStandardItem(points[i].second->identifier() + "." + QString::number(points[i].first+1));
itemValue = new QStandardItem("");
parentItem->appendRow(QList<QStandardItem *>() << itemName << itemValue);
}
if(d->constraintType() == RadialLineConstraint) {
itemName = new QStandardItem("Angle");
} else {
itemName = new QStandardItem("Radius");
}
itemValue = new QStandardItem("");
parentItem->appendRow(QList<QStandardItem *>() << itemName << itemValue);
constraintsTree->expandAll();
constraintsTree->resizeColumnToContents(0);
constraintsTree->resizeColumnToContents(1);
}