ReverseEngineering: Use QStringLiteral
This commit is contained in:
@@ -654,11 +654,11 @@ void CmdViewTriangulation::activated(int)
|
||||
QString document = QString::fromStdString(objT.getDocumentPython());
|
||||
QString object = QString::fromStdString(objT.getObjectPython());
|
||||
|
||||
QString command = QString::fromLatin1("%1.addObject('Mesh::Feature', 'View mesh').Mesh "
|
||||
"= ReverseEngineering.viewTriangulation("
|
||||
"Points=%2.Points,"
|
||||
"Width=%2.Width,"
|
||||
"Height=%2.Height)")
|
||||
QString command = QStringLiteral("%1.addObject('Mesh::Feature', 'View mesh').Mesh "
|
||||
"= ReverseEngineering.viewTriangulation("
|
||||
"Points=%2.Points,"
|
||||
"Width=%2.Width,"
|
||||
"Height=%2.Height)")
|
||||
.arg(document, object);
|
||||
runCommand(Doc, command.toLatin1());
|
||||
}
|
||||
|
||||
@@ -102,31 +102,31 @@ void FitBSplineCurveWidget::tryAccept()
|
||||
|
||||
QStringList arguments;
|
||||
arguments.append(
|
||||
QString::fromLatin1("Points=getattr(%1, %1.getPropertyNameOfGeometry())").arg(object));
|
||||
QStringLiteral("Points=getattr(%1, %1.getPropertyNameOfGeometry())").arg(object));
|
||||
if (!d->ui.groupBoxSmooth->isChecked()) {
|
||||
arguments.append(QString::fromLatin1("MinDegree = %1").arg(d->ui.degreeMin->value()));
|
||||
arguments.append(QStringLiteral("MinDegree = %1").arg(d->ui.degreeMin->value()));
|
||||
}
|
||||
arguments.append(QString::fromLatin1("MaxDegree = %1").arg(d->ui.degreeMax->value()));
|
||||
arguments.append(QString::fromLatin1("Continuity = %1").arg(d->ui.continuity->currentIndex()));
|
||||
arguments.append(QStringLiteral("MaxDegree = %1").arg(d->ui.degreeMax->value()));
|
||||
arguments.append(QStringLiteral("Continuity = %1").arg(d->ui.continuity->currentIndex()));
|
||||
if (d->ui.checkBoxClosed->isChecked()) {
|
||||
arguments.append(QString::fromLatin1("Closed = True"));
|
||||
arguments.append(QStringLiteral("Closed = True"));
|
||||
}
|
||||
else {
|
||||
arguments.append(QString::fromLatin1("Closed = False"));
|
||||
arguments.append(QStringLiteral("Closed = False"));
|
||||
}
|
||||
if (d->ui.checkBox->isChecked()) {
|
||||
int index = d->ui.paramType->currentIndex();
|
||||
arguments.append(QString::fromLatin1("ParametrizationType = %1").arg(index));
|
||||
arguments.append(QStringLiteral("ParametrizationType = %1").arg(index));
|
||||
}
|
||||
if (d->ui.groupBoxSmooth->isChecked()) {
|
||||
arguments.append(QString::fromLatin1("Weight1 = %1").arg(d->ui.curveLength->value()));
|
||||
arguments.append(QString::fromLatin1("Weight2 = %1").arg(d->ui.curvature->value()));
|
||||
arguments.append(QString::fromLatin1("Weight3 = %1").arg(d->ui.torsion->value()));
|
||||
arguments.append(QStringLiteral("Weight1 = %1").arg(d->ui.curveLength->value()));
|
||||
arguments.append(QStringLiteral("Weight2 = %1").arg(d->ui.curvature->value()));
|
||||
arguments.append(QStringLiteral("Weight3 = %1").arg(d->ui.torsion->value()));
|
||||
}
|
||||
|
||||
QString argument = arguments.join(QLatin1String(", "));
|
||||
QString command = QString::fromLatin1("%1.addObject(\"Part::Spline\", \"Spline\").Shape = "
|
||||
"ReverseEngineering.approxCurve(%2).toShape()")
|
||||
QString command = QStringLiteral("%1.addObject(\"Part::Spline\", \"Spline\").Shape = "
|
||||
"ReverseEngineering.approxCurve(%2).toShape()")
|
||||
.arg(document, argument);
|
||||
|
||||
tryCommand(command);
|
||||
|
||||
@@ -135,8 +135,8 @@ void FitBSplineSurfaceWidget::onMakePlacementClicked()
|
||||
double q0, q1, q2, q3;
|
||||
pm.getRotation().getValue(q0, q1, q2, q3);
|
||||
|
||||
QString argument = QString::fromLatin1("Base.Placement(Base.Vector(%1, %2, "
|
||||
"%3), Base.Rotation(%4, %5, %6, %7))")
|
||||
QString argument = QStringLiteral("Base.Placement(Base.Vector(%1, %2, "
|
||||
"%3), Base.Rotation(%4, %5, %6, %7))")
|
||||
.arg(base.x)
|
||||
.arg(base.y)
|
||||
.arg(base.z)
|
||||
@@ -147,7 +147,7 @@ void FitBSplineSurfaceWidget::onMakePlacementClicked()
|
||||
|
||||
QString document = QString::fromStdString(d->obj.getDocumentPython());
|
||||
QString command =
|
||||
QString::fromLatin1(
|
||||
QStringLiteral(
|
||||
R"(%1.addObject("App::Placement", "Placement").Placement = %2)")
|
||||
.arg(document, argument);
|
||||
|
||||
@@ -172,31 +172,30 @@ bool FitBSplineSurfaceWidget::accept()
|
||||
QString document = QString::fromStdString(d->obj.getDocumentPython());
|
||||
QString object = QString::fromStdString(d->obj.getObjectPython());
|
||||
|
||||
QString argument =
|
||||
QString::fromLatin1("Points=getattr(%1, %1.getPropertyNameOfGeometry()), "
|
||||
"UDegree=%2, VDegree=%3, "
|
||||
"NbUPoles=%4, NbVPoles=%5, "
|
||||
"Smooth=%6, "
|
||||
"Weight=%7, "
|
||||
"Grad=%8, "
|
||||
"Bend=%9, "
|
||||
"Curv=%10, "
|
||||
"Iterations=%11, "
|
||||
"PatchFactor=%12, "
|
||||
"Correction=True")
|
||||
.arg(object)
|
||||
.arg(d->ui.degreeU->value())
|
||||
.arg(d->ui.degreeV->value())
|
||||
.arg(d->ui.polesU->value())
|
||||
.arg(d->ui.polesV->value())
|
||||
.arg(d->ui.groupBoxSmooth->isChecked() ? QLatin1String("True")
|
||||
: QLatin1String("False"))
|
||||
.arg(d->ui.totalWeight->value())
|
||||
.arg(d->ui.gradient->value())
|
||||
.arg(d->ui.bending->value())
|
||||
.arg(d->ui.curvature->value())
|
||||
.arg(d->ui.iterations->value())
|
||||
.arg(d->ui.sizeFactor->value());
|
||||
QString argument = QStringLiteral("Points=getattr(%1, %1.getPropertyNameOfGeometry()), "
|
||||
"UDegree=%2, VDegree=%3, "
|
||||
"NbUPoles=%4, NbVPoles=%5, "
|
||||
"Smooth=%6, "
|
||||
"Weight=%7, "
|
||||
"Grad=%8, "
|
||||
"Bend=%9, "
|
||||
"Curv=%10, "
|
||||
"Iterations=%11, "
|
||||
"PatchFactor=%12, "
|
||||
"Correction=True")
|
||||
.arg(object)
|
||||
.arg(d->ui.degreeU->value())
|
||||
.arg(d->ui.degreeV->value())
|
||||
.arg(d->ui.polesU->value())
|
||||
.arg(d->ui.polesV->value())
|
||||
.arg(d->ui.groupBoxSmooth->isChecked() ? QLatin1String("True")
|
||||
: QLatin1String("False"))
|
||||
.arg(d->ui.totalWeight->value())
|
||||
.arg(d->ui.gradient->value())
|
||||
.arg(d->ui.bending->value())
|
||||
.arg(d->ui.curvature->value())
|
||||
.arg(d->ui.iterations->value())
|
||||
.arg(d->ui.sizeFactor->value());
|
||||
if (d->ui.uvdir->isChecked()) {
|
||||
std::vector<App::Placement*> selection =
|
||||
Gui::Selection().getObjectsOfType<App::Placement>();
|
||||
@@ -214,7 +213,7 @@ bool FitBSplineSurfaceWidget::accept()
|
||||
rot.multVec(u, u);
|
||||
rot.multVec(v, v);
|
||||
argument +=
|
||||
QString::fromLatin1(", UVDirs=(FreeCAD.Vector(%1,%2,%3), FreeCAD.Vector(%4,%5,%6))")
|
||||
QStringLiteral(", UVDirs=(FreeCAD.Vector(%1,%2,%3), FreeCAD.Vector(%4,%5,%6))")
|
||||
.arg(u.x)
|
||||
.arg(u.y)
|
||||
.arg(u.z)
|
||||
@@ -222,8 +221,8 @@ bool FitBSplineSurfaceWidget::accept()
|
||||
.arg(v.y)
|
||||
.arg(v.z);
|
||||
}
|
||||
QString command = QString::fromLatin1("%1.addObject(\"Part::Spline\", \"Spline\").Shape = "
|
||||
"ReverseEngineering.approxSurface(%2).toShape()")
|
||||
QString command = QStringLiteral("%1.addObject(\"Part::Spline\", \"Spline\").Shape = "
|
||||
"ReverseEngineering.approxSurface(%2).toShape()")
|
||||
.arg(document, argument);
|
||||
|
||||
Gui::WaitCursor wc;
|
||||
|
||||
@@ -66,16 +66,16 @@ bool PoissonWidget::accept()
|
||||
QString document = QString::fromStdString(d->obj.getDocumentPython());
|
||||
QString object = QString::fromStdString(d->obj.getObjectPython());
|
||||
|
||||
QString argument = QString::fromLatin1("Points=%1.Points, "
|
||||
"OctreeDepth=%2, "
|
||||
"SolverDivide=%3, "
|
||||
"SamplesPerNode=%4")
|
||||
QString argument = QStringLiteral("Points=%1.Points, "
|
||||
"OctreeDepth=%2, "
|
||||
"SolverDivide=%3, "
|
||||
"SamplesPerNode=%4")
|
||||
.arg(object)
|
||||
.arg(d->ui.octreeDepth->value())
|
||||
.arg(d->ui.solverDivide->value())
|
||||
.arg(d->ui.samplesPerNode->value());
|
||||
QString command = QString::fromLatin1("%1.addObject(\"Mesh::Feature\", \"Poisson\").Mesh = "
|
||||
"ReverseEngineering.poissonReconstruction(%2)")
|
||||
QString command = QStringLiteral("%1.addObject(\"Mesh::Feature\", \"Poisson\").Mesh = "
|
||||
"ReverseEngineering.poissonReconstruction(%2)")
|
||||
.arg(document, argument);
|
||||
|
||||
Gui::WaitCursor wc;
|
||||
|
||||
Reference in New Issue
Block a user