diff --git a/src/App/Placement.cpp b/src/App/Placement.cpp index b75e00bd32ee..6b9df044421e 100644 --- a/src/App/Placement.cpp +++ b/src/App/Placement.cpp @@ -33,7 +33,7 @@ using namespace App; -PROPERTY_SOURCE(App::Placement, App::DocumentObject) +PROPERTY_SOURCE(App::Placement, App::GeoFeature) //=========================================================================== diff --git a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp index 402b6df7ee53..91ece2728259 100644 --- a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp +++ b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.cpp @@ -35,13 +35,14 @@ #include #include #include +#include #include #include #include #include #include -#include +#include using namespace ReenGui; @@ -65,7 +66,6 @@ FitBSplineSurfaceWidget::FitBSplineSurfaceWidget(const App::DocumentObjectT& obj : d(new Private()) { d->ui.setupUi(this); - d->ui.uvdir->setDisabled(true); d->obj = obj; restoreSettings(); } @@ -139,8 +139,22 @@ bool FitBSplineSurfaceWidget::accept() .arg(d->ui.sizeFactor->value()) ; if (d->ui.uvdir->isChecked()) { - // todo - argument += QString::fromLatin1(", UVDirs=(FreeCAD.Vector(1,0,0), FreeCAD.Vector(0,1,0))"); + std::vector selection = Gui::Selection().getObjectsOfType(); + if (selection.size() != 1) { + QMessageBox::warning(this, + tr("Wrong selection"), + tr("Please select a single placement object to get local orientation.") + ); + return false; + } + + Base::Rotation rot = selection.front()->GeoFeature::Placement.getValue().getRotation(); + Base::Vector3d u(1,0,0); + Base::Vector3d v(0,1,0); + rot.multVec(u, u); + rot.multVec(v, v); + argument += QString::fromLatin1(", UVDirs=(FreeCAD.Vector(%1,%2,%3), FreeCAD.Vector(%4,%5,%6))") + .arg(u.x).arg(u.y).arg(u.z).arg(v.x).arg(v.y).arg(v.z); } QString command = QString::fromLatin1("%1.addObject(\"Part::Spline\", \"Spline\").Shape = " "ReverseEngineering.approxSurface(%2).toShape()") diff --git a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.ui b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.ui index 9ba67408e6ef..5aa892856038 100644 --- a/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.ui +++ b/src/Mod/ReverseEngineering/Gui/FitBSplineSurface.ui @@ -6,7 +6,7 @@ 0 0 - 472 + 360 342 @@ -52,7 +52,7 @@ - Number of control points + Control points Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -119,7 +119,7 @@ - Number of control points + Control points Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -157,7 +157,7 @@ - Maximum number of iterations + Iterations Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/src/Mod/ReverseEngineering/Gui/PreCompiled.h b/src/Mod/ReverseEngineering/Gui/PreCompiled.h index a3a03611f2d5..267f5c9c1184 100644 --- a/src/Mod/ReverseEngineering/Gui/PreCompiled.h +++ b/src/Mod/ReverseEngineering/Gui/PreCompiled.h @@ -33,12 +33,14 @@ # define PartExport __declspec(dllimport) # define MeshExport __declspec(dllimport) # define PointsExport __declspec(dllimport) +# define AppExport __declspec(dllimport) #else // for Linux # define ReenExport # define ReenGuiExport # define PartExport # define MeshExport # define PointsExport +# define AppExport #endif #ifdef _MSC_VER