RE: fix -Wclazy-connect-by-name

This commit is contained in:
wmayer
2023-04-01 18:27:02 +02:00
committed by wwmayer
parent a4c39e39e5
commit 0271106b98
4 changed files with 56 additions and 26 deletions

View File

@@ -46,6 +46,7 @@ SegmentationManual::SegmentationManual(QWidget* parent, Qt::WindowFlags fl)
, ui(new Ui_SegmentationManual)
{
ui->setupUi(this);
setupConnections();
ui->spSelectComp->setRange(1, INT_MAX);
ui->spSelectComp->setValue(10);
@@ -59,6 +60,32 @@ SegmentationManual::~SegmentationManual()
{
}
void SegmentationManual::setupConnections()
{
connect(ui->selectRegion, &QPushButton::clicked,
this, &SegmentationManual::onSelectRegionClicked);
connect(ui->selectAll, &QPushButton::clicked,
this, &SegmentationManual::onSelectAllClicked);
connect(ui->selectComponents, &QPushButton::clicked,
this, &SegmentationManual::onSelectComponentsClicked);
connect(ui->selectTriangle, &QPushButton::clicked,
this, &SegmentationManual::onSelectTriangleClicked);
connect(ui->deselectAll, &QPushButton::clicked,
this, &SegmentationManual::onDeselectAllClicked);
connect(ui->visibleTriangles, &QCheckBox::toggled,
this, &SegmentationManual::onVisibleTrianglesToggled);
connect(ui->screenTriangles, &QCheckBox::toggled,
this, &SegmentationManual::onScreenTrianglesToggled);
connect(ui->cbSelectComp, &QCheckBox::toggled,
this, &SegmentationManual::onSelectCompToggled);
connect(ui->planeDetect, &QPushButton::clicked,
this, &SegmentationManual::onPlaneDetectClicked);
connect(ui->cylinderDetect, &QPushButton::clicked,
this, &SegmentationManual::onCylinderDetectClicked);
connect(ui->sphereDetect, &QPushButton::clicked,
this, &SegmentationManual::onSphereDetectClicked);
}
void SegmentationManual::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
@@ -67,41 +94,41 @@ void SegmentationManual::changeEvent(QEvent *e)
QWidget::changeEvent(e);
}
void SegmentationManual::on_selectRegion_clicked()
void SegmentationManual::onSelectRegionClicked()
{
meshSel.startSelection();
}
void SegmentationManual::on_selectAll_clicked()
void SegmentationManual::onSelectAllClicked()
{
// select the complete meshes
meshSel.fullSelection();
}
void SegmentationManual::on_deselectAll_clicked()
void SegmentationManual::onDeselectAllClicked()
{
// deselect all meshes
meshSel.clearSelection();
}
void SegmentationManual::on_selectComponents_clicked()
void SegmentationManual::onSelectComponentsClicked()
{
// select components up to a certain size
int size = ui->spSelectComp->value();
meshSel.selectComponent(size);
}
void SegmentationManual::on_visibleTriangles_toggled(bool on)
void SegmentationManual::onVisibleTrianglesToggled(bool on)
{
meshSel.setCheckOnlyVisibleTriangles(on);
}
void SegmentationManual::on_screenTriangles_toggled(bool on)
void SegmentationManual::onScreenTrianglesToggled(bool on)
{
meshSel.setCheckOnlyPointToUserTriangles(on);
}
void SegmentationManual::on_cbSelectComp_toggled(bool on)
void SegmentationManual::onSelectCompToggled(bool on)
{
meshSel.setAddComponentOnClick(on);
}
@@ -157,7 +184,7 @@ static void findGeometry(int minFaces, double tolerance,
}
};
void SegmentationManual::on_planeDetect_clicked()
void SegmentationManual::onPlaneDetectClicked()
{
auto func = [=](const std::vector<Base::Vector3f>& points,
const std::vector<Base::Vector3f>& normal) -> MeshCore::AbstractSurfaceFit* {
@@ -176,7 +203,7 @@ void SegmentationManual::on_planeDetect_clicked()
Private::findGeometry(ui->numPln->value(), ui->tolPln->value(), func);
}
void SegmentationManual::on_cylinderDetect_clicked()
void SegmentationManual::onCylinderDetectClicked()
{
auto func = [=](const std::vector<Base::Vector3f>& points,
const std::vector<Base::Vector3f>& normal) -> MeshCore::AbstractSurfaceFit* {
@@ -201,7 +228,7 @@ void SegmentationManual::on_cylinderDetect_clicked()
Private::findGeometry(ui->numCyl->value(), ui->tolCyl->value(), func);
}
void SegmentationManual::on_sphereDetect_clicked()
void SegmentationManual::onSphereDetectClicked()
{
auto func = [=](const std::vector<Base::Vector3f>& points,
const std::vector<Base::Vector3f>& normal) -> MeshCore::AbstractSurfaceFit* {
@@ -269,7 +296,7 @@ void SegmentationManual::createSegment()
meshSel.clearSelection();
}
void SegmentationManual::on_selectTriangle_clicked()
void SegmentationManual::onSelectTriangleClicked()
{
meshSel.selectTriangle();
meshSel.setAddComponentOnClick(ui->cbSelectComp->isChecked());