From 486578e5b36c9d460fee4e99b9d486a1f47b1043 Mon Sep 17 00:00:00 2001 From: balazs-bamer Date: Fri, 16 Jan 2015 12:02:40 +0100 Subject: [PATCH] diagnostics Some diagnostics to let me see what happens --- src/Mod/Surface/Gui/BSurf.cpp | 17 ++++++++++++----- src/Mod/Surface/Gui/Command.cpp | 12 ++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Mod/Surface/Gui/BSurf.cpp b/src/Mod/Surface/Gui/BSurf.cpp index 74aa5e5ec7..c4e92583eb 100644 --- a/src/Mod/Surface/Gui/BSurf.cpp +++ b/src/Mod/Surface/Gui/BSurf.cpp @@ -45,10 +45,10 @@ using namespace SurfaceGui; //#undef CS_FUTURE // multi-threading causes some problems -namespace SurfaceGui { - PROPERTY_SOURCE(SurfaceGui::ViewProviderBSurf, PartGui::ViewProviderPart) +namespace SurfaceGui { + bool ViewProviderBSurf::setEdit(int ModNum) { // When double-clicking on the item for this sketch the @@ -94,12 +94,15 @@ BSurf::~BSurf() filltype_t BSurf::getFillType() const { + filltype_t ret; if (ui->fillType_stretch->isChecked()) - return StretchStyle; + ret = StretchStyle; else if (ui->fillType_coons->isChecked()) - return CoonsStyle; + ret = CoonsStyle; else - return CurvedStyle; + ret = CurvedStyle; + printf("BSurf::getFillType: %d\n", ret); + return ret; } void BSurf::changeEvent(QEvent *e) @@ -114,6 +117,7 @@ void BSurf::changeEvent(QEvent *e) void BSurf::accept() { + printf("accept "); apply(); QDialog::accept(); } @@ -128,14 +132,17 @@ void BSurf::apply() void BSurf::on_fillType_stretch_clicked() { + printf("stretch\n"); } void BSurf::on_fillType_coons_clicked() { + printf("coons\n"); } void BSurf::on_fillType_curved_clicked() { + printf("curved\n"); } // --------------------------------------- diff --git a/src/Mod/Surface/Gui/Command.cpp b/src/Mod/Surface/Gui/Command.cpp index 1e2e0ae8dd..e90ab5f29a 100644 --- a/src/Mod/Surface/Gui/Command.cpp +++ b/src/Mod/Surface/Gui/Command.cpp @@ -241,14 +241,14 @@ CmdSurfaceBSpline::CmdSurfaceBSpline() void CmdSurfaceBSpline::activated(int iMsg) { - Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog(); + /*Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog(); if (!dlg) { dlg = new SurfaceGui::TaskBSurf(new SurfaceGui::ViewProviderBSurf()); } - Gui::Control().showDialog(dlg); + Gui::Control().showDialog(dlg);*/ // we take the whole selection and require that all of its members are of the required curve -/* std::vector Selo = getSelection().getSelectionEx(0); + std::vector Selo = getSelection().getSelectionEx(0); std::string FeatName = getUniqueObjectName("BSplineSurface"); std::stringstream bspListCmd; bspListCmd << "FreeCAD.ActiveDocument.ActiveObject.aBList = ["; @@ -259,11 +259,11 @@ void CmdSurfaceBSpline::activated(int iMsg) openCommand("Create BSpline surface"); doCommand(Doc,"FreeCAD.ActiveDocument.addObject(\"Surface::BSplineSurf\",\"%s\")", FeatName.c_str()); - doCommand(Doc, "FreeCAD.ActiveDocument.ActiveObject.filltype=1"); // TODO ask filltype from user and check it - // doCommand(Doc, "Gui.ActiveDocument.setEdit('%s',0)", FeatName.c_str()); + doCommand(Doc, "FreeCAD.ActiveDocument.ActiveObject.filltype=1"); + doCommand(Doc, "Gui.ActiveDocument.setEdit('%s',0)", FeatName.c_str()); runCommand(Doc, bspListCmd.str().c_str()); updateActive(); - commitCommand();*/ + commitCommand(); } bool CmdSurfaceBSpline::isActive(void)