FreeCAD/0001-boost-1.73.0-The-practice-of-declaring-the-Bind-plac.patch
Stefan Brüns 7dde38d5c0 Accepting request 835587 from home:StefanBruens:branches:science
- Fix build with boost 1.73 and later, add
  0001-boost-1.73.0-The-practice-of-declaring-the-Bind-plac.patch
- Cleanup some build dependencies.

OBS-URL: https://build.opensuse.org/request/show/835587
OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=127
2020-09-20 17:05:45 +00:00

5664 lines
220 KiB
Diff

From 74469f8a153f557fcb4dcb0704f40c5e75143f79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 19 Sep 2020 03:31:56 +0200
Subject: [PATCH] boost 1.73.0: The practice of declaring the Bind placeholders
(_1, _2, ...) in the global namespace is deprecated
---
.../salomesmesh/src/SMESH/SMESH_Mesh.cpp | 4 +-
src/App/Application.cpp | 39 +-
src/App/Document.cpp | 2 +-
src/App/DocumentObject.cpp | 7 +-
src/App/DocumentObserver.cpp | 21 +-
src/App/DocumentObserverPython.cpp | 45 +-
src/App/DocumentObserverPython.h | 3 +-
src/App/MergeDocuments.cpp | 7 +-
src/App/PreCompiled.h | 2 +-
src/App/PropertyExpressionEngine.cpp | 2 +-
src/Gui/Action.cpp | 9 +-
src/Gui/Application.cpp | 28 +-
src/Gui/AutoSaver.cpp | 11 +-
src/Gui/CommandView.cpp | 5 +-
src/Gui/DAGView/DAGModel.cpp | 13 +-
src/Gui/DAGView/DAGView.cpp | 10 +-
src/Gui/DlgDisplayPropertiesImp.cpp | 5 +-
src/Gui/Document.cpp | 33 +-
src/Gui/DocumentModel.cpp | 27 +-
src/Gui/DocumentObserver.cpp | 24 +-
src/Gui/DocumentObserverPython.cpp | 21 +-
src/Gui/DocumentObserverPython.h | 2 +-
src/Gui/ExpressionBinding.cpp | 5 +-
src/Gui/GraphvizView.cpp | 9 +-
src/Gui/MDIView.cpp | 5 +-
src/Gui/MainWindow.cpp | 2 -
src/Gui/ManualAlignment.cpp | 7 +-
src/Gui/MergeDocuments.cpp | 7 +-
src/Gui/Placement.cpp | 6 +-
src/Gui/Placement.h | 1 -
src/Gui/PreCompiled.h | 2 +-
src/Gui/ProjectView.cpp | 1 -
src/Gui/PropertyView.cpp | 15 +-
src/Gui/Selection.cpp | 7 +-
src/Gui/TaskView/TaskAppearance.cpp | 5 +-
src/Gui/TaskView/TaskSelectLinkProperty.cpp | 1 -
src/Gui/TaskView/TaskView.cpp | 9 +-
src/Gui/TextDocumentEditorView.cpp | 2 +-
src/Gui/Tree.cpp | 37 +-
src/Gui/ViewProvider.cpp | 2 +-
src/Gui/ViewProviderOrigin.cpp | 1 -
src/Gui/ViewProviderOriginGroup.cpp | 3 -
src/Gui/ViewProviderOriginGroupExtension.cpp | 12 +-
src/Gui/ViewProviderPart.cpp | 2 +-
src/Gui/ViewProviderPythonFeature.cpp | 9 +-
src/Gui/ViewProviderTextDocument.cpp | 2 +-
src/Mod/Assembly/App/PartRef.cpp | 2 +-
.../App/opendcm/core/imp/clustergraph_imp.hpp | 8 +-
.../App/opendcm/module3d/imp/module_imp.hpp | 5 +-
.../App/opendcm/moduleShape3d/generator.hpp | 7 +-
.../App/opendcm/moduleShape3d/module.hpp | 6 +-
.../Assembly/Gui/TaskAssemblyConstraints.cpp | 1 -
src/Mod/Assembly/Gui/Workbench.cpp | 20 +-
src/Mod/Drawing/Gui/TaskOrthoViews.cpp | 7 +-
src/Mod/Fem/Gui/PreCompiled.h | 2 +-
src/Mod/Fem/Gui/ViewProviderAnalysis.cpp | 2 +-
.../Fem/Gui/ViewProviderFemPostFunction.cpp | 1224 ++++++++---------
src/Mod/Inspection/App/InspectionFeature.cpp | 5 +-
src/Mod/Mesh/App/Core/Curvature.cpp | 5 +-
src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp | 2 -
src/Mod/Mesh/Gui/MeshEditor.cpp | 5 +-
src/Mod/Mesh/Gui/ViewProvider.cpp | 5 +-
src/Mod/Part/App/PreCompiled.h | 2 +-
src/Mod/Part/Gui/CrossSections.cpp | 5 +-
src/Mod/Part/Gui/DlgBooleanOperation.cpp | 7 +-
src/Mod/Part/Gui/DlgFilletEdges.cpp | 7 +-
src/Mod/Part/Gui/Mirroring.cpp | 1 -
src/Mod/Part/Gui/TaskAttacher.cpp | 7 +-
src/Mod/Part/Gui/TaskFaceColors.cpp | 10 +-
src/Mod/Part/Gui/ViewProviderSpline.cpp | 6 +-
src/Mod/PartDesign/App/Body.cpp | 1 -
src/Mod/PartDesign/App/ShapeBinder.cpp | 5 +-
src/Mod/PartDesign/Gui/PreCompiled.h | 178 +--
.../PartDesign/Gui/TaskDatumParameters.cpp | 1 -
src/Mod/PartDesign/Gui/TaskHoleParameters.cpp | 4 +-
src/Mod/PartDesign/Gui/TaskHoleParameters.h | 2 +-
.../Gui/TaskPrimitiveParameters.cpp | 1 -
.../Gui/TaskTransformedMessages.cpp | 6 +-
src/Mod/PartDesign/Gui/ViewProviderBody.cpp | 7 +-
src/Mod/PartDesign/Gui/Workbench.cpp | 23 +-
src/Mod/PartDesign/Gui/WorkflowManager.cpp | 9 +-
src/Mod/Path/App/Area.cpp | 3 +
src/Mod/Path/libarea/PythonStuff.cpp | 1082 +++++++--------
.../ReverseEngineering/App/ApproxSurface.cpp | 5 +-
src/Mod/Sandbox/App/DocumentProtector.h | 1 -
src/Mod/Sandbox/Gui/Command.cpp | 6 +-
src/Mod/Sandbox/Gui/TaskPanelView.cpp | 15 +-
src/Mod/Sketcher/App/SketchObject.cpp | 10 +-
src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp | 7 +-
.../Sketcher/Gui/TaskSketcherConstrains.cpp | 2 +-
src/Mod/Sketcher/Gui/TaskSketcherElements.cpp | 2 +-
src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp | 4 +-
src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp | 8 +-
src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 7 +-
src/Mod/Spreadsheet/App/PropertySheet.cpp | 9 +-
src/Mod/Spreadsheet/App/Sheet.cpp | 6 +-
src/Mod/Spreadsheet/Gui/SheetModel.cpp | 5 +-
src/Mod/Spreadsheet/Gui/SheetTableView.cpp | 5 +-
src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp | 7 +-
src/Mod/TechDraw/Gui/MDIViewPage.cpp | 5 +-
.../TechDraw/Gui/ViewProviderDrawingView.cpp | 5 +-
src/Mod/TechDraw/Gui/ViewProviderPage.cpp | 5 +-
102 files changed, 1657 insertions(+), 1602 deletions(-)
diff --git a/src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp b/src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp
index bb278f827..7ab201cef 100644
--- a/src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp
+++ b/src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp
@@ -76,10 +76,10 @@
#ifndef WIN32
#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#else
#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
//#include <pthread.h>
#endif
diff --git a/src/App/Application.cpp b/src/App/Application.cpp
index f02dc5a5e..50dfaf346 100644
--- a/src/App/Application.cpp
+++ b/src/App/Application.cpp
@@ -121,7 +121,7 @@
#include <boost/tokenizer.hpp>
#include <boost/token_functions.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/version.hpp>
#include <QDir>
#include <QFileInfo>
@@ -130,6 +130,7 @@ using namespace App;
using namespace std;
using namespace boost;
using namespace boost::program_options;
+namespace bp = boost::placeholders;
// scriptings (scripts are build in but can be overridden by command line option)
@@ -425,23 +426,23 @@ Document* Application::newDocument(const char * Name, const char * UserName)
// connect the signals to the application for the new document
- _pActiveDoc->signalBeforeChange.connect(boost::bind(&App::Application::slotBeforeChangeDocument, this, _1, _2));
- _pActiveDoc->signalChanged.connect(boost::bind(&App::Application::slotChangedDocument, this, _1, _2));
- _pActiveDoc->signalNewObject.connect(boost::bind(&App::Application::slotNewObject, this, _1));
- _pActiveDoc->signalDeletedObject.connect(boost::bind(&App::Application::slotDeletedObject, this, _1));
- _pActiveDoc->signalBeforeChangeObject.connect(boost::bind(&App::Application::slotBeforeChangeObject, this, _1, _2));
- _pActiveDoc->signalChangedObject.connect(boost::bind(&App::Application::slotChangedObject, this, _1, _2));
- _pActiveDoc->signalRelabelObject.connect(boost::bind(&App::Application::slotRelabelObject, this, _1));
- _pActiveDoc->signalActivatedObject.connect(boost::bind(&App::Application::slotActivatedObject, this, _1));
- _pActiveDoc->signalUndo.connect(boost::bind(&App::Application::slotUndoDocument, this, _1));
- _pActiveDoc->signalRedo.connect(boost::bind(&App::Application::slotRedoDocument, this, _1));
- _pActiveDoc->signalRecomputedObject.connect(boost::bind(&App::Application::slotRecomputedObject, this, _1));
- _pActiveDoc->signalRecomputed.connect(boost::bind(&App::Application::slotRecomputed, this, _1));
- _pActiveDoc->signalOpenTransaction.connect(boost::bind(&App::Application::slotOpenTransaction, this, _1, _2));
- _pActiveDoc->signalCommitTransaction.connect(boost::bind(&App::Application::slotCommitTransaction, this, _1));
- _pActiveDoc->signalAbortTransaction.connect(boost::bind(&App::Application::slotAbortTransaction, this, _1));
- _pActiveDoc->signalStartSave.connect(boost::bind(&App::Application::slotStartSaveDocument, this, _1, _2));
- _pActiveDoc->signalFinishSave.connect(boost::bind(&App::Application::slotFinishSaveDocument, this, _1, _2));
+ _pActiveDoc->signalBeforeChange.connect(boost::bind(&App::Application::slotBeforeChangeDocument, this, bp::_1, bp::_2));
+ _pActiveDoc->signalChanged.connect(boost::bind(&App::Application::slotChangedDocument, this, bp::_1, bp::_2));
+ _pActiveDoc->signalNewObject.connect(boost::bind(&App::Application::slotNewObject, this, bp::_1));
+ _pActiveDoc->signalDeletedObject.connect(boost::bind(&App::Application::slotDeletedObject, this, bp::_1));
+ _pActiveDoc->signalBeforeChangeObject.connect(boost::bind(&App::Application::slotBeforeChangeObject, this, bp::_1, bp::_2));
+ _pActiveDoc->signalChangedObject.connect(boost::bind(&App::Application::slotChangedObject, this, bp::_1, bp::_2));
+ _pActiveDoc->signalRelabelObject.connect(boost::bind(&App::Application::slotRelabelObject, this, bp::_1));
+ _pActiveDoc->signalActivatedObject.connect(boost::bind(&App::Application::slotActivatedObject, this, bp::_1));
+ _pActiveDoc->signalUndo.connect(boost::bind(&App::Application::slotUndoDocument, this, bp::_1));
+ _pActiveDoc->signalRedo.connect(boost::bind(&App::Application::slotRedoDocument, this, bp::_1));
+ _pActiveDoc->signalRecomputedObject.connect(boost::bind(&App::Application::slotRecomputedObject, this, bp::_1));
+ _pActiveDoc->signalRecomputed.connect(boost::bind(&App::Application::slotRecomputed, this, bp::_1));
+ _pActiveDoc->signalOpenTransaction.connect(boost::bind(&App::Application::slotOpenTransaction, this, bp::_1, bp::_2));
+ _pActiveDoc->signalCommitTransaction.connect(boost::bind(&App::Application::slotCommitTransaction, this, bp::_1));
+ _pActiveDoc->signalAbortTransaction.connect(boost::bind(&App::Application::slotAbortTransaction, this, bp::_1));
+ _pActiveDoc->signalStartSave.connect(boost::bind(&App::Application::slotStartSaveDocument, this, bp::_1, bp::_2));
+ _pActiveDoc->signalFinishSave.connect(boost::bind(&App::Application::slotFinishSaveDocument, this, bp::_1, bp::_2));
// make sure that the active document is set in case no GUI is up
{
@@ -2691,7 +2692,7 @@ void ObjectLabelObserver::slotRelabelObject(const App::DocumentObject& obj, cons
ObjectLabelObserver::ObjectLabelObserver() : current(0)
{
App::GetApplication().signalChangedObject.connect(boost::bind
- (&ObjectLabelObserver::slotRelabelObject, this, _1, _2));
+ (&ObjectLabelObserver::slotRelabelObject, this, bp::_1, bp::_2));
_hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp");
_hPGrp = _hPGrp->GetGroup("Preferences")->GetGroup("Document");
}
diff --git a/src/App/Document.cpp b/src/App/Document.cpp
index c4c31562e..75592a790 100644
--- a/src/App/Document.cpp
+++ b/src/App/Document.cpp
@@ -70,7 +70,7 @@ recompute path. Also enables more complicated dependencies beyond trees.
#include <boost/graph/visitors.hpp>
#endif //USE_OLD_DAG
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/regex.hpp>
#include <unordered_set>
#include <unordered_map>
diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp
index 55a1766f2..3c2583c3d 100644
--- a/src/App/DocumentObject.cpp
+++ b/src/App/DocumentObject.cpp
@@ -38,9 +38,10 @@
#include "DocumentObjectExtension.h"
#include "GeoFeatureGroupExtension.h"
#include <App/DocumentObjectPy.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
using namespace App;
+namespace bp = boost::placeholders;
PROPERTY_SOURCE(App::DocumentObject, App::TransactionalObject)
@@ -627,7 +628,7 @@ void DocumentObject::connectRelabelSignals()
if (!onRelabledObjectConnection.connected()) {
onRelabledObjectConnection = getDocument()->signalRelabelObject
.connect(boost::bind(&PropertyExpressionEngine::slotObjectRenamed,
- &ExpressionEngine, _1));
+ &ExpressionEngine, bp::_1));
}
// Connect to signalDeletedObject, to properly track deletion of other objects
@@ -635,7 +636,7 @@ void DocumentObject::connectRelabelSignals()
if (!onDeletedObjectConnection.connected()) {
onDeletedObjectConnection = getDocument()->signalDeletedObject
.connect(boost::bind(&PropertyExpressionEngine::slotObjectDeleted,
- &ExpressionEngine, _1));
+ &ExpressionEngine, bp::_1));
}
try {
diff --git a/src/App/DocumentObserver.cpp b/src/App/DocumentObserver.cpp
index 53421d386..3e32d321f 100644
--- a/src/App/DocumentObserver.cpp
+++ b/src/App/DocumentObserver.cpp
@@ -27,7 +27,7 @@
# include <sstream>
#endif
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "Application.h"
#include "Document.h"
@@ -35,6 +35,7 @@
#include "DocumentObserver.h"
using namespace App;
+namespace bp = boost::placeholders;
DocumentT::DocumentT()
@@ -197,18 +198,18 @@ std::string DocumentObjectT::getObjectPython() const
DocumentObserver::DocumentObserver() : _document(0)
{
this->connectApplicationCreatedDocument = App::GetApplication().signalNewDocument.connect(boost::bind
- (&DocumentObserver::slotCreatedDocument, this, _1));
+ (&DocumentObserver::slotCreatedDocument, this, bp::_1));
this->connectApplicationDeletedDocument = App::GetApplication().signalDeleteDocument.connect(boost::bind
- (&DocumentObserver::slotDeletedDocument, this, _1));
+ (&DocumentObserver::slotDeletedDocument, this, bp::_1));
}
DocumentObserver::DocumentObserver(Document* doc) : _document(0)
{
// Connect to application and given document
this->connectApplicationCreatedDocument = App::GetApplication().signalNewDocument.connect(boost::bind
- (&DocumentObserver::slotCreatedDocument, this, _1));
+ (&DocumentObserver::slotCreatedDocument, this, bp::_1));
this->connectApplicationDeletedDocument = App::GetApplication().signalDeleteDocument.connect(boost::bind
- (&DocumentObserver::slotDeletedDocument, this, _1));
+ (&DocumentObserver::slotDeletedDocument, this, bp::_1));
attachDocument(doc);
}
@@ -232,15 +233,15 @@ void DocumentObserver::attachDocument(Document* doc)
_document = doc;
this->connectDocumentCreatedObject = _document->signalNewObject.connect(boost::bind
- (&DocumentObserver::slotCreatedObject, this, _1));
+ (&DocumentObserver::slotCreatedObject, this, bp::_1));
this->connectDocumentDeletedObject = _document->signalDeletedObject.connect(boost::bind
- (&DocumentObserver::slotDeletedObject, this, _1));
+ (&DocumentObserver::slotDeletedObject, this, bp::_1));
this->connectDocumentChangedObject = _document->signalChangedObject.connect(boost::bind
- (&DocumentObserver::slotChangedObject, this, _1, _2));
+ (&DocumentObserver::slotChangedObject, this, bp::_1, bp::_2));
this->connectDocumentRecomputedObject = _document->signalRecomputedObject.connect(boost::bind
- (&DocumentObserver::slotRecomputedObject, this, _1));
+ (&DocumentObserver::slotRecomputedObject, this, bp::_1));
this->connectDocumentRecomputed = _document->signalRecomputed.connect(boost::bind
- (&DocumentObserver::slotRecomputedDocument, this, _1));
+ (&DocumentObserver::slotRecomputedDocument, this, bp::_1));
}
}
diff --git a/src/App/DocumentObserverPython.cpp b/src/App/DocumentObserverPython.cpp
index 7d1fa7125..9758c9a9e 100644
--- a/src/App/DocumentObserverPython.cpp
+++ b/src/App/DocumentObserverPython.cpp
@@ -34,6 +34,7 @@
#include <Base/Console.h>
using namespace App;
+namespace bp = boost::placeholders;
std::vector<DocumentObserverPython*> DocumentObserverPython::_instances;
@@ -60,54 +61,54 @@ void DocumentObserverPython::removeObserver(const Py::Object& obj)
DocumentObserverPython::DocumentObserverPython(const Py::Object& obj) : inst(obj)
{
this->connectApplicationCreatedDocument = App::GetApplication().signalNewDocument.connect(boost::bind
- (&DocumentObserverPython::slotCreatedDocument, this, _1));
+ (&DocumentObserverPython::slotCreatedDocument, this, bp::_1));
this->connectApplicationDeletedDocument = App::GetApplication().signalDeleteDocument.connect(boost::bind
- (&DocumentObserverPython::slotDeletedDocument, this, _1));
+ (&DocumentObserverPython::slotDeletedDocument, this, bp::_1));
this->connectApplicationRelabelDocument = App::GetApplication().signalRelabelDocument.connect(boost::bind
- (&DocumentObserverPython::slotRelabelDocument, this, _1));
+ (&DocumentObserverPython::slotRelabelDocument, this, bp::_1));
this->connectApplicationActivateDocument = App::GetApplication().signalActiveDocument.connect(boost::bind
- (&DocumentObserverPython::slotActivateDocument, this, _1));
+ (&DocumentObserverPython::slotActivateDocument, this, bp::_1));
this->connectApplicationUndoDocument = App::GetApplication().signalUndoDocument.connect(boost::bind
- (&DocumentObserverPython::slotUndoDocument, this, _1));
+ (&DocumentObserverPython::slotUndoDocument, this, bp::_1));
this->connectApplicationRedoDocument = App::GetApplication().signalRedoDocument.connect(boost::bind
- (&DocumentObserverPython::slotRedoDocument, this, _1));
+ (&DocumentObserverPython::slotRedoDocument, this, bp::_1));
this->connectDocumentBeforeChange = App::GetApplication().signalBeforeChangeDocument.connect(boost::bind
- (&DocumentObserverPython::slotBeforeChangeDocument, this, _1, _2));
+ (&DocumentObserverPython::slotBeforeChangeDocument, this, bp::_1, bp::_2));
this->connectDocumentChanged = App::GetApplication().signalChangedDocument.connect(boost::bind
- (&DocumentObserverPython::slotChangedDocument, this, _1, _2));
+ (&DocumentObserverPython::slotChangedDocument, this, bp::_1, bp::_2));
this->connectDocumentCreatedObject = App::GetApplication().signalNewObject.connect(boost::bind
- (&DocumentObserverPython::slotCreatedObject, this, _1));
+ (&DocumentObserverPython::slotCreatedObject, this, bp::_1));
this->connectDocumentDeletedObject = App::GetApplication().signalDeletedObject.connect(boost::bind
- (&DocumentObserverPython::slotDeletedObject, this, _1));
+ (&DocumentObserverPython::slotDeletedObject, this, bp::_1));
this->connectDocumentBeforeChangeObject = App::GetApplication().signalBeforeChangeObject.connect(boost::bind
- (&DocumentObserverPython::slotBeforeChangeObject, this, _1, _2));
+ (&DocumentObserverPython::slotBeforeChangeObject, this, bp::_1, bp::_2));
this->connectDocumentChangedObject = App::GetApplication().signalChangedObject.connect(boost::bind
- (&DocumentObserverPython::slotChangedObject, this, _1, _2));
+ (&DocumentObserverPython::slotChangedObject, this, bp::_1, bp::_2));
this->connectDocumentObjectRecomputed = App::GetApplication().signalObjectRecomputed.connect(boost::bind
- (&DocumentObserverPython::slotRecomputedObject, this, _1));
+ (&DocumentObserverPython::slotRecomputedObject, this, bp::_1));
this->connectDocumentRecomputed = App::GetApplication().signalRecomputed.connect(boost::bind
- (&DocumentObserverPython::slotRecomputedDocument, this, _1));
+ (&DocumentObserverPython::slotRecomputedDocument, this, bp::_1));
this->connectDocumentOpenTransaction = App::GetApplication().signalOpenTransaction.connect(boost::bind
- (&DocumentObserverPython::slotOpenTransaction, this, _1, _2));
+ (&DocumentObserverPython::slotOpenTransaction, this, bp::_1, bp::_2));
this->connectDocumentCommitTransaction = App::GetApplication().signalCommitTransaction.connect(boost::bind
- (&DocumentObserverPython::slotCommitTransaction, this, _1));
+ (&DocumentObserverPython::slotCommitTransaction, this, bp::_1));
this->connectDocumentAbortTransaction = App::GetApplication().signalAbortTransaction.connect(boost::bind
- (&DocumentObserverPython::slotAbortTransaction, this, _1));
+ (&DocumentObserverPython::slotAbortTransaction, this, bp::_1));
this->connectDocumentStartSave = App::GetApplication().signalStartSaveDocument.connect(boost::bind
- (&DocumentObserverPython::slotStartSaveDocument, this, _1, _2));
+ (&DocumentObserverPython::slotStartSaveDocument, this, bp::_1, bp::_2));
this->connectDocumentFinishSave = App::GetApplication().signalFinishSaveDocument.connect(boost::bind
- (&DocumentObserverPython::slotFinishSaveDocument, this, _1, _2));
+ (&DocumentObserverPython::slotFinishSaveDocument, this, bp::_1, bp::_2));
this->connectObjectAppendDynamicProperty = App::GetApplication().signalAppendDynamicProperty.connect(boost::bind
- (&DocumentObserverPython::slotAppendDynamicProperty, this, _1));
+ (&DocumentObserverPython::slotAppendDynamicProperty, this, bp::_1));
this->connectObjectRemoveDynamicProperty = App::GetApplication().signalRemoveDynamicProperty.connect(boost::bind
- (&DocumentObserverPython::slotRemoveDynamicProperty, this, _1));
+ (&DocumentObserverPython::slotRemoveDynamicProperty, this, bp::_1));
this->connectObjectChangePropertyEditor = App::GetApplication().signalChangePropertyEditor.connect(boost::bind
- (&DocumentObserverPython::slotChangePropertyEditor, this, _1));
+ (&DocumentObserverPython::slotChangePropertyEditor, this, bp::_1));
}
DocumentObserverPython::~DocumentObserverPython()
diff --git a/src/App/DocumentObserverPython.h b/src/App/DocumentObserverPython.h
index afff82b45..fa85bfee7 100644
--- a/src/App/DocumentObserverPython.h
+++ b/src/App/DocumentObserverPython.h
@@ -27,7 +27,8 @@
#include <CXX/Objects.hxx>
#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
+#include <string>
namespace App
{
diff --git a/src/App/MergeDocuments.cpp b/src/App/MergeDocuments.cpp
index 819a7c364..67d88d50b 100644
--- a/src/App/MergeDocuments.cpp
+++ b/src/App/MergeDocuments.cpp
@@ -23,7 +23,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <stack>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include <QCoreApplication>
@@ -36,6 +36,7 @@
#include <App/DocumentObject.h>
using namespace App;
+namespace bp = boost::placeholders;
namespace App {
@@ -118,9 +119,9 @@ private:
MergeDocuments::MergeDocuments(App::Document* doc) : guiup(false), verbose(true), stream(0), appdoc(doc)
{
connectExport = doc->signalExportObjects.connect
- (boost::bind(&MergeDocuments::exportObject, this, _1, _2));
+ (boost::bind(&MergeDocuments::exportObject, this, bp::_1, bp::_2));
connectImport = doc->signalImportObjects.connect
- (boost::bind(&MergeDocuments::importObject, this, _1, _2));
+ (boost::bind(&MergeDocuments::importObject, this, bp::_1, bp::_2));
QCoreApplication* app = QCoreApplication::instance();
if (app && app->inherits("QApplication")) {
diff --git a/src/App/PreCompiled.h b/src/App/PreCompiled.h
index 49cba3652..93428b009 100644
--- a/src/App/PreCompiled.h
+++ b/src/App/PreCompiled.h
@@ -76,7 +76,7 @@
// Boost
#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/regex.hpp>
#include <boost/tuple/tuple.hpp>
diff --git a/src/App/PropertyExpressionEngine.cpp b/src/App/PropertyExpressionEngine.cpp
index 31f4b34b3..2d0e4e120 100644
--- a/src/App/PropertyExpressionEngine.cpp
+++ b/src/App/PropertyExpressionEngine.cpp
@@ -33,7 +33,7 @@
#include "PropertyStandard.h"
#include "PropertyUnits.h"
#include <CXX/Objects.hxx>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp
index 3ab26d391..d36dac0e7 100644
--- a/src/Gui/Action.cpp
+++ b/src/Gui/Action.cpp
@@ -25,7 +25,7 @@
#ifndef _PreComp_
# include <boost/signals2.hpp>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QAbstractItemView>
# include <QActionEvent>
# include <QApplication>
@@ -54,6 +54,7 @@
using namespace Gui;
using namespace Gui::Dialog;
+namespace bp = boost::placeholders;
/**
* Constructs an action called \a name with parent \a parent. It also stores a pointer
@@ -501,9 +502,9 @@ WorkbenchGroup::WorkbenchGroup ( Command* pcCmd, QObject * parent )
action->setData(QVariant(i)); // set the index
}
- Application::Instance->signalActivateWorkbench.connect(boost::bind(&WorkbenchGroup::slotActivateWorkbench, this, _1));
- Application::Instance->signalAddWorkbench.connect(boost::bind(&WorkbenchGroup::slotAddWorkbench, this, _1));
- Application::Instance->signalRemoveWorkbench.connect(boost::bind(&WorkbenchGroup::slotRemoveWorkbench, this, _1));
+ Application::Instance->signalActivateWorkbench.connect(boost::bind(&WorkbenchGroup::slotActivateWorkbench, this, bp::_1));
+ Application::Instance->signalAddWorkbench.connect(boost::bind(&WorkbenchGroup::slotAddWorkbench, this, bp::_1));
+ Application::Instance->signalRemoveWorkbench.connect(boost::bind(&WorkbenchGroup::slotRemoveWorkbench, this, bp::_1));
}
WorkbenchGroup::~WorkbenchGroup()
diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp
index 4d36537fe..ebb99d017 100644
--- a/src/Gui/Application.cpp
+++ b/src/Gui/Application.cpp
@@ -26,7 +26,7 @@
#ifndef _PreComp_
# include "InventorAll.h"
# include <boost/signals2.hpp>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <sstream>
# include <stdexcept>
# include <iostream>
@@ -131,6 +131,7 @@
using namespace Gui;
using namespace Gui::DockWnd;
using namespace std;
+namespace bp = boost::placeholders;
Application* Application::Instance = 0L;
@@ -286,12 +287,11 @@ Application::Application(bool GUIenabled)
{
//App::GetApplication().Attach(this);
if (GUIenabled) {
- App::GetApplication().signalNewDocument.connect(boost::bind(&Gui::Application::slotNewDocument, this, _1));
- App::GetApplication().signalDeleteDocument.connect(boost::bind(&Gui::Application::slotDeleteDocument, this, _1));
- App::GetApplication().signalRenameDocument.connect(boost::bind(&Gui::Application::slotRenameDocument, this, _1));
- App::GetApplication().signalActiveDocument.connect(boost::bind(&Gui::Application::slotActiveDocument, this, _1));
- App::GetApplication().signalRelabelDocument.connect(boost::bind(&Gui::Application::slotRelabelDocument, this, _1));
-
+ App::GetApplication().signalNewDocument.connect(boost::bind(&Gui::Application::slotNewDocument, this, bp::_1));
+ App::GetApplication().signalDeleteDocument.connect(boost::bind(&Gui::Application::slotDeleteDocument, this, bp::_1));
+ App::GetApplication().signalRenameDocument.connect(boost::bind(&Gui::Application::slotRenameDocument, this, bp::_1));
+ App::GetApplication().signalActiveDocument.connect(boost::bind(&Gui::Application::slotActiveDocument, this, bp::_1));
+ App::GetApplication().signalRelabelDocument.connect(boost::bind(&Gui::Application::slotRelabelDocument, this, bp::_1));
// install the last active language
ParameterGrp::handle hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp");
@@ -677,13 +677,13 @@ void Application::slotNewDocument(const App::Document& Doc)
d->documents[&Doc] = pDoc;
// connect the signals to the application for the new document
- pDoc->signalNewObject.connect(boost::bind(&Gui::Application::slotNewObject, this, _1));
- pDoc->signalDeletedObject.connect(boost::bind(&Gui::Application::slotDeletedObject, this, _1));
- pDoc->signalChangedObject.connect(boost::bind(&Gui::Application::slotChangedObject, this, _1, _2));
- pDoc->signalRelabelObject.connect(boost::bind(&Gui::Application::slotRelabelObject, this, _1));
- pDoc->signalActivatedObject.connect(boost::bind(&Gui::Application::slotActivatedObject, this, _1));
- pDoc->signalInEdit.connect(boost::bind(&Gui::Application::slotInEdit, this, _1));
- pDoc->signalResetEdit.connect(boost::bind(&Gui::Application::slotResetEdit, this, _1));
+ pDoc->signalNewObject.connect(boost::bind(&Gui::Application::slotNewObject, this, bp::_1));
+ pDoc->signalDeletedObject.connect(boost::bind(&Gui::Application::slotDeletedObject, this, bp::_1));
+ pDoc->signalChangedObject.connect(boost::bind(&Gui::Application::slotChangedObject, this, bp::_1, bp::_2));
+ pDoc->signalRelabelObject.connect(boost::bind(&Gui::Application::slotRelabelObject, this, bp::_1));
+ pDoc->signalActivatedObject.connect(boost::bind(&Gui::Application::slotActivatedObject, this, bp::_1));
+ pDoc->signalInEdit.connect(boost::bind(&Gui::Application::slotInEdit, this, bp::_1));
+ pDoc->signalResetEdit.connect(boost::bind(&Gui::Application::slotResetEdit, this, bp::_1));
signalNewDocument(*pDoc);
pDoc->createView(View3DInventor::getClassTypeId());
diff --git a/src/Gui/AutoSaver.cpp b/src/Gui/AutoSaver.cpp
index 98f020ee6..ff72b42cc 100644
--- a/src/Gui/AutoSaver.cpp
+++ b/src/Gui/AutoSaver.cpp
@@ -29,7 +29,7 @@
# include <QRunnable>
# include <QTextStream>
# include <QThreadPool>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <sstream>
#endif
@@ -50,14 +50,15 @@
#include "ViewProvider.h"
using namespace Gui;
+namespace bp = boost::placeholders;
AutoSaver* AutoSaver::self = 0;
AutoSaver::AutoSaver(QObject* parent)
: QObject(parent), timeout(900000), compressed(true)
{
- App::GetApplication().signalNewDocument.connect(boost::bind(&AutoSaver::slotCreateDocument, this, _1));
- App::GetApplication().signalDeleteDocument.connect(boost::bind(&AutoSaver::slotDeleteDocument, this, _1));
+ App::GetApplication().signalNewDocument.connect(boost::bind(&AutoSaver::slotCreateDocument, this, bp::_1));
+ App::GetApplication().signalDeleteDocument.connect(boost::bind(&AutoSaver::slotDeleteDocument, this, bp::_1));
}
AutoSaver::~AutoSaver()
@@ -227,9 +228,9 @@ void AutoSaver::timerEvent(QTimerEvent * event)
AutoSaveProperty::AutoSaveProperty(const App::Document* doc) : timerId(-1)
{
documentNew = const_cast<App::Document*>(doc)->signalNewObject.connect
- (boost::bind(&AutoSaveProperty::slotNewObject, this, _1));
+ (boost::bind(&AutoSaveProperty::slotNewObject, this, bp::_1));
documentMod = const_cast<App::Document*>(doc)->signalChangedObject.connect
- (boost::bind(&AutoSaveProperty::slotChangePropertyData, this, _2));
+ (boost::bind(&AutoSaveProperty::slotChangePropertyData, this, bp::_2));
}
AutoSaveProperty::~AutoSaveProperty()
diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp
index ad53be551..a62c54355 100644
--- a/src/Gui/CommandView.cpp
+++ b/src/Gui/CommandView.cpp
@@ -36,7 +36,7 @@
# include <QMessageBox>
# include <QPainter>
# include <QTextStream>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "Command.h"
@@ -86,6 +86,7 @@
using namespace Gui;
using Gui::Dialog::DlgSettingsImageImp;
+namespace bp = boost::placeholders;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -573,7 +574,7 @@ StdCmdDrawStyle::StdCmdDrawStyle()
sPixmap = "DrawStyleAsIs";
eType = Alter3DView;
- this->getGuiApplication()->signalActivateView.connect(boost::bind(&StdCmdDrawStyle::updateIcon, this, _1));
+ this->getGuiApplication()->signalActivateView.connect(boost::bind(&StdCmdDrawStyle::updateIcon, this, bp::_1));
}
Gui::Action * StdCmdDrawStyle::createAction(void)
diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp
index 31ace8757..e9ec3b26b 100644
--- a/src/Gui/DAGView/DAGModel.cpp
+++ b/src/Gui/DAGView/DAGModel.cpp
@@ -22,7 +22,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/graph/topological_sort.hpp>
#include <boost/graph/reverse_graph.hpp>
@@ -62,6 +62,7 @@
using namespace Gui;
using namespace DAG;
+namespace bp = boost::placeholders;
LineEdit::LineEdit(QWidget* parentIn): QLineEdit(parentIn)
{
@@ -143,11 +144,11 @@ Model::Model(QObject *parentIn, const Gui::Document &documentIn) : QGraphicsScen
connect(this->editingFinishedAction, SIGNAL(triggered()),
this, SLOT(editingFinishedSlot()));
- connectNewObject = documentIn.signalNewObject.connect(boost::bind(&Model::slotNewObject, this, _1));
- connectDelObject = documentIn.signalDeletedObject.connect(boost::bind(&Model::slotDeleteObject, this, _1));
- connectChgObject = documentIn.signalChangedObject.connect(boost::bind(&Model::slotChangeObject, this, _1, _2));
- connectEdtObject = documentIn.signalInEdit.connect(boost::bind(&Model::slotInEdit, this, _1));
- connectResObject = documentIn.signalResetEdit.connect(boost::bind(&Model::slotResetEdit, this, _1));
+ connectNewObject = documentIn.signalNewObject.connect(boost::bind(&Model::slotNewObject, this, bp::_1));
+ connectDelObject = documentIn.signalDeletedObject.connect(boost::bind(&Model::slotDeleteObject, this, bp::_1));
+ connectChgObject = documentIn.signalChangedObject.connect(boost::bind(&Model::slotChangeObject, this, bp::_1, bp::_2));
+ connectEdtObject = documentIn.signalInEdit.connect(boost::bind(&Model::slotInEdit, this, bp::_1));
+ connectResObject = documentIn.signalResetEdit.connect(boost::bind(&Model::slotResetEdit, this, bp::_1));
}
Model::~Model()
diff --git a/src/Gui/DAGView/DAGView.cpp b/src/Gui/DAGView/DAGView.cpp
index 501a424a2..1dc3a907f 100644
--- a/src/Gui/DAGView/DAGView.cpp
+++ b/src/Gui/DAGView/DAGView.cpp
@@ -22,6 +22,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
+#include <boost/bind/bind.hpp>
#include <QAbstractEventDispatcher>
#include <QVBoxLayout>
#endif
@@ -39,6 +40,7 @@
using namespace Gui;
using namespace DAG;
+namespace bp = boost::placeholders;
DAG::DockWindow::DockWindow(Gui::Document* gDocumentIn, QWidget* parent): Gui::DockWindow(gDocumentIn, parent)
{
@@ -52,8 +54,8 @@ View::View(QWidget* parentIn): QGraphicsView(parentIn)
{
this->setRenderHint(QPainter::Antialiasing, true);
this->setRenderHint(QPainter::TextAntialiasing, true);
- Application::Instance->signalActiveDocument.connect(boost::bind(&View::slotActiveDocument, this, _1));
- Application::Instance->signalDeleteDocument.connect(boost::bind(&View::slotDeleteDocument, this, _1));
+ Application::Instance->signalActiveDocument.connect(boost::bind(&View::slotActiveDocument, this, bp::_1));
+ Application::Instance->signalDeleteDocument.connect(boost::bind(&View::slotDeleteDocument, this, bp::_1));
//just update the dagview when the gui process is idle.
connect(QAbstractEventDispatcher::instance(), SIGNAL(awake()), this, SLOT(awakeSlot()));
@@ -61,8 +63,8 @@ View::View(QWidget* parentIn): QGraphicsView(parentIn)
View::~View()
{
- Application::Instance->signalActiveDocument.disconnect(boost::bind(&View::slotActiveDocument, this, _1));
- Application::Instance->signalDeleteDocument.disconnect(boost::bind(&View::slotDeleteDocument, this, _1));
+ Application::Instance->signalActiveDocument.disconnect(boost::bind(&View::slotActiveDocument, this, bp::_1));
+ Application::Instance->signalDeleteDocument.disconnect(boost::bind(&View::slotDeleteDocument, this, bp::_1));
}
void View::slotActiveDocument(const Document &documentIn)
diff --git a/src/Gui/DlgDisplayPropertiesImp.cpp b/src/Gui/DlgDisplayPropertiesImp.cpp
index eaedaaaf2..a4d2ffdee 100644
--- a/src/Gui/DlgDisplayPropertiesImp.cpp
+++ b/src/Gui/DlgDisplayPropertiesImp.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <algorithm>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QDockWidget>
#endif
@@ -49,6 +49,7 @@
using namespace Gui::Dialog;
using namespace std;
+namespace bp = boost::placeholders;
/* TRANSLATOR Gui::Dialog::DlgDisplayPropertiesImp */
@@ -96,7 +97,7 @@ DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WindowFla
this->connectChangedObject =
Gui::Application::Instance->signalChangedObject.connect(boost::bind
- (&DlgDisplayPropertiesImp::slotChangedObject, this, _1, _2));
+ (&DlgDisplayPropertiesImp::slotChangedObject, this, bp::_1, bp::_2));
}
/**
diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp
index 92493af1b..76570134c 100644
--- a/src/Gui/Document.cpp
+++ b/src/Gui/Document.cpp
@@ -33,7 +33,7 @@
# include <qmessagebox.h>
# include <qstatusbar.h>
# include <boost/signals2.hpp>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <Inventor/actions/SoSearchAction.h>
# include <Inventor/nodes/SoSeparator.h>
#endif
@@ -68,6 +68,7 @@
#include "Thumbnail.h"
using namespace Gui;
+namespace bp = boost::placeholders;
namespace Gui {
@@ -132,40 +133,40 @@ Document::Document(App::Document* pcDocument,Application * app)
// Setup the connections
d->connectNewObject = pcDocument->signalNewObject.connect
- (boost::bind(&Gui::Document::slotNewObject, this, _1));
+ (boost::bind(&Gui::Document::slotNewObject, this, bp::_1));
d->connectDelObject = pcDocument->signalDeletedObject.connect
- (boost::bind(&Gui::Document::slotDeletedObject, this, _1));
+ (boost::bind(&Gui::Document::slotDeletedObject, this, bp::_1));
d->connectCngObject = pcDocument->signalChangedObject.connect
- (boost::bind(&Gui::Document::slotChangedObject, this, _1, _2));
+ (boost::bind(&Gui::Document::slotChangedObject, this, bp::_1, bp::_2));
d->connectRenObject = pcDocument->signalRelabelObject.connect
- (boost::bind(&Gui::Document::slotRelabelObject, this, _1));
+ (boost::bind(&Gui::Document::slotRelabelObject, this, bp::_1));
d->connectActObject = pcDocument->signalActivatedObject.connect
- (boost::bind(&Gui::Document::slotActivatedObject, this, _1));
+ (boost::bind(&Gui::Document::slotActivatedObject, this, bp::_1));
d->connectActObjectBlocker = boost::signals2::shared_connection_block
(d->connectActObject, false);
d->connectSaveDocument = pcDocument->signalSaveDocument.connect
- (boost::bind(&Gui::Document::Save, this, _1));
+ (boost::bind(&Gui::Document::Save, this, bp::_1));
d->connectRestDocument = pcDocument->signalRestoreDocument.connect
- (boost::bind(&Gui::Document::Restore, this, _1));
+ (boost::bind(&Gui::Document::Restore, this, bp::_1));
d->connectStartLoadDocument = App::GetApplication().signalStartRestoreDocument.connect
- (boost::bind(&Gui::Document::slotStartRestoreDocument, this, _1));
+ (boost::bind(&Gui::Document::slotStartRestoreDocument, this, bp::_1));
d->connectFinishLoadDocument = App::GetApplication().signalFinishRestoreDocument.connect
- (boost::bind(&Gui::Document::slotFinishRestoreDocument, this, _1));
+ (boost::bind(&Gui::Document::slotFinishRestoreDocument, this, bp::_1));
d->connectExportObjects = pcDocument->signalExportViewObjects.connect
- (boost::bind(&Gui::Document::exportObjects, this, _1, _2));
+ (boost::bind(&Gui::Document::exportObjects, this, bp::_1, bp::_2));
d->connectImportObjects = pcDocument->signalImportViewObjects.connect
- (boost::bind(&Gui::Document::importObjects, this, _1, _2, _3));
+ (boost::bind(&Gui::Document::importObjects, this, bp::_1, bp::_2, bp::_3));
d->connectUndoDocument = pcDocument->signalUndo.connect
- (boost::bind(&Gui::Document::slotUndoDocument, this, _1));
+ (boost::bind(&Gui::Document::slotUndoDocument, this, bp::_1));
d->connectRedoDocument = pcDocument->signalRedo.connect
- (boost::bind(&Gui::Document::slotRedoDocument, this, _1));
+ (boost::bind(&Gui::Document::slotRedoDocument, this, bp::_1));
d->connectTransactionAppend = pcDocument->signalTransactionAppend.connect
- (boost::bind(&Gui::Document::slotTransactionAppend, this, _1, _2));
+ (boost::bind(&Gui::Document::slotTransactionAppend, this, bp::_1, bp::_2));
d->connectTransactionRemove = pcDocument->signalTransactionRemove.connect
- (boost::bind(&Gui::Document::slotTransactionRemove, this, _1, _2));
+ (boost::bind(&Gui::Document::slotTransactionRemove, this, bp::_1, bp::_2));
// pointer to the python class
// NOTE: As this Python object doesn't get returned to the interpreter we
// mustn't increment it (Werner Jan-12-2006)
diff --git a/src/Gui/DocumentModel.cpp b/src/Gui/DocumentModel.cpp
index 4ec20c140..f9e206787 100644
--- a/src/Gui/DocumentModel.cpp
+++ b/src/Gui/DocumentModel.cpp
@@ -27,7 +27,7 @@
# include <QApplication>
# include <algorithm>
# include <boost/signals2.hpp>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include <boost/unordered_set.hpp>
@@ -42,6 +42,7 @@
#include <App/PropertyLinks.h>
using namespace Gui;
+namespace bp = boost::placeholders;
namespace Gui {
// forward declaration
@@ -367,11 +368,11 @@ DocumentModel::DocumentModel(QObject* parent)
}
// Setup connections
- Application::Instance->signalNewDocument.connect(boost::bind(&DocumentModel::slotNewDocument, this, _1));
- Application::Instance->signalDeleteDocument.connect(boost::bind(&DocumentModel::slotDeleteDocument, this, _1));
- Application::Instance->signalRenameDocument.connect(boost::bind(&DocumentModel::slotRenameDocument, this, _1));
- Application::Instance->signalActiveDocument.connect(boost::bind(&DocumentModel::slotActiveDocument, this, _1));
- Application::Instance->signalRelabelDocument.connect(boost::bind(&DocumentModel::slotRelabelDocument, this, _1));
+ Application::Instance->signalNewDocument.connect(boost::bind(&DocumentModel::slotNewDocument, this, bp::_1));
+ Application::Instance->signalDeleteDocument.connect(boost::bind(&DocumentModel::slotDeleteDocument, this, bp::_1));
+ Application::Instance->signalRenameDocument.connect(boost::bind(&DocumentModel::slotRenameDocument, this, bp::_1));
+ Application::Instance->signalActiveDocument.connect(boost::bind(&DocumentModel::slotActiveDocument, this, bp::_1));
+ Application::Instance->signalRelabelDocument.connect(boost::bind(&DocumentModel::slotRelabelDocument, this, bp::_1));
}
DocumentModel::~DocumentModel()
@@ -381,13 +382,13 @@ DocumentModel::~DocumentModel()
void DocumentModel::slotNewDocument(const Gui::Document& Doc)
{
- Doc.signalNewObject.connect(boost::bind(&DocumentModel::slotNewObject, this, _1));
- Doc.signalDeletedObject.connect(boost::bind(&DocumentModel::slotDeleteObject, this, _1));
- Doc.signalChangedObject.connect(boost::bind(&DocumentModel::slotChangeObject, this, _1, _2));
- Doc.signalRelabelObject.connect(boost::bind(&DocumentModel::slotRenameObject, this, _1));
- Doc.signalActivatedObject.connect(boost::bind(&DocumentModel::slotActiveObject, this, _1));
- Doc.signalInEdit.connect(boost::bind(&DocumentModel::slotInEdit, this, _1));
- Doc.signalResetEdit.connect(boost::bind(&DocumentModel::slotResetEdit, this, _1));
+ Doc.signalNewObject.connect(boost::bind(&DocumentModel::slotNewObject, this, bp::_1));
+ Doc.signalDeletedObject.connect(boost::bind(&DocumentModel::slotDeleteObject, this, bp::_1));
+ Doc.signalChangedObject.connect(boost::bind(&DocumentModel::slotChangeObject, this, bp::_1, bp::_2));
+ Doc.signalRelabelObject.connect(boost::bind(&DocumentModel::slotRenameObject, this, bp::_1));
+ Doc.signalActivatedObject.connect(boost::bind(&DocumentModel::slotActiveObject, this, bp::_1));
+ Doc.signalInEdit.connect(boost::bind(&DocumentModel::slotInEdit, this, bp::_1));
+ Doc.signalResetEdit.connect(boost::bind(&DocumentModel::slotResetEdit, this, bp::_1));
QModelIndex parent = createIndex(0,0,d->rootItem);
int count_docs = d->rootItem->childCount();
diff --git a/src/Gui/DocumentObserver.cpp b/src/Gui/DocumentObserver.cpp
index 7de3ccf92..d51030a2e 100644
--- a/src/Gui/DocumentObserver.cpp
+++ b/src/Gui/DocumentObserver.cpp
@@ -25,10 +25,9 @@
#ifndef _PreComp_
# include <sstream>
+# include <boost/bind/bind.hpp>
#endif
-#include <boost/bind.hpp>
-
#include "Application.h"
#include "Document.h"
#include "ViewProviderDocumentObject.h"
@@ -36,6 +35,7 @@
#include <App/Document.h>
using namespace Gui;
+namespace bp = boost::placeholders;
DocumentT::DocumentT()
@@ -215,25 +215,25 @@ void DocumentObserver::attachDocument(Document* doc)
return;
this->connectDocumentCreatedObject = doc->signalNewObject.connect(boost::bind
- (&DocumentObserver::slotCreatedObject, this, _1));
+ (&DocumentObserver::slotCreatedObject, this, bp::_1));
this->connectDocumentDeletedObject = doc->signalDeletedObject.connect(boost::bind
- (&DocumentObserver::slotDeletedObject, this, _1));
+ (&DocumentObserver::slotDeletedObject, this, bp::_1));
this->connectDocumentChangedObject = doc->signalChangedObject.connect(boost::bind
- (&DocumentObserver::slotChangedObject, this, _1, _2));
+ (&DocumentObserver::slotChangedObject, this, bp::_1, bp::_2));
this->connectDocumentRelabelObject = doc->signalRelabelObject.connect(boost::bind
- (&DocumentObserver::slotRelabelObject, this, _1));
+ (&DocumentObserver::slotRelabelObject, this, bp::_1));
this->connectDocumentActivateObject = doc->signalActivatedObject.connect(boost::bind
- (&DocumentObserver::slotActivatedObject, this, _1));
+ (&DocumentObserver::slotActivatedObject, this, bp::_1));
this->connectDocumentEditObject = doc->signalInEdit.connect(boost::bind
- (&DocumentObserver::slotEnterEditObject, this, _1));
+ (&DocumentObserver::slotEnterEditObject, this, bp::_1));
this->connectDocumentResetObject = doc->signalResetEdit.connect(boost::bind
- (&DocumentObserver::slotResetEditObject, this, _1));
+ (&DocumentObserver::slotResetEditObject, this, bp::_1));
this->connectDocumentUndo = doc->signalUndoDocument.connect(boost::bind
- (&DocumentObserver::slotUndoDocument, this, _1));
+ (&DocumentObserver::slotUndoDocument, this, bp::_1));
this->connectDocumentRedo = doc->signalRedoDocument.connect(boost::bind
- (&DocumentObserver::slotRedoDocument, this, _1));
+ (&DocumentObserver::slotRedoDocument, this, bp::_1));
this->connectDocumentDelete = doc->signalDeleteDocument.connect(boost::bind
- (&DocumentObserver::slotDeleteDocument, this, _1));
+ (&DocumentObserver::slotDeleteDocument, this, bp::_1));
}
void DocumentObserver::detachDocument()
diff --git a/src/Gui/DocumentObserverPython.cpp b/src/Gui/DocumentObserverPython.cpp
index ddcb8ae0b..cfa622bf1 100644
--- a/src/Gui/DocumentObserverPython.cpp
+++ b/src/Gui/DocumentObserverPython.cpp
@@ -35,6 +35,7 @@
#include <Base/Console.h>
using namespace Gui;
+namespace bp = boost::placeholders;
std::vector<DocumentObserverPython*> DocumentObserverPython::_instances;
@@ -61,27 +62,27 @@ void DocumentObserverPython::removeObserver(const Py::Object& obj)
DocumentObserverPython::DocumentObserverPython(const Py::Object& obj) : inst(obj)
{
this->connectApplicationCreatedDocument = Gui::Application::Instance->signalNewDocument.connect(boost::bind
- (&DocumentObserverPython::slotCreatedDocument, this, _1));
+ (&DocumentObserverPython::slotCreatedDocument, this, bp::_1));
this->connectApplicationDeletedDocument = Gui::Application::Instance->signalDeleteDocument.connect(boost::bind
- (&DocumentObserverPython::slotDeletedDocument, this, _1));
+ (&DocumentObserverPython::slotDeletedDocument, this, bp::_1));
this->connectApplicationRelabelDocument = Gui::Application::Instance->signalRelabelDocument.connect(boost::bind
- (&DocumentObserverPython::slotRelabelDocument, this, _1));
+ (&DocumentObserverPython::slotRelabelDocument, this, bp::_1));
this->connectApplicationRenameDocument = Gui::Application::Instance->signalRenameDocument.connect(boost::bind
- (&DocumentObserverPython::slotRelabelDocument, this, _1));
+ (&DocumentObserverPython::slotRelabelDocument, this, bp::_1));
this->connectApplicationActivateDocument = Gui::Application::Instance->signalActiveDocument.connect(boost::bind
- (&DocumentObserverPython::slotActivateDocument, this, _1));
+ (&DocumentObserverPython::slotActivateDocument, this, bp::_1));
this->connectDocumentCreatedObject = Gui::Application::Instance->signalNewObject.connect(boost::bind
- (&DocumentObserverPython::slotCreatedObject, this, _1));
+ (&DocumentObserverPython::slotCreatedObject, this, bp::_1));
this->connectDocumentDeletedObject = Gui::Application::Instance->signalDeletedObject.connect(boost::bind
- (&DocumentObserverPython::slotDeletedObject, this, _1));
+ (&DocumentObserverPython::slotDeletedObject, this, bp::_1));
this->connectDocumentChangedObject = Gui::Application::Instance->signalChangedObject.connect(boost::bind
- (&DocumentObserverPython::slotChangedObject, this, _1, _2));
+ (&DocumentObserverPython::slotChangedObject, this, bp::_1, bp::_2));
this->connectDocumentObjectInEdit = Gui::Application::Instance->signalInEdit.connect(boost::bind
- (&DocumentObserverPython::slotInEdit, this, _1));
+ (&DocumentObserverPython::slotInEdit, this, bp::_1));
this->connectDocumentObjectResetEdit = Gui::Application::Instance->signalResetEdit.connect(boost::bind
- (&DocumentObserverPython::slotResetEdit, this, _1));
+ (&DocumentObserverPython::slotResetEdit, this, bp::_1));
}
diff --git a/src/Gui/DocumentObserverPython.h b/src/Gui/DocumentObserverPython.h
index ca3318a79..71a2e7f25 100644
--- a/src/Gui/DocumentObserverPython.h
+++ b/src/Gui/DocumentObserverPython.h
@@ -27,7 +27,7 @@
#include <CXX/Objects.hxx>
#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
namespace Gui
{
diff --git a/src/Gui/ExpressionBinding.cpp b/src/Gui/ExpressionBinding.cpp
index 1bd8bbaa8..47233bccc 100644
--- a/src/Gui/ExpressionBinding.cpp
+++ b/src/Gui/ExpressionBinding.cpp
@@ -32,10 +32,11 @@
#include <Base/Tools.h>
#include <App/ObjectIdentifier.h>
#include <App/Document.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
using namespace Gui;
using namespace App;
+namespace bp = boost::placeholders;
ExpressionBinding::ExpressionBinding()
: iconLabel(0)
@@ -83,7 +84,7 @@ void ExpressionBinding::bind(const App::ObjectIdentifier &_path)
//connect to be informed about changes
DocumentObject * docObj = path.getDocumentObject();
- connection = docObj->ExpressionEngine.expressionChanged.connect(boost::bind(&ExpressionBinding::expressionChange, this, _1));
+ connection = docObj->ExpressionEngine.expressionChanged.connect(boost::bind(&ExpressionBinding::expressionChange, this, bp::_1));
}
void ExpressionBinding::bind(const Property &prop)
diff --git a/src/Gui/GraphvizView.cpp b/src/Gui/GraphvizView.cpp
index afffc6244..62e69ef85 100644
--- a/src/Gui/GraphvizView.cpp
+++ b/src/Gui/GraphvizView.cpp
@@ -37,7 +37,7 @@
# include <QGraphicsView>
# include <QThread>
# include <QProcess>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "GraphicsViewZoom.h"
#include "FileDialog.h"
@@ -50,6 +50,7 @@
#include <App/Document.h>
using namespace Gui;
+namespace bp = boost::placeholders;
namespace Gui {
@@ -187,9 +188,9 @@ GraphvizView::GraphvizView(App::Document & _doc, QWidget* parent)
connect(thread, SIGNAL(svgFileRead(const QByteArray &)), this, SLOT(svgFileRead(const QByteArray &)));
// Connect signal from document
- recomputeConnection = _doc.signalRecomputed.connect(boost::bind(&GraphvizView::updateSvgItem, this, _1));
- undoConnection = _doc.signalUndo.connect(boost::bind(&GraphvizView::updateSvgItem, this, _1));
- redoConnection = _doc.signalRedo.connect(boost::bind(&GraphvizView::updateSvgItem, this, _1));
+ recomputeConnection = _doc.signalRecomputed.connect(boost::bind(&GraphvizView::updateSvgItem, this, bp::_1));
+ undoConnection = _doc.signalUndo.connect(boost::bind(&GraphvizView::updateSvgItem, this, bp::_1));
+ redoConnection = _doc.signalRedo.connect(boost::bind(&GraphvizView::updateSvgItem, this, bp::_1));
updateSvgItem(_doc);
}
diff --git a/src/Gui/MDIView.cpp b/src/Gui/MDIView.cpp
index 6d8fbcc5f..364a2ea29 100644
--- a/src/Gui/MDIView.cpp
+++ b/src/Gui/MDIView.cpp
@@ -25,7 +25,7 @@
#ifndef _PreComp_
# include <boost/signals2.hpp>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <qapplication.h>
# include <qregexp.h>
# include <QEvent>
@@ -43,6 +43,7 @@
#include "ViewProviderDocumentObject.h"
using namespace Gui;
+namespace bp = boost::placeholders;
TYPESYSTEM_SOURCE_ABSTRACT(Gui::MDIView,Gui::BaseView);
@@ -55,7 +56,7 @@ MDIView::MDIView(Gui::Document* pcDocument,QWidget* parent, Qt::WindowFlags wfla
if (pcDocument)
{
connectDelObject = pcDocument->signalDeletedObject.connect
- (boost::bind(&ActiveObjectList::objectDeleted, &ActiveObjects, _1));
+ (boost::bind(&ActiveObjectList::objectDeleted, &ActiveObjects, bp::_1));
assert(connectDelObject.connected());
}
}
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 2ce27c3b1..d78b34858 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -51,8 +51,6 @@
# include <QWhatsThis>
#endif
-#include <boost/bind.hpp>
-
// FreeCAD Base header
#include <Base/Parameter.h>
#include <Base/Exception.h>
diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp
index 8ae2323f0..4ea40f542 100644
--- a/src/Gui/ManualAlignment.cpp
+++ b/src/Gui/ManualAlignment.cpp
@@ -47,9 +47,9 @@
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/nodes/SoTranslation.h>
# include <Inventor/sensors/SoNodeSensor.h>
+# include <boost/bind/bind.hpp>
#endif
-#include <boost/bind.hpp>
#include <App/Document.h>
#include <App/GeoFeature.h>
@@ -70,6 +70,7 @@
using namespace Gui;
+namespace bp = boost::placeholders;
AlignmentGroup::AlignmentGroup()
{
@@ -643,7 +644,7 @@ ManualAlignment::ManualAlignment()
{
// connect with the application's signal for deletion of documents
this->connectApplicationDeletedDocument = Gui::Application::Instance->signalDeleteDocument
- .connect(boost::bind(&ManualAlignment::slotDeletedDocument, this, _1));
+ .connect(boost::bind(&ManualAlignment::slotDeletedDocument, this, bp::_1));
// setup sensor connection
d->sensorCam1 = new SoNodeSensor(Private::syncCameraCB, this);
@@ -837,7 +838,7 @@ void ManualAlignment::startAlignment(Base::Type mousemodel)
if (this->connectDocumentDeletedObject.connected())
this->connectDocumentDeletedObject.disconnect();
this->connectDocumentDeletedObject = myDocument->signalDeletedObject.connect(boost::bind
- (&ManualAlignment::slotDeletedObject, this, _1));
+ (&ManualAlignment::slotDeletedObject, this, bp::_1));
continueAlignment();
}
diff --git a/src/Gui/MergeDocuments.cpp b/src/Gui/MergeDocuments.cpp
index 93316f4fa..8d870a8ae 100644
--- a/src/Gui/MergeDocuments.cpp
+++ b/src/Gui/MergeDocuments.cpp
@@ -23,7 +23,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <stack>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "MergeDocuments.h"
#include <Base/Console.h>
@@ -36,6 +36,7 @@
#include <Gui/ViewProvider.h>
using namespace Gui;
+namespace bp = boost::placeholders;
namespace Gui {
@@ -118,9 +119,9 @@ private:
MergeDocuments::MergeDocuments(App::Document* doc) : stream(0), appdoc(doc)
{
connectExport = doc->signalExportObjects.connect
- (boost::bind(&MergeDocuments::exportObject, this, _1, _2));
+ (boost::bind(&MergeDocuments::exportObject, this, bp::_1, bp::_2));
connectImport = doc->signalImportObjects.connect
- (boost::bind(&MergeDocuments::importObject, this, _1, _2));
+ (boost::bind(&MergeDocuments::importObject, this, bp::_1, bp::_2));
document = Gui::Application::Instance->getDocument(doc);
}
diff --git a/src/Gui/Placement.cpp b/src/Gui/Placement.cpp
index da9449969..a9f0d95c8 100644
--- a/src/Gui/Placement.cpp
+++ b/src/Gui/Placement.cpp
@@ -22,10 +22,13 @@
#include "PreCompiled.h"
+#ifndef _PreComp_
#include <QSignalMapper>
#include <QDockWidget>
#include <QMessageBox>
#include <QClipboard>
+#include <boost/bind/bind.hpp>
+#endif
#include "Placement.h"
#include "ui_Placement.h"
@@ -44,6 +47,7 @@
#include <Base/UnitsApi.h>
using namespace Gui::Dialog;
+namespace bp = boost::placeholders;
namespace Gui { namespace Dialog {
class find_placement
@@ -115,7 +119,7 @@ Placement::Placement(QWidget* parent, Qt::WindowFlags fl)
connect(signalMapper, SIGNAL(mapped(int)),
this, SLOT(onPlacementChanged(int)));
connectAct = Application::Instance->signalActiveDocument.connect
- (boost::bind(&Placement::slotActiveDocument, this, _1));
+ (boost::bind(&Placement::slotActiveDocument, this, bp::_1));
App::Document* activeDoc = App::GetApplication().getActiveDocument();
if (activeDoc) documents.insert(activeDoc->getName());
diff --git a/src/Gui/Placement.h b/src/Gui/Placement.h
index b2b3ef61e..f1a58cb38 100644
--- a/src/Gui/Placement.h
+++ b/src/Gui/Placement.h
@@ -30,7 +30,6 @@
#include <Base/Placement.h>
#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
class QSignalMapper;
diff --git a/src/Gui/PreCompiled.h b/src/Gui/PreCompiled.h
index 536e538d6..783b7cbe7 100644
--- a/src/Gui/PreCompiled.h
+++ b/src/Gui/PreCompiled.h
@@ -76,7 +76,7 @@
// Boost
#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/program_options.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/utility.hpp>
diff --git a/src/Gui/ProjectView.cpp b/src/Gui/ProjectView.cpp
index bbef326fd..e4cfdfc52 100644
--- a/src/Gui/ProjectView.cpp
+++ b/src/Gui/ProjectView.cpp
@@ -24,7 +24,6 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <boost/bind.hpp>
# include <QAction>
# include <QActionGroup>
# include <QApplication>
diff --git a/src/Gui/PropertyView.cpp b/src/Gui/PropertyView.cpp
index fed192f12..acb88e484 100644
--- a/src/Gui/PropertyView.cpp
+++ b/src/Gui/PropertyView.cpp
@@ -26,9 +26,9 @@
# include <QGridLayout>
# include <QHeaderView>
# include <QEvent>
+# include <boost/bind/bind.hpp>
#endif
-#include <boost/bind.hpp>
/// Here the FreeCAD includes sorted by Base,App,Gui......
#include <Base/Parameter.h>
@@ -51,6 +51,7 @@ using namespace std;
using namespace Gui;
using namespace Gui::DockWnd;
using namespace Gui::PropertyEditor;
+namespace bp = boost::placeholders;
/* TRANSLATOR Gui::PropertyView */
@@ -97,22 +98,22 @@ PropertyView::PropertyView(QWidget *parent)
this->connectPropData =
App::GetApplication().signalChangedObject.connect(boost::bind
- (&PropertyView::slotChangePropertyData, this, _1, _2));
+ (&PropertyView::slotChangePropertyData, this, bp::_1, bp::_2));
this->connectPropView =
Gui::Application::Instance->signalChangedObject.connect(boost::bind
- (&PropertyView::slotChangePropertyView, this, _1, _2));
+ (&PropertyView::slotChangePropertyView, this, bp::_1, bp::_2));
this->connectPropAppend =
App::GetApplication().signalAppendDynamicProperty.connect(boost::bind
- (&PropertyView::slotAppendDynamicProperty, this, _1));
+ (&PropertyView::slotAppendDynamicProperty, this, bp::_1));
this->connectPropRemove =
App::GetApplication().signalRemoveDynamicProperty.connect(boost::bind
- (&PropertyView::slotRemoveDynamicProperty, this, _1));
+ (&PropertyView::slotRemoveDynamicProperty, this, bp::_1));
this->connectPropChange =
App::GetApplication().signalChangePropertyEditor.connect(boost::bind
- (&PropertyView::slotChangePropertyEditor, this, _1));
+ (&PropertyView::slotChangePropertyEditor, this, bp::_1));
this->connectActiveDoc =
Application::Instance->signalActiveDocument.connect(boost::bind
- (&PropertyView::slotActiveDocument, this, _1));
+ (&PropertyView::slotActiveDocument, this, bp::_1));
}
PropertyView::~PropertyView()
diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp
index 44b6b7e58..4a9d19e8d 100644
--- a/src/Gui/Selection.cpp
+++ b/src/Gui/Selection.cpp
@@ -26,7 +26,7 @@
#ifndef _PreComp_
# include <assert.h>
# include <string>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QApplication>
# include <QString>
# include <QStatusBar>
@@ -52,6 +52,7 @@ FC_LOG_LEVEL_INIT("Selection",false,true,true)
using namespace Gui;
using namespace std;
+namespace bp = boost::placeholders;
SelectionObserver::SelectionObserver() : blockSelection(false)
{
@@ -82,7 +83,7 @@ void SelectionObserver::attachSelection()
{
if (!connectSelection.connected()) {
connectSelection = Selection().signalSelectionChanged.connect(boost::bind
- (&SelectionObserver::_onSelectionChanged, this, _1));
+ (&SelectionObserver::_onSelectionChanged, this, bp::_1));
}
}
@@ -1026,7 +1027,7 @@ SelectionSingleton::SelectionSingleton()
hy = 0;
hz = 0;
ActiveGate = 0;
- App::GetApplication().signalDeletedObject.connect(boost::bind(&Gui::SelectionSingleton::slotDeletedObject, this, _1));
+ App::GetApplication().signalDeletedObject.connect(boost::bind(&Gui::SelectionSingleton::slotDeletedObject, this, bp::_1));
CurrentPreselection.Type = SelectionChanges::ClrSelection;
CurrentPreselection.pDocName = 0;
CurrentPreselection.pObjectName = 0;
diff --git a/src/Gui/TaskView/TaskAppearance.cpp b/src/Gui/TaskView/TaskAppearance.cpp
index 976f70713..450df1f56 100644
--- a/src/Gui/TaskView/TaskAppearance.cpp
+++ b/src/Gui/TaskView/TaskAppearance.cpp
@@ -25,7 +25,7 @@
#ifndef _PreComp_
# include <algorithm>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "ui_TaskAppearance.h"
@@ -38,6 +38,7 @@
#include <Base/Console.h>
using namespace Gui::TaskView;
+namespace bp = boost::placeholders;
/* TRANSLATOR Gui::TaskView::TaskAppearance */
@@ -57,7 +58,7 @@ TaskAppearance::TaskAppearance(QWidget *parent)
this->connectChangedObject =
Gui::Application::Instance->signalChangedObject.connect(boost::bind
- (&TaskAppearance::slotChangedObject, this, _1, _2));
+ (&TaskAppearance::slotChangedObject, this, bp::_1, bp::_2));
}
TaskAppearance::~TaskAppearance()
diff --git a/src/Gui/TaskView/TaskSelectLinkProperty.cpp b/src/Gui/TaskView/TaskSelectLinkProperty.cpp
index 62722df24..8d2faae0e 100644
--- a/src/Gui/TaskView/TaskSelectLinkProperty.cpp
+++ b/src/Gui/TaskView/TaskSelectLinkProperty.cpp
@@ -25,7 +25,6 @@
#ifndef _PreComp_
# include <algorithm>
-# include <boost/bind.hpp>
#endif
#include "ui_TaskSelectLinkProperty.h"
diff --git a/src/Gui/TaskView/TaskView.cpp b/src/Gui/TaskView/TaskView.cpp
index 2a85b4147..1d18ce781 100644
--- a/src/Gui/TaskView/TaskView.cpp
+++ b/src/Gui/TaskView/TaskView.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QAbstractSpinBox>
# include <QActionEvent>
# include <QApplication>
@@ -52,6 +52,7 @@
#endif
using namespace Gui::TaskView;
+namespace bp = boost::placeholders;
//**************************************************************************
//**************************************************************************
@@ -397,16 +398,16 @@ TaskView::TaskView(QWidget *parent)
connectApplicationActiveDocument =
App::GetApplication().signalActiveDocument.connect
- (boost::bind(&Gui::TaskView::TaskView::slotActiveDocument, this, _1));
+ (boost::bind(&Gui::TaskView::TaskView::slotActiveDocument, this, bp::_1));
connectApplicationDeleteDocument =
App::GetApplication().signalDeletedDocument.connect
(boost::bind(&Gui::TaskView::TaskView::slotDeletedDocument, this));
connectApplicationUndoDocument =
App::GetApplication().signalUndoDocument.connect
- (boost::bind(&Gui::TaskView::TaskView::slotUndoDocument, this, _1));
+ (boost::bind(&Gui::TaskView::TaskView::slotUndoDocument, this, bp::_1));
connectApplicationRedoDocument =
App::GetApplication().signalRedoDocument.connect
- (boost::bind(&Gui::TaskView::TaskView::slotRedoDocument, this, _1));
+ (boost::bind(&Gui::TaskView::TaskView::slotRedoDocument, this, bp::_1));
}
TaskView::~TaskView()
diff --git a/src/Gui/TextDocumentEditorView.cpp b/src/Gui/TextDocumentEditorView.cpp
index 771114e62..c92daf224 100644
--- a/src/Gui/TextDocumentEditorView.cpp
+++ b/src/Gui/TextDocumentEditorView.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/signals2.hpp>
#include <QString>
#include <QMessageBox>
diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp
index e3cbf44ef..3ebfa8ec0 100644
--- a/src/Gui/Tree.cpp
+++ b/src/Gui/Tree.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QAction>
# include <QActionGroup>
# include <QApplication>
@@ -59,6 +59,7 @@
#include "Widgets.h"
using namespace Gui;
+namespace bp = boost::placeholders;
QPixmap* TreeWidget::documentPixmap = 0;
const int TreeWidget::DocumentType = 1000;
@@ -115,11 +116,11 @@ TreeWidget::TreeWidget(QWidget* parent)
this, SLOT(onSearchObjects()));
// Setup connections
- connectNewDocument = Application::Instance->signalNewDocument.connect(boost::bind(&TreeWidget::slotNewDocument, this, _1));
- connectDelDocument = Application::Instance->signalDeleteDocument.connect(boost::bind(&TreeWidget::slotDeleteDocument, this, _1));
- connectRenDocument = Application::Instance->signalRenameDocument.connect(boost::bind(&TreeWidget::slotRenameDocument, this, _1));
- connectActDocument = Application::Instance->signalActiveDocument.connect(boost::bind(&TreeWidget::slotActiveDocument, this, _1));
- connectRelDocument = Application::Instance->signalRelabelDocument.connect(boost::bind(&TreeWidget::slotRelabelDocument, this, _1));
+ connectNewDocument = Application::Instance->signalNewDocument.connect(boost::bind(&TreeWidget::slotNewDocument, this, bp::_1));
+ connectDelDocument = Application::Instance->signalDeleteDocument.connect(boost::bind(&TreeWidget::slotDeleteDocument, this, bp::_1));
+ connectRenDocument = Application::Instance->signalRenameDocument.connect(boost::bind(&TreeWidget::slotRenameDocument, this, bp::_1));
+ connectActDocument = Application::Instance->signalActiveDocument.connect(boost::bind(&TreeWidget::slotActiveDocument, this, bp::_1));
+ connectRelDocument = Application::Instance->signalRelabelDocument.connect(boost::bind(&TreeWidget::slotRelabelDocument, this, bp::_1));
QStringList labels;
labels << tr("Labels & Attributes");
@@ -1208,16 +1209,16 @@ DocumentItem::DocumentItem(const Gui::Document* doc, QTreeWidgetItem * parent)
: QTreeWidgetItem(parent, TreeWidget::DocumentType), pDocument(doc)
{
// Setup connections
- connectNewObject = doc->signalNewObject.connect(boost::bind(&DocumentItem::slotNewObject, this, _1));
- connectDelObject = doc->signalDeletedObject.connect(boost::bind(&DocumentItem::slotDeleteObject, this, _1));
- connectChgObject = doc->signalChangedObject.connect(boost::bind(&DocumentItem::slotChangeObject, this, _1));
- connectRenObject = doc->signalRelabelObject.connect(boost::bind(&DocumentItem::slotRenameObject, this, _1));
- connectActObject = doc->signalActivatedObject.connect(boost::bind(&DocumentItem::slotActiveObject, this, _1));
- connectEdtObject = doc->signalInEdit.connect(boost::bind(&DocumentItem::slotInEdit, this, _1));
- connectResObject = doc->signalResetEdit.connect(boost::bind(&DocumentItem::slotResetEdit, this, _1));
- connectHltObject = doc->signalHighlightObject.connect(boost::bind(&DocumentItem::slotHighlightObject, this, _1,_2,_3));
- connectExpObject = doc->signalExpandObject.connect(boost::bind(&DocumentItem::slotExpandObject, this, _1,_2));
- connectScrObject = doc->signalScrollToObject.connect(boost::bind(&DocumentItem::slotScrollToObject, this, _1));
+ connectNewObject = doc->signalNewObject.connect(boost::bind(&DocumentItem::slotNewObject, this, bp::_1));
+ connectDelObject = doc->signalDeletedObject.connect(boost::bind(&DocumentItem::slotDeleteObject, this, bp::_1));
+ connectChgObject = doc->signalChangedObject.connect(boost::bind(&DocumentItem::slotChangeObject, this, bp::_1));
+ connectRenObject = doc->signalRelabelObject.connect(boost::bind(&DocumentItem::slotRenameObject, this, bp::_1));
+ connectActObject = doc->signalActivatedObject.connect(boost::bind(&DocumentItem::slotActiveObject, this, bp::_1));
+ connectEdtObject = doc->signalInEdit.connect(boost::bind(&DocumentItem::slotInEdit, this, bp::_1));
+ connectResObject = doc->signalResetEdit.connect(boost::bind(&DocumentItem::slotResetEdit, this, bp::_1));
+ connectHltObject = doc->signalHighlightObject.connect(boost::bind(&DocumentItem::slotHighlightObject, this, bp::_1,bp::_2,bp::_3));
+ connectExpObject = doc->signalExpandObject.connect(boost::bind(&DocumentItem::slotExpandObject, this, bp::_1,bp::_2));
+ connectScrObject = doc->signalScrollToObject.connect(boost::bind(&DocumentItem::slotScrollToObject, this, bp::_1));
setFlags(Qt::ItemIsEnabled/*|Qt::ItemIsEditable*/);
}
@@ -1812,8 +1813,8 @@ DocumentObjectItem::DocumentObjectItem(Gui::ViewProviderDocumentObject* pcViewPr
setFlags(flags()|Qt::ItemIsEditable);
// Setup connections
connectIcon = pcViewProvider->signalChangeIcon.connect(boost::bind(&DocumentObjectItem::slotChangeIcon, this));
- connectTool = pcViewProvider->signalChangeToolTip.connect(boost::bind(&DocumentObjectItem::slotChangeToolTip, this, _1));
- connectStat = pcViewProvider->signalChangeStatusTip.connect(boost::bind(&DocumentObjectItem::slotChangeStatusTip, this, _1));
+ connectTool = pcViewProvider->signalChangeToolTip.connect(boost::bind(&DocumentObjectItem::slotChangeToolTip, this, bp::_1));
+ connectStat = pcViewProvider->signalChangeStatusTip.connect(boost::bind(&DocumentObjectItem::slotChangeStatusTip, this, bp::_1));
myselves->insert(this);
}
diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp
index de33ebe77..c3c514c47 100644
--- a/src/Gui/ViewProvider.cpp
+++ b/src/Gui/ViewProvider.cpp
@@ -36,6 +36,7 @@
# include <Inventor/events/SoLocation2Event.h>
# include <Inventor/actions/SoGetMatrixAction.h>
# include <Inventor/actions/SoSearchAction.h>
+# include <boost/bind/bind.hpp>
#endif
/// Here the FreeCAD includes sorted by Base,App,Gui......
@@ -55,7 +56,6 @@
#include "SoFCDB.h"
#include "ViewProviderExtension.h"
-#include <boost/bind.hpp>
FC_LOG_LEVEL_INIT("ViewProvider",true,true)
diff --git a/src/Gui/ViewProviderOrigin.cpp b/src/Gui/ViewProviderOrigin.cpp
index 7bce98c61..635d6d632 100644
--- a/src/Gui/ViewProviderOrigin.cpp
+++ b/src/Gui/ViewProviderOrigin.cpp
@@ -29,7 +29,6 @@
# include <QPixmap>
# include <Inventor/actions/SoGetBoundingBoxAction.h>
# include <Inventor/nodes/SoSeparator.h>
-# include <boost/bind.hpp>
#endif
diff --git a/src/Gui/ViewProviderOriginGroup.cpp b/src/Gui/ViewProviderOriginGroup.cpp
index 264d54c0e..b16459c6e 100644
--- a/src/Gui/ViewProviderOriginGroup.cpp
+++ b/src/Gui/ViewProviderOriginGroup.cpp
@@ -23,9 +23,6 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <Inventor/actions/SoGetBoundingBoxAction.h>
-# include <Inventor/nodes/SoSeparator.h>
-# include <boost/bind.hpp>
#endif
#include <Base/Console.h>
diff --git a/src/Gui/ViewProviderOriginGroupExtension.cpp b/src/Gui/ViewProviderOriginGroupExtension.cpp
index 02577a025..15da22558 100644
--- a/src/Gui/ViewProviderOriginGroupExtension.cpp
+++ b/src/Gui/ViewProviderOriginGroupExtension.cpp
@@ -25,6 +25,9 @@
#include "PreCompiled.h"
#ifndef _PreComp_
+#include <boost/bind/bind.hpp>
+#include <Inventor/actions/SoGetBoundingBoxAction.h>
+#include <Inventor/nodes/SoSeparator.h>
#endif
#include "ViewProviderOriginGroupExtension.h"
@@ -39,11 +42,10 @@
#include <App/Document.h>
#include <App/Origin.h>
#include <Base/Console.h>
-#include <boost/bind.hpp>
-#include <Inventor/actions/SoGetBoundingBoxAction.h>
-#include <Inventor/nodes/SoSeparator.h>
using namespace Gui;
+namespace bp = boost::placeholders;
+
EXTENSION_PROPERTY_SOURCE(Gui::ViewProviderOriginGroupExtension, Gui::ViewProviderGeoFeatureGroupExtension)
@@ -97,10 +99,10 @@ void ViewProviderOriginGroupExtension::extensionAttach(App::DocumentObject *pcOb
assert ( gdoc );
connectChangedObjectApp = adoc->signalChangedObject.connect (
- boost::bind ( &ViewProviderOriginGroupExtension::slotChangedObjectApp, this, _1) );
+ boost::bind ( &ViewProviderOriginGroupExtension::slotChangedObjectApp, this, bp::_1) );
connectChangedObjectGui = gdoc->signalChangedObject.connect (
- boost::bind ( &ViewProviderOriginGroupExtension::slotChangedObjectGui, this, _1) );
+ boost::bind ( &ViewProviderOriginGroupExtension::slotChangedObjectGui, this, bp::_1) );
}
void ViewProviderOriginGroupExtension::extensionUpdateData( const App::Property* prop ) {
diff --git a/src/Gui/ViewProviderPart.cpp b/src/Gui/ViewProviderPart.cpp
index d59f10b49..252939936 100644
--- a/src/Gui/ViewProviderPart.cpp
+++ b/src/Gui/ViewProviderPart.cpp
@@ -27,7 +27,7 @@
# include <QApplication>
# include <QMenu>
# include <QPixmap>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include <App/Part.h>
diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp
index 58891dd32..fbed4720c 100644
--- a/src/Gui/ViewProviderPythonFeature.cpp
+++ b/src/Gui/ViewProviderPythonFeature.cpp
@@ -30,7 +30,7 @@
# include <QFileInfo>
# include <QMenu>
# include <QPixmap>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <Inventor/nodes/SoDrawStyle.h>
# include <Inventor/nodes/SoMaterial.h>
# include <Inventor/nodes/SoSeparator.h>
@@ -66,6 +66,7 @@
using namespace Gui;
+namespace bp = boost::placeholders;
// #0003564: Python objects: updateData calls to proxy instance that should have been deleted
// See https://forum.freecadweb.org/viewtopic.php?f=22&t=30429&p=252429#p252429
@@ -210,11 +211,11 @@ void ViewProviderPythonFeatureObserver::slotDeleteObject(const Gui::ViewProvider
ViewProviderPythonFeatureObserver::ViewProviderPythonFeatureObserver()
{
Gui::Application::Instance->signalDeletedObject.connect(boost::bind
- (&ViewProviderPythonFeatureObserver::slotDeleteObject, this, _1));
+ (&ViewProviderPythonFeatureObserver::slotDeleteObject, this, bp::_1));
Gui::Application::Instance->signalNewObject.connect(boost::bind
- (&ViewProviderPythonFeatureObserver::slotAppendObject, this, _1));
+ (&ViewProviderPythonFeatureObserver::slotAppendObject, this, bp::_1));
Gui::Application::Instance->signalDeleteDocument.connect(boost::bind
- (&ViewProviderPythonFeatureObserver::slotDeleteDocument, this, _1));
+ (&ViewProviderPythonFeatureObserver::slotDeleteDocument, this, bp::_1));
}
ViewProviderPythonFeatureObserver::~ViewProviderPythonFeatureObserver()
diff --git a/src/Gui/ViewProviderTextDocument.cpp b/src/Gui/ViewProviderTextDocument.cpp
index 19133c650..b5db02a6b 100644
--- a/src/Gui/ViewProviderTextDocument.cpp
+++ b/src/Gui/ViewProviderTextDocument.cpp
@@ -26,7 +26,7 @@
#ifndef _PreComp_
# include <QMenu>
# include <QPlainTextEdit>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include <Base/Type.h>
diff --git a/src/Mod/Assembly/App/PartRef.cpp b/src/Mod/Assembly/App/PartRef.cpp
index f3cf79600..033c4e9b7 100644
--- a/src/Mod/Assembly/App/PartRef.cpp
+++ b/src/Mod/Assembly/App/PartRef.cpp
@@ -148,7 +148,7 @@ void PartRef::ensureInitialisation() {
else {
m_part = solver->createPart(ass->m_downstream_placement*Placement.getValue(), Uid.getValueStr());
}
- m_part->connectSignal<dcm::recalculated>(boost::bind(&PartRef::setCalculatedPlacement, this, _1));
+ m_part->connectSignal<dcm::recalculated>(boost::bind(&PartRef::setCalculatedPlacement, this, bp::_1));
};
}
diff --git a/src/Mod/Assembly/App/opendcm/core/imp/clustergraph_imp.hpp b/src/Mod/Assembly/App/opendcm/core/imp/clustergraph_imp.hpp
index 678e14e83..c9cbba253 100644
--- a/src/Mod/Assembly/App/opendcm/core/imp/clustergraph_imp.hpp
+++ b/src/Mod/Assembly/App/opendcm/core/imp/clustergraph_imp.hpp
@@ -27,7 +27,9 @@
#include <boost/fusion/include/at_c.hpp>
#include <boost/fusion/include/make_vector.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
+
+namespace bp = boost::placeholders;
namespace dcm {
@@ -686,7 +688,7 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::downstreamRemo
re.push_back(* (it.first));
};
- std::for_each(re.begin(), re.end(), boost::bind(&ClusterGraph::simpleRemoveEdge, this, _1));
+ std::for_each(re.begin(), re.end(), boost::bind(&ClusterGraph::simpleRemoveEdge, this, bp::_1));
//if we have the real vertex here and not only a containing cluster we can delete it
if(!isCluster(res.first)) {
@@ -751,7 +753,7 @@ template<typename Functor>
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeEdge(LocalEdge id, Functor& f) {
std::vector<edge_bundle_single>& vec = fusion::at_c<1> ((*this) [id]);
- std::for_each(vec.begin(), vec.end(), boost::bind<void> (boost::ref(apply_remove_prediacte<placehoder, ClusterGraph> (f, -1)), _1));
+ std::for_each(vec.begin(), vec.end(), boost::bind<void> (boost::ref(apply_remove_prediacte<placehoder, ClusterGraph> (f, -1)), bp::_1));
boost::remove_edge(id, *this);
};
diff --git a/src/Mod/Assembly/App/opendcm/module3d/imp/module_imp.hpp b/src/Mod/Assembly/App/opendcm/module3d/imp/module_imp.hpp
index 983b3ab09..ac93f0a88 100644
--- a/src/Mod/Assembly/App/opendcm/module3d/imp/module_imp.hpp
+++ b/src/Mod/Assembly/App/opendcm/module3d/imp/module_imp.hpp
@@ -22,10 +22,11 @@
#include "../module.hpp"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "constraint3d_imp.hpp"
#include "geometry3d_imp.hpp"
+namespace bp = boost::placeholders;
namespace dcm {
@@ -112,7 +113,7 @@ void Module3D<Typelist, ID>::type<Sys>::inheriter_base::removeGeometry3D(Geom g)
g->template emitSignal<remove>(g);
//remove the vertex from graph and emit all edges that get removed with the functor
- boost::function<void(GlobalEdge)> functor = boost::bind(&inheriter_base::apply_edge_remove, this, _1);
+ boost::function<void(GlobalEdge)> functor = boost::bind(&inheriter_base::apply_edge_remove, this, bp::_1);
m_this->m_cluster->removeVertex(v, functor);
m_this->erase(g);
};
diff --git a/src/Mod/Assembly/App/opendcm/moduleShape3d/generator.hpp b/src/Mod/Assembly/App/opendcm/moduleShape3d/generator.hpp
index 38eb3b8d3..100bce8f8 100644
--- a/src/Mod/Assembly/App/opendcm/moduleShape3d/generator.hpp
+++ b/src/Mod/Assembly/App/opendcm/moduleShape3d/generator.hpp
@@ -28,7 +28,8 @@
#include "defines.hpp"
#include <boost/exception/errinfo_errno.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
+namespace bp = boost::placeholders;
namespace dcm {
@@ -159,7 +160,7 @@ struct segment3D {
base::append(g1);
g1->template linkTo<tag::segment3D>(base::m_shape,0);
g1->template setProperty<typename base::shape_purpose_prop>(line);
- g1->template connectSignal<recalculated>(boost::bind(&base::Shape3D::recalc, base::m_shape, _1));
+ g1->template connectSignal<recalculated>(boost::bind(&base::Shape3D::recalc, base::m_shape, bp::_1));
//we have a segment, lets link the two points to it
boost::shared_ptr<Geometry3D> g2 = base::m_system->createGeometry3D();
@@ -205,7 +206,7 @@ struct segment3D {
base::append(g3);
g3->template linkTo<tag::segment3D>(base::m_shape,0);
g3->template setProperty<typename base::shape_purpose_prop>(line);
- g3->template connectSignal<recalculated>(boost::bind(&base::Shape3D::recalc, base::m_shape, _1));
+ g3->template connectSignal<recalculated>(boost::bind(&base::Shape3D::recalc, base::m_shape, bp::_1));
//link the points to our new segment
g1->template linkTo<tag::point3D>(base::m_shape, 0);
diff --git a/src/Mod/Assembly/App/opendcm/moduleShape3d/module.hpp b/src/Mod/Assembly/App/opendcm/moduleShape3d/module.hpp
index 34a7da953..e42111a7d 100644
--- a/src/Mod/Assembly/App/opendcm/moduleShape3d/module.hpp
+++ b/src/Mod/Assembly/App/opendcm/moduleShape3d/module.hpp
@@ -572,7 +572,7 @@ boost::shared_ptr<Derived>
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::shared_ptr<Geometry3D> g) {
g->template setProperty<shape_geometry_prop>(true);
- Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Geometry3D>)>(&Shape3D_base::remove) , this, _1));
+ Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Geometry3D>)>(&Shape3D_base::remove) , this, bp::_1));
m_geometries.push_back(fusion::make_vector(g,c));
return ObjBase::shared_from_this();
@@ -585,7 +585,7 @@ template<typename Derived>
boost::shared_ptr<Derived>
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::shared_ptr<Derived> g) {
- Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Derived>)>(&Shape3D_base::remove) , this, _1));
+ Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Derived>)>(&Shape3D_base::remove) , this, bp::_1));
m_shapes.push_back(fusion::make_vector(g,c));
return ObjBase::shared_from_this();
@@ -597,7 +597,7 @@ template<typename Derived>
boost::shared_ptr<Derived>
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::shared_ptr<Constraint3D> g) {
- Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Constraint3D>)>(&Shape3D_base::remove) , this, _1));
+ Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Constraint3D>)>(&Shape3D_base::remove) , this, bp::_1));
m_constraints.push_back(fusion::make_vector(g,c));
return ObjBase::shared_from_this();
diff --git a/src/Mod/Assembly/Gui/TaskAssemblyConstraints.cpp b/src/Mod/Assembly/Gui/TaskAssemblyConstraints.cpp
index 1ab6005f6..fdead6c04 100644
--- a/src/Mod/Assembly/Gui/TaskAssemblyConstraints.cpp
+++ b/src/Mod/Assembly/Gui/TaskAssemblyConstraints.cpp
@@ -42,7 +42,6 @@
#include <Gui/ViewProvider.h>
#include <Gui/MainWindow.h>
#include <Gui/BitmapFactory.h>
-#include <boost/bind.hpp>
using namespace AssemblyGui;
using namespace Gui::TaskView;
diff --git a/src/Mod/Assembly/Gui/Workbench.cpp b/src/Mod/Assembly/Gui/Workbench.cpp
index b93dc6f6d..c751ae1eb 100644
--- a/src/Mod/Assembly/Gui/Workbench.cpp
+++ b/src/Mod/Assembly/Gui/Workbench.cpp
@@ -25,7 +25,7 @@
#ifndef _PreComp_
# include <qobject.h>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
@@ -39,7 +39,7 @@
#include "Workbench.h"
using namespace AssemblyGui;
-
+namespace bp = boost::placeholders;
@@ -202,10 +202,10 @@ void Workbench::activated()
//}
// Let us be notified when a document is activated, so that we can update the ActivePartObject
- Gui::Application::Instance->signalActiveDocument.connect(boost::bind(&Workbench::slotActiveDocument, this, _1));
- App::GetApplication().signalNewDocument.connect(boost::bind(&Workbench::slotNewDocument, this, _1));
- App::GetApplication().signalFinishRestoreDocument.connect(boost::bind(&Workbench::slotFinishRestoreDocument, this, _1));
- App::GetApplication().signalDeleteDocument.connect(boost::bind(&Workbench::slotDeleteDocument, this, _1));
+ Gui::Application::Instance->signalActiveDocument.connect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
+ App::GetApplication().signalNewDocument.connect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
+ App::GetApplication().signalFinishRestoreDocument.connect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
+ App::GetApplication().signalDeleteDocument.connect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
Gui::Control().showModelView();
@@ -216,10 +216,10 @@ void Workbench::deactivated()
Gui::Command::doCommand(Gui::Command::Doc,"AssemblyGui.setActiveAssembly(None)");
// Disconnect all document signals...
- Gui::Application::Instance->signalActiveDocument.disconnect(boost::bind(&Workbench::slotActiveDocument, this, _1));
- App::GetApplication().signalNewDocument.disconnect(boost::bind(&Workbench::slotNewDocument, this, _1));
- App::GetApplication().signalFinishRestoreDocument.disconnect(boost::bind(&Workbench::slotFinishRestoreDocument, this, _1));
- App::GetApplication().signalDeleteDocument.disconnect(boost::bind(&Workbench::slotDeleteDocument, this, _1));
+ Gui::Application::Instance->signalActiveDocument.disconnect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
+ App::GetApplication().signalNewDocument.disconnect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
+ App::GetApplication().signalFinishRestoreDocument.disconnect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
+ App::GetApplication().signalDeleteDocument.disconnect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
Gui::Workbench::deactivated();
removeTaskWatcher();
diff --git a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp
index e1c90e27a..bd4289eae 100644
--- a/src/Mod/Drawing/Gui/TaskOrthoViews.cpp
+++ b/src/Mod/Drawing/Gui/TaskOrthoViews.cpp
@@ -35,12 +35,13 @@
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Drawing/App/FeaturePage.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
using namespace Gui;
using namespace DrawingGui;
using namespace std;
+namespace bp = boost::placeholders;
#ifndef PI
@@ -304,9 +305,9 @@ OrthoViews::OrthoViews(App::Document* doc, const char * pagename, const char * p
num_gaps_x = num_gaps_y = 0;
this->connectDocumentDeletedObject = doc->signalDeletedObject.connect(boost::bind
- (&OrthoViews::slotDeletedObject, this, _1));
+ (&OrthoViews::slotDeletedObject, this, bp::_1));
this->connectApplicationDeletedDocument = App::GetApplication().signalDeleteDocument.connect(boost::bind
- (&OrthoViews::slotDeletedDocument, this, _1));
+ (&OrthoViews::slotDeletedDocument, this, bp::_1));
}
OrthoViews::~OrthoViews()
diff --git a/src/Mod/Fem/Gui/PreCompiled.h b/src/Mod/Fem/Gui/PreCompiled.h
index 94309cd4c..a096ff504 100644
--- a/src/Mod/Fem/Gui/PreCompiled.h
+++ b/src/Mod/Fem/Gui/PreCompiled.h
@@ -64,7 +64,7 @@
#include <bitset>
// boost
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#ifdef FC_OS_WIN32
# include <windows.h>
diff --git a/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp b/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp
index f062ad772..d1e9e8335 100644
--- a/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp
+++ b/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp
@@ -25,7 +25,7 @@
#ifndef _PreComp_
# include <Standard_math.hxx>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QAction>
# include <QMenu>
#endif
diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp
index 91b615aa4..1d305f3ea 100644
--- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp
+++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp
@@ -1,612 +1,612 @@
-/***************************************************************************
- * Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
- * *
- * This file is part of the FreeCAD CAx development system. *
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
- * *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
- * *
- ***************************************************************************/
-
-
-#include "PreCompiled.h"
-
-#ifndef _PreComp_
-#include <Inventor/nodes/SoCoordinate3.h>
-#include <Inventor/nodes/SoMaterial.h>
-#include <Inventor/nodes/SoSurroundScale.h>
-#include <Inventor/nodes/SoLineSet.h>
-#include <Inventor/nodes/SoSeparator.h>
-#include <Inventor/nodes/SoTransform.h>
-#include <Inventor/nodes/SoMatrixTransform.h>
-#include <Inventor/nodes/SoSphere.h>
-#include <Inventor/manips/SoTransformManip.h>
-#include <Inventor/manips/SoCenterballManip.h>
-#include <Inventor/manips/SoTransformerManip.h>
-#include <Inventor/manips/SoTransformBoxManip.h>
-#include <Inventor/manips/SoHandleBoxManip.h>
-#include <Inventor/manips/SoTabBoxManip.h>
-#include <Inventor/actions/SoSearchAction.h>
-#include <Inventor/engines/SoDecomposeMatrix.h>
-#include <Inventor/draggers/SoCenterballDragger.h>
-#include <Inventor/draggers/SoTransformerDragger.h>
-#include <Inventor/draggers/SoTransformBoxDragger.h>
-#include <Inventor/draggers/SoHandleBoxDragger.h>
-#include <QMessageBox>
-#endif
-
-#include "ViewProviderFemPostFunction.h"
-#include "TaskPostBoxes.h"
-#include <Mod/Fem/App/FemPostFunction.h>
-#include <Base/Console.h>
-#include <Base/Interpreter.h>
-#include <Gui/Application.h>
-#include <Gui/Document.h>
-#include <Gui/SoNavigationDragger.h>
-#include <Gui/Macro.h>
-#include <Gui/TaskView/TaskDialog.h>
-#include <Gui/Control.h>
-#include <App/PropertyUnits.h>
-
-#include <boost/bind.hpp>
-#include <math.h>
-
-#include "ui_PlaneWidget.h"
-#include "ui_SphereWidget.h"
-
-using namespace FemGui;
-
-void FunctionWidget::setViewProvider(ViewProviderFemPostFunction* view) {
-
- m_view = view;
- m_object = static_cast<Fem::FemPostFunction*>(view->getObject());
- m_connection = m_object->getDocument()->signalChangedObject.connect(boost::bind(&FunctionWidget::onObjectsChanged, this, _1, _2));
-}
-
-void FunctionWidget::onObjectsChanged(const App::DocumentObject& obj, const App::Property& p) {
-
- if(&obj == m_object)
- onChange(p);
-}
-
-
-PROPERTY_SOURCE(FemGui::ViewProviderFemPostFunctionProvider, Gui::ViewProviderDocumentObject)
-
-ViewProviderFemPostFunctionProvider::ViewProviderFemPostFunctionProvider() {
-
-}
-
-ViewProviderFemPostFunctionProvider::~ViewProviderFemPostFunctionProvider() {
-
-}
-
-std::vector< App::DocumentObject* > ViewProviderFemPostFunctionProvider::claimChildren(void) const {
-
- return static_cast<Fem::FemPostFunctionProvider*>(getObject())->Functions.getValues();
-}
-
-std::vector< App::DocumentObject* > ViewProviderFemPostFunctionProvider::claimChildren3D(void) const {
- return claimChildren();
-}
-
-void ViewProviderFemPostFunctionProvider::onChanged(const App::Property* prop) {
- Gui::ViewProviderDocumentObject::onChanged(prop);
-
- updateSize();
-}
-
-void ViewProviderFemPostFunctionProvider::updateData(const App::Property* prop) {
- Gui::ViewProviderDocumentObject::updateData(prop);
-
- if(strcmp(prop->getName(), "Functions") == 0) {
- updateSize();
- }
-}
-
-void ViewProviderFemPostFunctionProvider::updateSize() {
-
- std::vector< App::DocumentObject* > vec = claimChildren();
- for(std::vector< App::DocumentObject* >::iterator it = vec.begin(); it != vec.end(); ++it) {
-
- if(!(*it)->isDerivedFrom(Fem::FemPostFunction::getClassTypeId()))
- continue;
-
- ViewProviderFemPostFunction* vp = static_cast<FemGui::ViewProviderFemPostFunction*>(Gui::Application::Instance->getViewProvider(*it));
- vp->AutoScaleFactorX.setValue(SizeX.getValue());
- vp->AutoScaleFactorY.setValue(SizeY.getValue());
- vp->AutoScaleFactorZ.setValue(SizeZ.getValue());
- }
-}
-
-
-
-PROPERTY_SOURCE(FemGui::ViewProviderFemPostFunction, Gui::ViewProviderDocumentObject)
-
-ViewProviderFemPostFunction::ViewProviderFemPostFunction() : m_autoscale(false), m_isDragging(false)
-{
-
- ADD_PROPERTY_TYPE(AutoScaleFactorX, (1), "AutoScale", App::Prop_Hidden, "Automatic scaling factor");
- ADD_PROPERTY_TYPE(AutoScaleFactorY, (1), "AutoScale", App::Prop_Hidden, "Automatic scaling factor");
- ADD_PROPERTY_TYPE(AutoScaleFactorZ, (1), "AutoScale", App::Prop_Hidden, "Automatic scaling factor");
-
- m_geometrySeperator = new SoSeparator();
- m_geometrySeperator->ref();
-
- m_transform = new SoTransform();
- m_transform->ref();
-
- m_scale = new SoScale();
- m_scale->ref();
- m_scale->scaleFactor = SbVec3f(1,1,1);
-}
-
-ViewProviderFemPostFunction::~ViewProviderFemPostFunction()
-{
- m_geometrySeperator->unref();
- m_manip->unref();
- m_scale->unref();
- //transform is unref'd when it is replaced by the dragger
-}
-
-void ViewProviderFemPostFunction::attach(App::DocumentObject *pcObj)
-{
- ViewProviderDocumentObject::attach(pcObj);
-
- // setup the graph for editing the function unit geometry
- SoMaterial* color = new SoMaterial();
- color->diffuseColor.setValue(0,0,1);
- color->transparency.setValue(0.5);
-
- m_transform = new SoTransform;
-
- m_manip = setupManipulator();
- m_manip->ref();
-
- SoSeparator* pcEditNode = new SoSeparator();
-
- pcEditNode->addChild(color);
- pcEditNode->addChild(m_transform);
- pcEditNode->addChild(m_geometrySeperator);
-
- m_geometrySeperator->insertChild(m_scale, 0);
-
- // Now we replace the SoTransform node by a manipulator
- // Note: Even SoCenterballManip inherits from SoTransform
- // we cannot use it directly (in above code) because the
- // translation and center fields are overridden.
- SoSearchAction sa;
- sa.setInterest(SoSearchAction::FIRST);
- sa.setSearchingAll(FALSE);
- sa.setNode(m_transform);
- sa.apply(pcEditNode);
- SoPath * path = sa.getPath();
- if (path) {
- m_manip->replaceNode(path);
-
- SoDragger* dragger = m_manip->getDragger();
- dragger->addStartCallback(dragStartCallback, this);
- dragger->addFinishCallback(dragFinishCallback, this);
- dragger->addMotionCallback(dragMotionCallback, this);
- }
-
- addDisplayMaskMode(pcEditNode, "Default");
- setDisplayMaskMode("Default");
-}
-
-bool ViewProviderFemPostFunction::doubleClicked(void) {
- Gui::Application::Instance->activeDocument()->setEdit(this, (int)ViewProvider::Default);
- return true;
-}
-
-
-SoTransformManip* ViewProviderFemPostFunction::setupManipulator() {
-
- return new SoCenterballManip;
-}
-
-
-std::vector<std::string> ViewProviderFemPostFunction::getDisplayModes(void) const
-{
- std::vector<std::string> StrList;
- StrList.push_back("Default");
- return StrList;
-}
-
-void ViewProviderFemPostFunction::dragStartCallback(void *data, SoDragger *)
-{
- // This is called when a manipulator is about to manipulating
- Gui::Application::Instance->activeDocument()->openCommand("Edit Mirror");
- reinterpret_cast<ViewProviderFemPostFunction*>(data)->m_isDragging = true;
-
- ViewProviderFemPostFunction* that = reinterpret_cast<ViewProviderFemPostFunction*>(data);
- ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Fem");
- that->m_autoRecompute = hGrp->GetBool("PostAutoRecompute", false);
-}
-
-void ViewProviderFemPostFunction::dragFinishCallback(void *data, SoDragger *)
-{
- // This is called when a manipulator has done manipulating
- Gui::Application::Instance->activeDocument()->commitCommand();
-
- ViewProviderFemPostFunction* that = reinterpret_cast<ViewProviderFemPostFunction*>(data);
- if(that->m_autoRecompute)
- that->getObject()->getDocument()->recompute();
-
- reinterpret_cast<ViewProviderFemPostFunction*>(data)->m_isDragging = false;
-}
-
-void ViewProviderFemPostFunction::dragMotionCallback(void *data, SoDragger *drag)
-{
- ViewProviderFemPostFunction* that = reinterpret_cast<ViewProviderFemPostFunction*>(data);
- that->draggerUpdate(drag);
-
- if(that->m_autoRecompute)
- that->getObject()->getDocument()->recompute();
-}
-
-
-bool ViewProviderFemPostFunction::setEdit(int ModNum) {
-
-
- if (ModNum == ViewProvider::Default || ModNum == 1 ) {
-
- Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
- TaskDlgPost *postDlg = qobject_cast<TaskDlgPost*>(dlg);
- if (postDlg && postDlg->getView() != this)
- postDlg = 0; // another pad left open its task panel
- if (dlg && !postDlg) {
- QMessageBox msgBox;
- msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
- msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::Yes);
- int ret = msgBox.exec();
- if (ret == QMessageBox::Yes)
- Gui::Control().reject();
- else
- return false;
- }
-
- // start the edit dialog
- if (postDlg)
- Gui::Control().showDialog(postDlg);
- else {
- postDlg = new TaskDlgPost(this);
- postDlg->appendBox(new TaskPostFunction(this));
- Gui::Control().showDialog(postDlg);
- }
-
- return true;
- }
- else {
- return ViewProviderDocumentObject::setEdit(ModNum);
- }
-}
-
-void ViewProviderFemPostFunction::unsetEdit(int ModNum) {
-
- if (ModNum == ViewProvider::Default) {
- // when pressing ESC make sure to close the dialog
- Gui::Control().closeDialog();
- }
- else {
- ViewProviderDocumentObject::unsetEdit(ModNum);
- }
-}
-
-void ViewProviderFemPostFunction::onChanged(const App::Property* prop) {
-
- Gui::ViewProviderDocumentObject::onChanged(prop);
-
- if(m_autoscale)
- m_scale->scaleFactor = SbVec3f(AutoScaleFactorX.getValue(), AutoScaleFactorY.getValue(), AutoScaleFactorZ.getValue());
-}
-
-
-
-//#################################################################################################
-
-PROPERTY_SOURCE(FemGui::ViewProviderFemPostPlaneFunction, FemGui::ViewProviderFemPostFunction)
-
-ViewProviderFemPostPlaneFunction::ViewProviderFemPostPlaneFunction() {
-
- sPixmap = "fem-post-geo-plane";
-
- setAutoScale(true);
-
- //setup the visualisation geometry
- SoCoordinate3* points = new SoCoordinate3();
- points->point.setNum(4);
- points->point.set1Value(0, -0.5, -0.5, 0);
- points->point.set1Value(1, -0.5, 0.5, 0);
- points->point.set1Value(2, 0.5, 0.5, 0);
- points->point.set1Value(3, 0.5, -0.5, 0);
- points->point.set1Value(4, -0.5, -0.5, 0);
- SoLineSet* line = new SoLineSet();
- getGeometryNode()->addChild(points);
- getGeometryNode()->addChild(line);
-}
-
-ViewProviderFemPostPlaneFunction::~ViewProviderFemPostPlaneFunction() {
-
-}
-
-void ViewProviderFemPostPlaneFunction::draggerUpdate(SoDragger* m) {
-
- Fem::FemPostPlaneFunction* func = static_cast<Fem::FemPostPlaneFunction*>(getObject());
- SoCenterballDragger* dragger = static_cast<SoCenterballDragger*>(m);
-
- // the new axis of the plane
- SbRotation rot, scaleDir;
- const SbVec3f& center = dragger->center.getValue();
-
- SbVec3f norm(0,0,1);
- dragger->rotation.getValue().multVec(norm,norm);
- func->Origin.setValue(center[0], center[1], center[2]);
- func->Normal.setValue(norm[0],norm[1],norm[2]);
-
- SbVec3f t = static_cast<SoCenterballManip*>(getManipulator())->translation.getValue();
- SbVec3f rt, irt;
- dragger->rotation.getValue().multVec(t,rt);
- dragger->rotation.getValue().inverse().multVec(t,irt);
-}
-
-void ViewProviderFemPostPlaneFunction::updateData(const App::Property* p) {
-
- Fem::FemPostPlaneFunction* func = static_cast<Fem::FemPostPlaneFunction*>(getObject());
-
- if(!isDragging() && (p == &func->Origin || p == &func->Normal)) {
-
- Base::Vector3d trans = func->Origin.getValue();
- Base::Vector3d norm = func->Normal.getValue();
-
- norm = norm / norm.Length();
- SbRotation rot(SbVec3f(0.,0.,1.), SbVec3f(norm.x, norm.y, norm.z));
-
- SbMatrix t, translate;
- t.setRotate(rot);
- translate.setTranslate(SbVec3f(trans.x, trans.y, trans.z));
- t.multRight(translate);
- getManipulator()->setMatrix(t);
- }
- Gui::ViewProviderDocumentObject::updateData(p);
-}
-
-
-FunctionWidget* ViewProviderFemPostPlaneFunction::createControlWidget() {
- return new PlaneWidget();
-}
-
-
-PlaneWidget::PlaneWidget() {
-
- ui = new Ui_PlaneWidget();
- ui->setupUi(this);
-
- connect(ui->originX, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double)));
- connect(ui->originY, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double)));
- connect(ui->originZ, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double)));
- connect(ui->normalX, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double)));
- connect(ui->normalY, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double)));
- connect(ui->normalZ, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double)));
-
-}
-
-PlaneWidget::~PlaneWidget() {
-
-}
-
-void PlaneWidget::applyPythonCode() {
-
-}
-
-void PlaneWidget::setViewProvider(ViewProviderFemPostFunction* view) {
-
- FemGui::FunctionWidget::setViewProvider(view);
- onChange(static_cast<Fem::FemPostPlaneFunction*>(getObject())->Normal);
- onChange(static_cast<Fem::FemPostPlaneFunction*>(getObject())->Origin);
-}
-
-void PlaneWidget::onChange(const App::Property& p) {
-
- setBlockObjectUpdates(true);
- if(strcmp(p.getName(), "Normal") == 0) {
- const Base::Vector3d& vec = static_cast<const App::PropertyVector*>(&p)->getValue();
- ui->normalX->setValue(vec.x);
- ui->normalY->setValue(vec.y);
- ui->normalZ->setValue(vec.z);
- }
- else if(strcmp(p.getName(), "Origin") == 0) {
- const Base::Vector3d& vec = static_cast<const App::PropertyVectorDistance*>(&p)->getValue();
- ui->originX->setValue(vec.x);
- ui->originY->setValue(vec.y);
- ui->originZ->setValue(vec.z);
- }
- setBlockObjectUpdates(false);
-}
-
-void PlaneWidget::normalChanged(double) {
-
- if(!blockObjectUpdates()) {
- Base::Vector3d vec(ui->normalX->value(), ui->normalY->value(), ui->normalZ->value());
- static_cast<Fem::FemPostPlaneFunction*>(getObject())->Normal.setValue(vec);
- }
-}
-
-void PlaneWidget::originChanged(double) {
-
- if(!blockObjectUpdates()) {
- Base::Vector3d vec(ui->originX->value(), ui->originY->value(), ui->originZ->value());
- static_cast<Fem::FemPostPlaneFunction*>(getObject())->Origin.setValue(vec);
- }
-}
-
-
-
-//#################################################################################################
-
-PROPERTY_SOURCE(FemGui::ViewProviderFemPostSphereFunction, FemGui::ViewProviderFemPostFunction)
-
-ViewProviderFemPostSphereFunction::ViewProviderFemPostSphereFunction() {
-
- sPixmap = "fem-post-geo-sphere";
-
- setAutoScale(false);
-
- //setup the visualisation geometry
- SoCoordinate3* points = new SoCoordinate3();
- points->point.setNum(2*84);
- int idx = 0;
- for(int i=0; i<4; i++) {
- for(int j=0; j<21; j++) {
- points->point.set1Value(idx, SbVec3f(std::sin(2*M_PI/20*j) * std::cos(M_PI/4*i),
- std::sin(2*M_PI/20*j) * std::sin(M_PI/4*i),
- std::cos(2*M_PI/20*j) ));
- ++idx;
- }
- }
- for(int i=0; i<4; i++) {
- for(int j=0; j<21; j++) {
- points->point.set1Value(idx, SbVec3f(std::sin(M_PI/4*i) * std::cos(2*M_PI/20*j),
- std::sin(M_PI/4*i) * std::sin(2*M_PI/20*j),
- std::cos(M_PI/4*i) ));
- ++idx;
- }
- }
-
- SoLineSet* line = new SoLineSet();
- getGeometryNode()->addChild(points);
- getGeometryNode()->addChild(line);
-}
-
-ViewProviderFemPostSphereFunction::~ViewProviderFemPostSphereFunction() {
-}
-
-SoTransformManip* ViewProviderFemPostSphereFunction::setupManipulator() {
- SoHandleBoxManip* manip = new SoHandleBoxManip();
- manip->getDragger()->setPart("extruder1", new SoSeparator);
- manip->getDragger()->setPart("extruder2", new SoSeparator);
- manip->getDragger()->setPart("extruder3", new SoSeparator);
- manip->getDragger()->setPart("extruder4", new SoSeparator);
- manip->getDragger()->setPart("extruder5", new SoSeparator);
- manip->getDragger()->setPart("extruder6", new SoSeparator);
- manip->getDragger()->setPart("extruder1Active", new SoSeparator);
- manip->getDragger()->setPart("extruder2Active", new SoSeparator);
- manip->getDragger()->setPart("extruder3Active", new SoSeparator);
- manip->getDragger()->setPart("extruder4Active", new SoSeparator);
- manip->getDragger()->setPart("extruder5Active", new SoSeparator);
- manip->getDragger()->setPart("extruder6Active", new SoSeparator);
-
- return manip;
-}
-
-
-void ViewProviderFemPostSphereFunction::draggerUpdate(SoDragger* m) {
-
- Fem::FemPostSphereFunction* func = static_cast<Fem::FemPostSphereFunction*>(getObject());
- SoHandleBoxDragger* dragger = static_cast<SoHandleBoxDragger*>(m);
-
- // the new axis of the plane
- SbRotation rot, scaleDir;
- const SbVec3f& center = dragger->translation.getValue();
-
- SbVec3f norm(0,0,1);
- func->Center.setValue(center[0], center[1], center[2]);
- func->Radius.setValue(dragger->scaleFactor.getValue()[0]);
-}
-
-void ViewProviderFemPostSphereFunction::updateData(const App::Property* p) {
-
- Fem::FemPostSphereFunction* func = static_cast<Fem::FemPostSphereFunction*>(getObject());
-
- if(!isDragging() && (p == &func->Center || p == &func->Radius)) {
-
- Base::Vector3d trans = func->Center.getValue();
- double radius = func->Radius.getValue();
-
- SbMatrix t, translate;
- t.setScale(radius);
- translate.setTranslate(SbVec3f(trans.x, trans.y, trans.z));
- t.multRight(translate);
- getManipulator()->setMatrix(t);
-
- }
- Gui::ViewProviderDocumentObject::updateData(p);
-}
-
-
-FunctionWidget* ViewProviderFemPostSphereFunction::createControlWidget() {
- return new SphereWidget();
-}
-
-
-SphereWidget::SphereWidget() {
-
- ui = new Ui_SphereWidget();
- ui->setupUi(this);
-
- connect(ui->centerX, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
- connect(ui->centerY, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
- connect(ui->centerZ, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
- connect(ui->radius, SIGNAL(valueChanged(double)), this, SLOT(radiusChanged(double)));
-}
-
-SphereWidget::~SphereWidget() {
-
-}
-
-void SphereWidget::applyPythonCode() {
-
-}
-
-void SphereWidget::setViewProvider(ViewProviderFemPostFunction* view) {
-
- FemGui::FunctionWidget::setViewProvider(view);
- onChange(static_cast<Fem::FemPostSphereFunction*>(getObject())->Center);
- onChange(static_cast<Fem::FemPostSphereFunction*>(getObject())->Radius);
-}
-
-void SphereWidget::onChange(const App::Property& p) {
-
- setBlockObjectUpdates(true);
- if(strcmp(p.getName(), "Radius") == 0) {
- double val = static_cast<const App::PropertyDistance*>(&p)->getValue();
- ui->radius->setValue(val);
- }
- else if(strcmp(p.getName(), "Center") == 0) {
- const Base::Vector3d& vec = static_cast<const App::PropertyVectorDistance*>(&p)->getValue();
- ui->centerX->setValue(vec.x);
- ui->centerY->setValue(vec.y);
- ui->centerZ->setValue(vec.z);
- }
- setBlockObjectUpdates(false);
-}
-
-void SphereWidget::centerChanged(double) {
-
- if(!blockObjectUpdates()) {
- Base::Vector3d vec(ui->centerX->value(), ui->centerY->value(), ui->centerZ->value());
- static_cast<Fem::FemPostSphereFunction*>(getObject())->Center.setValue(vec);
- }
-}
-
-void SphereWidget::radiusChanged(double) {
-
- if(!blockObjectUpdates()) {
- static_cast<Fem::FemPostSphereFunction*>(getObject())->Radius.setValue(ui->radius->value());
- }
-}
-
-#include "moc_ViewProviderFemPostFunction.cpp"
+/***************************************************************************
+ * Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.net> *
+ * *
+ * This file is part of the FreeCAD CAx development system. *
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Library General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this library; see the file COPYING.LIB. If not, *
+ * write to the Free Software Foundation, Inc., 59 Temple Place, *
+ * Suite 330, Boston, MA 02111-1307, USA *
+ * *
+ ***************************************************************************/
+
+
+#include "PreCompiled.h"
+
+#ifndef _PreComp_
+#include <Inventor/nodes/SoCoordinate3.h>
+#include <Inventor/nodes/SoMaterial.h>
+#include <Inventor/nodes/SoSurroundScale.h>
+#include <Inventor/nodes/SoLineSet.h>
+#include <Inventor/nodes/SoSeparator.h>
+#include <Inventor/nodes/SoTransform.h>
+#include <Inventor/nodes/SoMatrixTransform.h>
+#include <Inventor/nodes/SoSphere.h>
+#include <Inventor/manips/SoTransformManip.h>
+#include <Inventor/manips/SoCenterballManip.h>
+#include <Inventor/manips/SoTransformerManip.h>
+#include <Inventor/manips/SoTransformBoxManip.h>
+#include <Inventor/manips/SoHandleBoxManip.h>
+#include <Inventor/manips/SoTabBoxManip.h>
+#include <Inventor/actions/SoSearchAction.h>
+#include <Inventor/engines/SoDecomposeMatrix.h>
+#include <Inventor/draggers/SoCenterballDragger.h>
+#include <Inventor/draggers/SoTransformerDragger.h>
+#include <Inventor/draggers/SoTransformBoxDragger.h>
+#include <Inventor/draggers/SoHandleBoxDragger.h>
+#include <QMessageBox>
+#endif
+
+#include "ViewProviderFemPostFunction.h"
+#include "TaskPostBoxes.h"
+#include <Mod/Fem/App/FemPostFunction.h>
+#include <Base/Console.h>
+#include <Base/Interpreter.h>
+#include <Gui/Application.h>
+#include <Gui/Document.h>
+#include <Gui/SoNavigationDragger.h>
+#include <Gui/Macro.h>
+#include <Gui/TaskView/TaskDialog.h>
+#include <Gui/Control.h>
+#include <App/PropertyUnits.h>
+
+#include <boost/bind/bind.hpp>
+#include <math.h>
+
+#include "ui_PlaneWidget.h"
+#include "ui_SphereWidget.h"
+
+using namespace FemGui;
+
+void FunctionWidget::setViewProvider(ViewProviderFemPostFunction* view) {
+
+ m_view = view;
+ m_object = static_cast<Fem::FemPostFunction*>(view->getObject());
+ m_connection = m_object->getDocument()->signalChangedObject.connect(boost::bind(&FunctionWidget::onObjectsChanged, this, bp::_1, bp::_2));
+}
+
+void FunctionWidget::onObjectsChanged(const App::DocumentObject& obj, const App::Property& p) {
+
+ if(&obj == m_object)
+ onChange(p);
+}
+
+
+PROPERTY_SOURCE(FemGui::ViewProviderFemPostFunctionProvider, Gui::ViewProviderDocumentObject)
+
+ViewProviderFemPostFunctionProvider::ViewProviderFemPostFunctionProvider() {
+
+}
+
+ViewProviderFemPostFunctionProvider::~ViewProviderFemPostFunctionProvider() {
+
+}
+
+std::vector< App::DocumentObject* > ViewProviderFemPostFunctionProvider::claimChildren(void) const {
+
+ return static_cast<Fem::FemPostFunctionProvider*>(getObject())->Functions.getValues();
+}
+
+std::vector< App::DocumentObject* > ViewProviderFemPostFunctionProvider::claimChildren3D(void) const {
+ return claimChildren();
+}
+
+void ViewProviderFemPostFunctionProvider::onChanged(const App::Property* prop) {
+ Gui::ViewProviderDocumentObject::onChanged(prop);
+
+ updateSize();
+}
+
+void ViewProviderFemPostFunctionProvider::updateData(const App::Property* prop) {
+ Gui::ViewProviderDocumentObject::updateData(prop);
+
+ if(strcmp(prop->getName(), "Functions") == 0) {
+ updateSize();
+ }
+}
+
+void ViewProviderFemPostFunctionProvider::updateSize() {
+
+ std::vector< App::DocumentObject* > vec = claimChildren();
+ for(std::vector< App::DocumentObject* >::iterator it = vec.begin(); it != vec.end(); ++it) {
+
+ if(!(*it)->isDerivedFrom(Fem::FemPostFunction::getClassTypeId()))
+ continue;
+
+ ViewProviderFemPostFunction* vp = static_cast<FemGui::ViewProviderFemPostFunction*>(Gui::Application::Instance->getViewProvider(*it));
+ vp->AutoScaleFactorX.setValue(SizeX.getValue());
+ vp->AutoScaleFactorY.setValue(SizeY.getValue());
+ vp->AutoScaleFactorZ.setValue(SizeZ.getValue());
+ }
+}
+
+
+
+PROPERTY_SOURCE(FemGui::ViewProviderFemPostFunction, Gui::ViewProviderDocumentObject)
+
+ViewProviderFemPostFunction::ViewProviderFemPostFunction() : m_autoscale(false), m_isDragging(false)
+{
+
+ ADD_PROPERTY_TYPE(AutoScaleFactorX, (1), "AutoScale", App::Prop_Hidden, "Automatic scaling factor");
+ ADD_PROPERTY_TYPE(AutoScaleFactorY, (1), "AutoScale", App::Prop_Hidden, "Automatic scaling factor");
+ ADD_PROPERTY_TYPE(AutoScaleFactorZ, (1), "AutoScale", App::Prop_Hidden, "Automatic scaling factor");
+
+ m_geometrySeperator = new SoSeparator();
+ m_geometrySeperator->ref();
+
+ m_transform = new SoTransform();
+ m_transform->ref();
+
+ m_scale = new SoScale();
+ m_scale->ref();
+ m_scale->scaleFactor = SbVec3f(1,1,1);
+}
+
+ViewProviderFemPostFunction::~ViewProviderFemPostFunction()
+{
+ m_geometrySeperator->unref();
+ m_manip->unref();
+ m_scale->unref();
+ //transform is unref'd when it is replaced by the dragger
+}
+
+void ViewProviderFemPostFunction::attach(App::DocumentObject *pcObj)
+{
+ ViewProviderDocumentObject::attach(pcObj);
+
+ // setup the graph for editing the function unit geometry
+ SoMaterial* color = new SoMaterial();
+ color->diffuseColor.setValue(0,0,1);
+ color->transparency.setValue(0.5);
+
+ m_transform = new SoTransform;
+
+ m_manip = setupManipulator();
+ m_manip->ref();
+
+ SoSeparator* pcEditNode = new SoSeparator();
+
+ pcEditNode->addChild(color);
+ pcEditNode->addChild(m_transform);
+ pcEditNode->addChild(m_geometrySeperator);
+
+ m_geometrySeperator->insertChild(m_scale, 0);
+
+ // Now we replace the SoTransform node by a manipulator
+ // Note: Even SoCenterballManip inherits from SoTransform
+ // we cannot use it directly (in above code) because the
+ // translation and center fields are overridden.
+ SoSearchAction sa;
+ sa.setInterest(SoSearchAction::FIRST);
+ sa.setSearchingAll(FALSE);
+ sa.setNode(m_transform);
+ sa.apply(pcEditNode);
+ SoPath * path = sa.getPath();
+ if (path) {
+ m_manip->replaceNode(path);
+
+ SoDragger* dragger = m_manip->getDragger();
+ dragger->addStartCallback(dragStartCallback, this);
+ dragger->addFinishCallback(dragFinishCallback, this);
+ dragger->addMotionCallback(dragMotionCallback, this);
+ }
+
+ addDisplayMaskMode(pcEditNode, "Default");
+ setDisplayMaskMode("Default");
+}
+
+bool ViewProviderFemPostFunction::doubleClicked(void) {
+ Gui::Application::Instance->activeDocument()->setEdit(this, (int)ViewProvider::Default);
+ return true;
+}
+
+
+SoTransformManip* ViewProviderFemPostFunction::setupManipulator() {
+
+ return new SoCenterballManip;
+}
+
+
+std::vector<std::string> ViewProviderFemPostFunction::getDisplayModes(void) const
+{
+ std::vector<std::string> StrList;
+ StrList.push_back("Default");
+ return StrList;
+}
+
+void ViewProviderFemPostFunction::dragStartCallback(void *data, SoDragger *)
+{
+ // This is called when a manipulator is about to manipulating
+ Gui::Application::Instance->activeDocument()->openCommand("Edit Mirror");
+ reinterpret_cast<ViewProviderFemPostFunction*>(data)->m_isDragging = true;
+
+ ViewProviderFemPostFunction* that = reinterpret_cast<ViewProviderFemPostFunction*>(data);
+ ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Fem");
+ that->m_autoRecompute = hGrp->GetBool("PostAutoRecompute", false);
+}
+
+void ViewProviderFemPostFunction::dragFinishCallback(void *data, SoDragger *)
+{
+ // This is called when a manipulator has done manipulating
+ Gui::Application::Instance->activeDocument()->commitCommand();
+
+ ViewProviderFemPostFunction* that = reinterpret_cast<ViewProviderFemPostFunction*>(data);
+ if(that->m_autoRecompute)
+ that->getObject()->getDocument()->recompute();
+
+ reinterpret_cast<ViewProviderFemPostFunction*>(data)->m_isDragging = false;
+}
+
+void ViewProviderFemPostFunction::dragMotionCallback(void *data, SoDragger *drag)
+{
+ ViewProviderFemPostFunction* that = reinterpret_cast<ViewProviderFemPostFunction*>(data);
+ that->draggerUpdate(drag);
+
+ if(that->m_autoRecompute)
+ that->getObject()->getDocument()->recompute();
+}
+
+
+bool ViewProviderFemPostFunction::setEdit(int ModNum) {
+
+
+ if (ModNum == ViewProvider::Default || ModNum == 1 ) {
+
+ Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
+ TaskDlgPost *postDlg = qobject_cast<TaskDlgPost*>(dlg);
+ if (postDlg && postDlg->getView() != this)
+ postDlg = 0; // another pad left open its task panel
+ if (dlg && !postDlg) {
+ QMessageBox msgBox;
+ msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
+ msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
+ msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ msgBox.setDefaultButton(QMessageBox::Yes);
+ int ret = msgBox.exec();
+ if (ret == QMessageBox::Yes)
+ Gui::Control().reject();
+ else
+ return false;
+ }
+
+ // start the edit dialog
+ if (postDlg)
+ Gui::Control().showDialog(postDlg);
+ else {
+ postDlg = new TaskDlgPost(this);
+ postDlg->appendBox(new TaskPostFunction(this));
+ Gui::Control().showDialog(postDlg);
+ }
+
+ return true;
+ }
+ else {
+ return ViewProviderDocumentObject::setEdit(ModNum);
+ }
+}
+
+void ViewProviderFemPostFunction::unsetEdit(int ModNum) {
+
+ if (ModNum == ViewProvider::Default) {
+ // when pressing ESC make sure to close the dialog
+ Gui::Control().closeDialog();
+ }
+ else {
+ ViewProviderDocumentObject::unsetEdit(ModNum);
+ }
+}
+
+void ViewProviderFemPostFunction::onChanged(const App::Property* prop) {
+
+ Gui::ViewProviderDocumentObject::onChanged(prop);
+
+ if(m_autoscale)
+ m_scale->scaleFactor = SbVec3f(AutoScaleFactorX.getValue(), AutoScaleFactorY.getValue(), AutoScaleFactorZ.getValue());
+}
+
+
+
+//#################################################################################################
+
+PROPERTY_SOURCE(FemGui::ViewProviderFemPostPlaneFunction, FemGui::ViewProviderFemPostFunction)
+
+ViewProviderFemPostPlaneFunction::ViewProviderFemPostPlaneFunction() {
+
+ sPixmap = "fem-post-geo-plane";
+
+ setAutoScale(true);
+
+ //setup the visualisation geometry
+ SoCoordinate3* points = new SoCoordinate3();
+ points->point.setNum(4);
+ points->point.set1Value(0, -0.5, -0.5, 0);
+ points->point.set1Value(1, -0.5, 0.5, 0);
+ points->point.set1Value(2, 0.5, 0.5, 0);
+ points->point.set1Value(3, 0.5, -0.5, 0);
+ points->point.set1Value(4, -0.5, -0.5, 0);
+ SoLineSet* line = new SoLineSet();
+ getGeometryNode()->addChild(points);
+ getGeometryNode()->addChild(line);
+}
+
+ViewProviderFemPostPlaneFunction::~ViewProviderFemPostPlaneFunction() {
+
+}
+
+void ViewProviderFemPostPlaneFunction::draggerUpdate(SoDragger* m) {
+
+ Fem::FemPostPlaneFunction* func = static_cast<Fem::FemPostPlaneFunction*>(getObject());
+ SoCenterballDragger* dragger = static_cast<SoCenterballDragger*>(m);
+
+ // the new axis of the plane
+ SbRotation rot, scaleDir;
+ const SbVec3f& center = dragger->center.getValue();
+
+ SbVec3f norm(0,0,1);
+ dragger->rotation.getValue().multVec(norm,norm);
+ func->Origin.setValue(center[0], center[1], center[2]);
+ func->Normal.setValue(norm[0],norm[1],norm[2]);
+
+ SbVec3f t = static_cast<SoCenterballManip*>(getManipulator())->translation.getValue();
+ SbVec3f rt, irt;
+ dragger->rotation.getValue().multVec(t,rt);
+ dragger->rotation.getValue().inverse().multVec(t,irt);
+}
+
+void ViewProviderFemPostPlaneFunction::updateData(const App::Property* p) {
+
+ Fem::FemPostPlaneFunction* func = static_cast<Fem::FemPostPlaneFunction*>(getObject());
+
+ if(!isDragging() && (p == &func->Origin || p == &func->Normal)) {
+
+ Base::Vector3d trans = func->Origin.getValue();
+ Base::Vector3d norm = func->Normal.getValue();
+
+ norm = norm / norm.Length();
+ SbRotation rot(SbVec3f(0.,0.,1.), SbVec3f(norm.x, norm.y, norm.z));
+
+ SbMatrix t, translate;
+ t.setRotate(rot);
+ translate.setTranslate(SbVec3f(trans.x, trans.y, trans.z));
+ t.multRight(translate);
+ getManipulator()->setMatrix(t);
+ }
+ Gui::ViewProviderDocumentObject::updateData(p);
+}
+
+
+FunctionWidget* ViewProviderFemPostPlaneFunction::createControlWidget() {
+ return new PlaneWidget();
+}
+
+
+PlaneWidget::PlaneWidget() {
+
+ ui = new Ui_PlaneWidget();
+ ui->setupUi(this);
+
+ connect(ui->originX, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double)));
+ connect(ui->originY, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double)));
+ connect(ui->originZ, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double)));
+ connect(ui->normalX, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double)));
+ connect(ui->normalY, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double)));
+ connect(ui->normalZ, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double)));
+
+}
+
+PlaneWidget::~PlaneWidget() {
+
+}
+
+void PlaneWidget::applyPythonCode() {
+
+}
+
+void PlaneWidget::setViewProvider(ViewProviderFemPostFunction* view) {
+
+ FemGui::FunctionWidget::setViewProvider(view);
+ onChange(static_cast<Fem::FemPostPlaneFunction*>(getObject())->Normal);
+ onChange(static_cast<Fem::FemPostPlaneFunction*>(getObject())->Origin);
+}
+
+void PlaneWidget::onChange(const App::Property& p) {
+
+ setBlockObjectUpdates(true);
+ if(strcmp(p.getName(), "Normal") == 0) {
+ const Base::Vector3d& vec = static_cast<const App::PropertyVector*>(&p)->getValue();
+ ui->normalX->setValue(vec.x);
+ ui->normalY->setValue(vec.y);
+ ui->normalZ->setValue(vec.z);
+ }
+ else if(strcmp(p.getName(), "Origin") == 0) {
+ const Base::Vector3d& vec = static_cast<const App::PropertyVectorDistance*>(&p)->getValue();
+ ui->originX->setValue(vec.x);
+ ui->originY->setValue(vec.y);
+ ui->originZ->setValue(vec.z);
+ }
+ setBlockObjectUpdates(false);
+}
+
+void PlaneWidget::normalChanged(double) {
+
+ if(!blockObjectUpdates()) {
+ Base::Vector3d vec(ui->normalX->value(), ui->normalY->value(), ui->normalZ->value());
+ static_cast<Fem::FemPostPlaneFunction*>(getObject())->Normal.setValue(vec);
+ }
+}
+
+void PlaneWidget::originChanged(double) {
+
+ if(!blockObjectUpdates()) {
+ Base::Vector3d vec(ui->originX->value(), ui->originY->value(), ui->originZ->value());
+ static_cast<Fem::FemPostPlaneFunction*>(getObject())->Origin.setValue(vec);
+ }
+}
+
+
+
+//#################################################################################################
+
+PROPERTY_SOURCE(FemGui::ViewProviderFemPostSphereFunction, FemGui::ViewProviderFemPostFunction)
+
+ViewProviderFemPostSphereFunction::ViewProviderFemPostSphereFunction() {
+
+ sPixmap = "fem-post-geo-sphere";
+
+ setAutoScale(false);
+
+ //setup the visualisation geometry
+ SoCoordinate3* points = new SoCoordinate3();
+ points->point.setNum(2*84);
+ int idx = 0;
+ for(int i=0; i<4; i++) {
+ for(int j=0; j<21; j++) {
+ points->point.set1Value(idx, SbVec3f(std::sin(2*M_PI/20*j) * std::cos(M_PI/4*i),
+ std::sin(2*M_PI/20*j) * std::sin(M_PI/4*i),
+ std::cos(2*M_PI/20*j) ));
+ ++idx;
+ }
+ }
+ for(int i=0; i<4; i++) {
+ for(int j=0; j<21; j++) {
+ points->point.set1Value(idx, SbVec3f(std::sin(M_PI/4*i) * std::cos(2*M_PI/20*j),
+ std::sin(M_PI/4*i) * std::sin(2*M_PI/20*j),
+ std::cos(M_PI/4*i) ));
+ ++idx;
+ }
+ }
+
+ SoLineSet* line = new SoLineSet();
+ getGeometryNode()->addChild(points);
+ getGeometryNode()->addChild(line);
+}
+
+ViewProviderFemPostSphereFunction::~ViewProviderFemPostSphereFunction() {
+}
+
+SoTransformManip* ViewProviderFemPostSphereFunction::setupManipulator() {
+ SoHandleBoxManip* manip = new SoHandleBoxManip();
+ manip->getDragger()->setPart("extruder1", new SoSeparator);
+ manip->getDragger()->setPart("extruder2", new SoSeparator);
+ manip->getDragger()->setPart("extruder3", new SoSeparator);
+ manip->getDragger()->setPart("extruder4", new SoSeparator);
+ manip->getDragger()->setPart("extruder5", new SoSeparator);
+ manip->getDragger()->setPart("extruder6", new SoSeparator);
+ manip->getDragger()->setPart("extruder1Active", new SoSeparator);
+ manip->getDragger()->setPart("extruder2Active", new SoSeparator);
+ manip->getDragger()->setPart("extruder3Active", new SoSeparator);
+ manip->getDragger()->setPart("extruder4Active", new SoSeparator);
+ manip->getDragger()->setPart("extruder5Active", new SoSeparator);
+ manip->getDragger()->setPart("extruder6Active", new SoSeparator);
+
+ return manip;
+}
+
+
+void ViewProviderFemPostSphereFunction::draggerUpdate(SoDragger* m) {
+
+ Fem::FemPostSphereFunction* func = static_cast<Fem::FemPostSphereFunction*>(getObject());
+ SoHandleBoxDragger* dragger = static_cast<SoHandleBoxDragger*>(m);
+
+ // the new axis of the plane
+ SbRotation rot, scaleDir;
+ const SbVec3f& center = dragger->translation.getValue();
+
+ SbVec3f norm(0,0,1);
+ func->Center.setValue(center[0], center[1], center[2]);
+ func->Radius.setValue(dragger->scaleFactor.getValue()[0]);
+}
+
+void ViewProviderFemPostSphereFunction::updateData(const App::Property* p) {
+
+ Fem::FemPostSphereFunction* func = static_cast<Fem::FemPostSphereFunction*>(getObject());
+
+ if(!isDragging() && (p == &func->Center || p == &func->Radius)) {
+
+ Base::Vector3d trans = func->Center.getValue();
+ double radius = func->Radius.getValue();
+
+ SbMatrix t, translate;
+ t.setScale(radius);
+ translate.setTranslate(SbVec3f(trans.x, trans.y, trans.z));
+ t.multRight(translate);
+ getManipulator()->setMatrix(t);
+
+ }
+ Gui::ViewProviderDocumentObject::updateData(p);
+}
+
+
+FunctionWidget* ViewProviderFemPostSphereFunction::createControlWidget() {
+ return new SphereWidget();
+}
+
+
+SphereWidget::SphereWidget() {
+
+ ui = new Ui_SphereWidget();
+ ui->setupUi(this);
+
+ connect(ui->centerX, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
+ connect(ui->centerY, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
+ connect(ui->centerZ, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
+ connect(ui->radius, SIGNAL(valueChanged(double)), this, SLOT(radiusChanged(double)));
+}
+
+SphereWidget::~SphereWidget() {
+
+}
+
+void SphereWidget::applyPythonCode() {
+
+}
+
+void SphereWidget::setViewProvider(ViewProviderFemPostFunction* view) {
+
+ FemGui::FunctionWidget::setViewProvider(view);
+ onChange(static_cast<Fem::FemPostSphereFunction*>(getObject())->Center);
+ onChange(static_cast<Fem::FemPostSphereFunction*>(getObject())->Radius);
+}
+
+void SphereWidget::onChange(const App::Property& p) {
+
+ setBlockObjectUpdates(true);
+ if(strcmp(p.getName(), "Radius") == 0) {
+ double val = static_cast<const App::PropertyDistance*>(&p)->getValue();
+ ui->radius->setValue(val);
+ }
+ else if(strcmp(p.getName(), "Center") == 0) {
+ const Base::Vector3d& vec = static_cast<const App::PropertyVectorDistance*>(&p)->getValue();
+ ui->centerX->setValue(vec.x);
+ ui->centerY->setValue(vec.y);
+ ui->centerZ->setValue(vec.z);
+ }
+ setBlockObjectUpdates(false);
+}
+
+void SphereWidget::centerChanged(double) {
+
+ if(!blockObjectUpdates()) {
+ Base::Vector3d vec(ui->centerX->value(), ui->centerY->value(), ui->centerZ->value());
+ static_cast<Fem::FemPostSphereFunction*>(getObject())->Center.setValue(vec);
+ }
+}
+
+void SphereWidget::radiusChanged(double) {
+
+ if(!blockObjectUpdates()) {
+ static_cast<Fem::FemPostSphereFunction*>(getObject())->Radius.setValue(ui->radius->value());
+ }
+}
+
+#include "moc_ViewProviderFemPostFunction.cpp"
diff --git a/src/Mod/Inspection/App/InspectionFeature.cpp b/src/Mod/Inspection/App/InspectionFeature.cpp
index aac0006ba..0bcf55ae0 100644
--- a/src/Mod/Inspection/App/InspectionFeature.cpp
+++ b/src/Mod/Inspection/App/InspectionFeature.cpp
@@ -35,7 +35,7 @@
#include <QFutureWatcher>
#include <QtConcurrentMap>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <Base/Console.h>
#include <Base/Exception.h>
@@ -58,6 +58,7 @@
using namespace Inspection;
+namespace bp = boost::placeholders;
InspectActualMesh::InspectActualMesh(const Mesh::MeshObject& rMesh) : _iter(rMesh.getKernel())
{
@@ -750,7 +751,7 @@ App::DocumentObjectExecReturn* Feature::execute(void)
std::generate(index.begin(), index.end(), Base::iotaGen<unsigned long>(0));
DistanceInspection check(this->SearchRadius.getValue(), actual, inspectNominal);
QFuture<float> future = QtConcurrent::mapped
- (index, boost::bind(&DistanceInspection::mapped, &check, _1));
+ (index, boost::bind(&DistanceInspection::mapped, &check, bp::_1));
//future.waitForFinished(); // blocks the GUI
Base::FutureWatcherProgress progress("Inspecting...", actual->countPoints());
QFutureWatcher<float> watcher;
diff --git a/src/Mod/Mesh/App/Core/Curvature.cpp b/src/Mod/Mesh/App/Core/Curvature.cpp
index a517bd5ed..20d374a86 100644
--- a/src/Mod/Mesh/App/Core/Curvature.cpp
+++ b/src/Mod/Mesh/App/Core/Curvature.cpp
@@ -28,7 +28,7 @@
#include <QFuture>
#include <QFutureWatcher>
#include <QtConcurrentMap>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
//#define OPTIMIZE_CURVATURE
#ifdef OPTIMIZE_CURVATURE
@@ -48,6 +48,7 @@
#include <Base/Tools.h>
using namespace MeshCore;
+namespace bp = boost::placeholders;
MeshCurvature::MeshCurvature(const MeshKernel& kernel)
: myKernel(kernel), myMinPoints(20), myRadius(0.5f)
@@ -79,7 +80,7 @@ void MeshCurvature::ComputePerFace(bool parallel)
}
else {
QFuture<CurvatureInfo> future = QtConcurrent::mapped
- (mySegment, boost::bind(&FacetCurvature::Compute, &face, _1));
+ (mySegment, boost::bind(&FacetCurvature::Compute, &face, bp::_1));
QFutureWatcher<CurvatureInfo> watcher;
watcher.setFuture(future);
watcher.waitForFinished();
diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp
index 79a6e0204..1d1e984d1 100644
--- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp
+++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp
@@ -31,8 +31,6 @@
#include "ui_DlgEvaluateMesh.h"
#include "DlgEvaluateSettings.h"
-#include <boost/bind.hpp>
-
#include <Base/Interpreter.h>
#include <Base/Sequencer.h>
#include <Gui/Application.h>
diff --git a/src/Mod/Mesh/Gui/MeshEditor.cpp b/src/Mod/Mesh/Gui/MeshEditor.cpp
index 35efd14ed..efe66a503 100644
--- a/src/Mod/Mesh/Gui/MeshEditor.cpp
+++ b/src/Mod/Mesh/Gui/MeshEditor.cpp
@@ -45,7 +45,7 @@
# include <Inventor/nodes/SoPickStyle.h>
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/nodes/SoShapeHints.h>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "MeshEditor.h"
@@ -61,6 +61,7 @@
#include <Gui/View3DInventorViewer.h>
using namespace MeshGui;
+namespace bp = boost::placeholders;
PROPERTY_SOURCE(MeshGui::ViewProviderFace, Gui::ViewProviderDocumentObject)
@@ -458,7 +459,7 @@ void MeshFillHole::startEditing(MeshGui::ViewProviderMesh* vp)
viewer->addEventCallback(SoEvent::getClassTypeId(),
MeshFillHole::fileHoleCallback, this);
myConnection = App::GetApplication().signalChangedObject.connect(
- boost::bind(&MeshFillHole::slotChangedObject, this, _1, _2));
+ boost::bind(&MeshFillHole::slotChangedObject, this, bp::_1, bp::_2));
myBoundariesRoot->removeAllChildren();
myBoundariesRoot->addChild(viewer->getHeadlight());
diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp
index d425f1017..ed4fea19d 100644
--- a/src/Mod/Mesh/Gui/ViewProvider.cpp
+++ b/src/Mod/Mesh/Gui/ViewProvider.cpp
@@ -95,7 +95,7 @@
#include <Mod/Mesh/App/MeshFeature.h>
#include <Mod/Mesh/Gui/ViewProviderMeshPy.h>
#include <zipios++/gzipoutputstream.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "ViewProvider.h"
#include "SoFCIndexedFaceSet.h"
@@ -103,6 +103,7 @@
using namespace MeshGui;
+namespace bp = boost::placeholders;
using Mesh::Feature;
using MeshCore::MeshKernel;
@@ -708,7 +709,7 @@ void ViewProviderMesh::setupContextMenu(QMenu* menu, QObject* receiver, const ch
QAction* act = menu->addAction(QObject::tr("Display components"));
act->setCheckable(true);
act->setChecked(pcMatBinding->value.getValue() == SoMaterialBinding::PER_FACE);
- func->toggle(act, boost::bind(&ViewProviderMesh::setHighlightedComponents, this, _1));
+ func->toggle(act, boost::bind(&ViewProviderMesh::setHighlightedComponents, this, bp::_1));
}
bool ViewProviderMesh::setEdit(int ModNum)
diff --git a/src/Mod/Part/App/PreCompiled.h b/src/Mod/Part/App/PreCompiled.h
index 9d21862fa..b0d06f58a 100644
--- a/src/Mod/Part/App/PreCompiled.h
+++ b/src/Mod/Part/App/PreCompiled.h
@@ -64,7 +64,7 @@
// Boost
#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/utility.hpp>
diff --git a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp
index b28d86995..b4fff085f 100644
--- a/src/Mod/Part/Gui/CrossSections.cpp
+++ b/src/Mod/Part/Gui/CrossSections.cpp
@@ -36,7 +36,7 @@
# include <QFutureWatcher>
# include <QKeyEvent>
# include <QtConcurrentMap>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <Python.h>
# include <Inventor/nodes/SoBaseColor.h>
# include <Inventor/nodes/SoCoordinate3.h>
@@ -61,6 +61,7 @@
#include <Base/UnitsApi.h>
using namespace PartGui;
+namespace bp = boost::placeholders;
#undef CS_FUTURE // multi-threading causes some problems
namespace PartGui {
@@ -218,7 +219,7 @@ void CrossSections::apply()
for (std::vector<App::DocumentObject*>::iterator it = obj.begin(); it != obj.end(); ++it) {
Part::CrossSection cs(a,b,c,static_cast<Part::Feature*>(*it)->Shape.getValue());
QFuture< std::list<TopoDS_Wire> > future = QtConcurrent::mapped
- (d, boost::bind(&Part::CrossSection::section, &cs, _1));
+ (d, boost::bind(&Part::CrossSection::section, &cs, bp::_1));
future.waitForFinished();
QFuture< std::list<TopoDS_Wire> >::const_iterator ft;
TopoDS_Compound comp;
diff --git a/src/Mod/Part/Gui/DlgBooleanOperation.cpp b/src/Mod/Part/Gui/DlgBooleanOperation.cpp
index 9df2d3899..edd3cd06b 100644
--- a/src/Mod/Part/Gui/DlgBooleanOperation.cpp
+++ b/src/Mod/Part/Gui/DlgBooleanOperation.cpp
@@ -27,7 +27,7 @@
# include <QTreeWidget>
# include <TopoDS_Shape.hxx>
# include <TopExp_Explorer.hxx>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "DlgBooleanOperation.h"
@@ -47,6 +47,7 @@
#include <Gui/WaitCursor.h>
using namespace PartGui;
+namespace bp = boost::placeholders;
namespace PartGui {
class BooleanOperationItem : public QTreeWidgetItem
@@ -89,9 +90,9 @@ DlgBooleanOperation::DlgBooleanOperation(QWidget* parent)
connect(ui->secondShape, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
this, SLOT(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
this->connectNewObject = App::GetApplication().signalNewObject.connect(boost::bind
- (&DlgBooleanOperation::slotCreatedObject, this, _1));
+ (&DlgBooleanOperation::slotCreatedObject, this, bp::_1));
this->connectModObject = App::GetApplication().signalChangedObject.connect(boost::bind
- (&DlgBooleanOperation::slotChangedObject, this, _1, _2));
+ (&DlgBooleanOperation::slotChangedObject, this, bp::_1, bp::_2));
findShapes();
}
diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp
index 138ccd386..5085446d0 100644
--- a/src/Mod/Part/Gui/DlgFilletEdges.cpp
+++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp
@@ -43,7 +43,7 @@
# include <QItemSelection>
# include <QItemSelectionModel>
# include <QTimer>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <Python.h>
# include <Inventor/actions/SoSearchAction.h>
# include <Inventor/details/SoLineDetail.h>
@@ -75,6 +75,7 @@
#include <Gui/Window.h>
using namespace PartGui;
+namespace bp = boost::placeholders;
FilletRadiusDelegate::FilletRadiusDelegate(QObject *parent) : QItemDelegate(parent)
{
@@ -245,9 +246,9 @@ DlgFilletEdges::DlgFilletEdges(FilletType type, Part::FilletBase* fillet, QWidge
d->fillet = fillet;
d->connectApplicationDeletedObject = App::GetApplication().signalDeletedObject
- .connect(boost::bind(&DlgFilletEdges::onDeleteObject, this, _1));
+ .connect(boost::bind(&DlgFilletEdges::onDeleteObject, this, bp::_1));
d->connectApplicationDeletedDocument = App::GetApplication().signalDeleteDocument
- .connect(boost::bind(&DlgFilletEdges::onDeleteDocument, this, _1));
+ .connect(boost::bind(&DlgFilletEdges::onDeleteDocument, this, bp::_1));
// set tree view with three columns
QStandardItemModel* model = new FilletRadiusModel(this);
connect(model, SIGNAL(toggleCheckState(const QModelIndex&)),
diff --git a/src/Mod/Part/Gui/Mirroring.cpp b/src/Mod/Part/Gui/Mirroring.cpp
index 535507cbf..94beb847b 100644
--- a/src/Mod/Part/Gui/Mirroring.cpp
+++ b/src/Mod/Part/Gui/Mirroring.cpp
@@ -28,7 +28,6 @@
# include <QTreeWidget>
# include <TopoDS_Shape.hxx>
# include <TopExp_Explorer.hxx>
-# include <boost/bind.hpp>
# include <cfloat>
# include <Python.h>
# include <Inventor/system/inttypes.h>
diff --git a/src/Mod/Part/Gui/TaskAttacher.cpp b/src/Mod/Part/Gui/TaskAttacher.cpp
index e2bfe4415..c1a1799c4 100644
--- a/src/Mod/Part/Gui/TaskAttacher.cpp
+++ b/src/Mod/Part/Gui/TaskAttacher.cpp
@@ -30,7 +30,7 @@
# include <QMessageBox>
# include <Precision.hxx>
# include <Standard_Failure.hxx>
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include <Base/Console.h>
@@ -61,6 +61,7 @@
using namespace PartGui;
using namespace Gui;
using namespace Attacher;
+namespace bp = boost::placeholders;
/* TRANSLATOR PartDesignGui::TaskAttacher */
@@ -208,8 +209,8 @@ TaskAttacher::TaskAttacher(Gui::ViewProviderDocumentObject *ViewProvider,QWidget
updatePreview();
// connect object deletion with slot
- auto bnd1 = boost::bind(&TaskAttacher::objectDeleted, this, _1);
- auto bnd2 = boost::bind(&TaskAttacher::documentDeleted, this, _1);
+ auto bnd1 = boost::bind(&TaskAttacher::objectDeleted, this, bp::_1);
+ auto bnd2 = boost::bind(&TaskAttacher::documentDeleted, this, bp::_1);
Gui::Document* document = Gui::Application::Instance->getDocument(ViewProvider->getObject()->getDocument());
connectDelObject = document->signalDeletedObject.connect(bnd1);
connectDelDocument = document->signalDeleteDocument.connect(bnd2);
diff --git a/src/Mod/Part/Gui/TaskFaceColors.cpp b/src/Mod/Part/Gui/TaskFaceColors.cpp
index 23f5e162b..677c66807 100644
--- a/src/Mod/Part/Gui/TaskFaceColors.cpp
+++ b/src/Mod/Part/Gui/TaskFaceColors.cpp
@@ -43,11 +43,10 @@
# include <Inventor/events/SoMouseButtonEvent.h>
# include <Inventor/nodes/SoCamera.h>
# include <Inventor/nodes/SoSeparator.h>
+# include <boost/signals2.hpp>
+# include <boost/bind/bind.hpp>
#endif
-#include <boost/signals2.hpp>
-#include <boost/bind.hpp>
-
#include "ui_TaskFaceColors.h"
#include "TaskFaceColors.h"
#include "ViewProviderExt.h"
@@ -69,6 +68,7 @@
using namespace PartGui;
+namespace bp = boost::placeholders;
namespace PartGui {
class FaceSelection : public Gui::SelectionFilterGate
@@ -274,9 +274,9 @@ FaceColors::FaceColors(ViewProviderPartExt* vp, QWidget* parent)
Gui::Selection().addSelectionGate(gate);
d->connectDelDoc = Gui::Application::Instance->signalDeleteDocument.connect(boost::bind
- (&FaceColors::slotDeleteDocument, this, _1));
+ (&FaceColors::slotDeleteDocument, this, bp::_1));
d->connectDelObj = Gui::Application::Instance->signalDeletedObject.connect(boost::bind
- (&FaceColors::slotDeleteObject, this, _1));
+ (&FaceColors::slotDeleteObject, this, bp::_1));
}
FaceColors::~FaceColors()
diff --git a/src/Mod/Part/Gui/ViewProviderSpline.cpp b/src/Mod/Part/Gui/ViewProviderSpline.cpp
index b83aaf8b8..c0fcd09d8 100644
--- a/src/Mod/Part/Gui/ViewProviderSpline.cpp
+++ b/src/Mod/Part/Gui/ViewProviderSpline.cpp
@@ -45,10 +45,9 @@
# include <Inventor/nodes/SoSwitch.h>
# include <QAction>
# include <QMenu>
+# include <boost/bind/bind.hpp>
#endif
-#include <boost/bind.hpp>
-
#include <App/PropertyStandard.h>
#include <Mod/Part/App/PartFeature.h>
@@ -58,6 +57,7 @@
using namespace PartGui;
+namespace bp = boost::placeholders;
PROPERTY_SOURCE(PartGui::ViewProviderSpline, PartGui::ViewProviderPartExt)
@@ -81,7 +81,7 @@ void ViewProviderSpline::setupContextMenu(QMenu* menu, QObject* receiver, const
QAction* act = menu->addAction(QObject::tr("Show control points"));
act->setCheckable(true);
act->setChecked(ControlPoints.getValue());
- func->toggle(act, boost::bind(&ViewProviderSpline::toggleControlPoints, this, _1));
+ func->toggle(act, boost::bind(&ViewProviderSpline::toggleControlPoints, this, bp::_1));
}
void ViewProviderSpline::toggleControlPoints(bool on)
diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp
index 849ccd381..d5f021acd 100644
--- a/src/Mod/PartDesign/App/Body.cpp
+++ b/src/Mod/PartDesign/App/Body.cpp
@@ -24,7 +24,6 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-#include <boost/bind.hpp>
#endif
#include <Base/Console.h>
diff --git a/src/Mod/PartDesign/App/ShapeBinder.cpp b/src/Mod/PartDesign/App/ShapeBinder.cpp
index a5fb4482f..ac1bf017c 100644
--- a/src/Mod/PartDesign/App/ShapeBinder.cpp
+++ b/src/Mod/PartDesign/App/ShapeBinder.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cfloat>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#endif
@@ -39,6 +39,7 @@
#endif
using namespace PartDesign;
+namespace bp = boost::placeholders;
// ============================================================================
@@ -183,7 +184,7 @@ void ShapeBinder::onSettingDocument()
App::Document* document = getDocument();
if (document) {
this->connectDocumentChangedObject = document->signalChangedObject.connect(boost::bind
- (&ShapeBinder::slotChangedObject, this, _1, _2));
+ (&ShapeBinder::slotChangedObject, this, bp::_1, bp::_2));
}
}
diff --git a/src/Mod/PartDesign/Gui/PreCompiled.h b/src/Mod/PartDesign/Gui/PreCompiled.h
index 4fd34892a..ebc357bc7 100644
--- a/src/Mod/PartDesign/Gui/PreCompiled.h
+++ b/src/Mod/PartDesign/Gui/PreCompiled.h
@@ -1,91 +1,91 @@
-/***************************************************************************
- * Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) *
- * *
- * This file is part of the FreeCAD CAx development system. *
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
- * *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
- * *
- ***************************************************************************/
-
-
-#ifndef __PRECOMPILED_GUI__
-#define __PRECOMPILED_GUI__
-
-#include <FCConfig.h>
-
-// Importing of App classes
-#ifdef FC_OS_WIN32
-# define PartDesignExport __declspec(dllimport)
-# define PartDesignGuiExport __declspec(dllexport)
-# define PartExport __declspec(dllimport)
-# define PartGuiExport __declspec(dllimport)
-# define SketcherExport __declspec(dllimport)
-# define SketcherGuiExport __declspec(dllimport)
-#else // for Linux
-# define PartDesignExport
-# define PartDesignGuiExport
-# define PartExport
-# define PartGuiExport
-# define SketcherExport
-# define SketcherGuiExport
-#endif
-
-
-#ifdef _MSC_VER
-# pragma warning(disable : 4005)
-#endif
-
-#ifdef _PreComp_
+/***************************************************************************
+ * Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) *
+ * *
+ * This file is part of the FreeCAD CAx development system. *
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Library General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this library; see the file COPYING.LIB. If not, *
+ * write to the Free Software Foundation, Inc., 59 Temple Place, *
+ * Suite 330, Boston, MA 02111-1307, USA *
+ * *
+ ***************************************************************************/
+
+
+#ifndef __PRECOMPILED_GUI__
+#define __PRECOMPILED_GUI__
+
+#include <FCConfig.h>
+
+// Importing of App classes
+#ifdef FC_OS_WIN32
+# define PartDesignExport __declspec(dllimport)
+# define PartDesignGuiExport __declspec(dllexport)
+# define PartExport __declspec(dllimport)
+# define PartGuiExport __declspec(dllimport)
+# define SketcherExport __declspec(dllimport)
+# define SketcherGuiExport __declspec(dllimport)
+#else // for Linux
+# define PartDesignExport
+# define PartDesignGuiExport
+# define PartExport
+# define PartGuiExport
+# define SketcherExport
+# define SketcherGuiExport
+#endif
+
+
+#ifdef _MSC_VER
+# pragma warning(disable : 4005)
+#endif
+
+#ifdef _PreComp_
// Python
-#include <Python.h>
-
-// standard
-#include <iostream>
-#include <assert.h>
-#include <cmath>
-
-// OCC
-#include <Standard_math.hxx>
-
-// STL
-#include <vector>
-#include <map>
-#include <string>
-#include <list>
-#include <set>
-#include <algorithm>
-#include <stack>
-#include <queue>
-#include <bitset>
-
-#ifdef FC_OS_WIN32
-# include <windows.h>
-#endif
-
-
-// Qt Toolkit
-#ifndef __Qt4All__
-# include <Gui/Qt4All.h>
-#endif
-
-// Inventor
-#ifndef __InventorAll__
-# include <Gui/InventorAll.h>
-#endif
-
-#endif // _PreComp_
-#endif // __PRECOMPILED_GUI__
+#include <Python.h>
+
+// standard
+#include <iostream>
+#include <assert.h>
+#include <cmath>
+
+// OCC
+#include <Standard_math.hxx>
+
+// STL
+#include <vector>
+#include <map>
+#include <string>
+#include <list>
+#include <set>
+#include <algorithm>
+#include <stack>
+#include <queue>
+#include <bitset>
+
+#ifdef FC_OS_WIN32
+# include <windows.h>
+#endif
+
+
+// Qt Toolkit
+#ifndef __Qt4All__
+# include <Gui/Qt4All.h>
+#endif
+
+// Inventor
+#ifndef __InventorAll__
+# include <Gui/InventorAll.h>
+#endif
+
+#endif // _PreComp_
+#endif // __PRECOMPILED_GUI__
diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp
index 7d7d5e46d..bd41f8f93 100644
--- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp
+++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp
@@ -30,7 +30,6 @@
# include <QMessageBox>
# include <Precision.hxx>
# include <Standard_Failure.hxx>
-# include <boost/bind.hpp>
#endif
#include <Base/Console.h>
diff --git a/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp b/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp
index 61b67f6b7..87069dd0b 100644
--- a/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp
+++ b/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp
@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
+# include <boost/bind/bind.hpp>
#endif
#include "ui_TaskHoleParameters.h"
@@ -41,6 +42,7 @@
using namespace PartDesignGui;
using namespace Gui;
+namespace bp = boost::placeholders;
/* TRANSLATOR PartDesignGui::TaskHoleParameters */
@@ -115,7 +117,7 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole *HoleView, QWidget *pare
ui->DrillPointAngle->bind(pcHole->DrillPointAngle);
ui->TaperedAngle->bind(pcHole->TaperedAngle);
- connectPropChanged = App::GetApplication().signalChangePropertyEditor.connect(boost::bind(&TaskHoleParameters::changedObject, this, _1));
+ connectPropChanged = App::GetApplication().signalChangePropertyEditor.connect(boost::bind(&TaskHoleParameters::changedObject, this, bp::_1));
this->groupLayout()->addWidget(proxy);
}
diff --git a/src/Mod/PartDesign/Gui/TaskHoleParameters.h b/src/Mod/PartDesign/Gui/TaskHoleParameters.h
index 7a00c9fd6..d3d2e166a 100644
--- a/src/Mod/PartDesign/Gui/TaskHoleParameters.h
+++ b/src/Mod/PartDesign/Gui/TaskHoleParameters.h
@@ -28,7 +28,7 @@
#include <Gui/Selection.h>
#include <Gui/TaskView/TaskDialog.h>
#include <App/DocumentObserver.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "TaskSketchBasedParameters.h"
#include "ViewProviderHole.h"
diff --git a/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp b/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp
index 083c910b5..c482636b0 100644
--- a/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp
+++ b/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp
@@ -47,7 +47,6 @@
#include <Base/Console.h>
#include <Base/UnitsApi.h>
#include <App/Origin.h>
-#include <boost/bind.hpp>
using namespace PartDesignGui;
diff --git a/src/Mod/PartDesign/Gui/TaskTransformedMessages.cpp b/src/Mod/PartDesign/Gui/TaskTransformedMessages.cpp
index 91b84e538..836dd5ca5 100644
--- a/src/Mod/PartDesign/Gui/TaskTransformedMessages.cpp
+++ b/src/Mod/PartDesign/Gui/TaskTransformedMessages.cpp
@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
+# include <boost/bind/bind.hpp>
#endif
#include "ui_TaskTransformedMessages.h"
@@ -32,12 +33,11 @@
#include <Gui/Document.h>
#include <Gui/BitmapFactory.h>
-#include <boost/bind.hpp>
-
#include "ViewProviderTransformed.h"
using namespace PartDesignGui;
using namespace Gui::TaskView;
+namespace bp = boost::placeholders;
TaskTransformedMessages::TaskTransformedMessages(ViewProviderTransformed *transformedView_)
: TaskBox(Gui::BitmapFactory().pixmap("document-new"),tr("Transformed feature messages"),true, 0),
@@ -54,7 +54,7 @@ TaskTransformedMessages::TaskTransformedMessages(ViewProviderTransformed *transf
this->groupLayout()->addWidget(proxy);
- connectionDiagnosis = transformedView->signalDiagnosis.connect(boost::bind(&PartDesignGui::TaskTransformedMessages::slotDiagnosis, this,_1));
+ connectionDiagnosis = transformedView->signalDiagnosis.connect(boost::bind(&PartDesignGui::TaskTransformedMessages::slotDiagnosis, this, bp::_1));
}
TaskTransformedMessages::~TaskTransformedMessages()
diff --git a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp
index 54923f62d..841ee7639 100644
--- a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp
+++ b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/actions/SoGetBoundingBoxAction.h>
# include <Precision.hxx>
@@ -60,6 +60,7 @@
#include <Gui/MDIView.h>
using namespace PartDesignGui;
+namespace bp = boost::placeholders;
const char* PartDesignGui::ViewProviderBody::BodyModeEnum[] = {"Through","Tip",NULL};
@@ -96,10 +97,10 @@ void ViewProviderBody::attach(App::DocumentObject *pcFeat)
assert ( gdoc );
connectChangedObjectApp = adoc->signalChangedObject.connect (
- boost::bind ( &ViewProviderBody::slotChangedObjectApp, this, _1, _2) );
+ boost::bind ( &ViewProviderBody::slotChangedObjectApp, this, bp::_1, bp::_2) );
connectChangedObjectGui = gdoc->signalChangedObject.connect (
- boost::bind ( &ViewProviderBody::slotChangedObjectGui, this, _1, _2) );
+ boost::bind ( &ViewProviderBody::slotChangedObjectGui, this, bp::_1, bp::_2) );
}
// TODO on activating the body switch to the "Through" mode (2015-09-05, Fat-Zer)
diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp
index 1d606ebc5..472f8141c 100644
--- a/src/Mod/PartDesign/Gui/Workbench.cpp
+++ b/src/Mod/PartDesign/Gui/Workbench.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <QMessageBox>
#endif
@@ -46,6 +46,7 @@
#include "WorkflowManager.h"
using namespace PartDesignGui;
+namespace bp = boost::placeholders;
#if 0 // needed for Qt's lupdate utility
qApp->translate("Workbench", "Part Design");
@@ -427,22 +428,22 @@ void Workbench::activated()
Gui::Control().showTaskView();
// Let us be notified when a document is activated, so that we can update the ActivePartObject
- Gui::Application::Instance->signalActiveDocument.connect(boost::bind(&Workbench::slotActiveDocument, this, _1));
- App::GetApplication().signalNewDocument.connect(boost::bind(&Workbench::slotNewDocument, this, _1));
- App::GetApplication().signalFinishRestoreDocument.connect(boost::bind(&Workbench::slotFinishRestoreDocument, this, _1));
- App::GetApplication().signalDeleteDocument.connect(boost::bind(&Workbench::slotDeleteDocument, this, _1));
+ Gui::Application::Instance->signalActiveDocument.connect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
+ App::GetApplication().signalNewDocument.connect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
+ App::GetApplication().signalFinishRestoreDocument.connect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
+ App::GetApplication().signalDeleteDocument.connect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
// Watch out for objects being added to the active document, so that we can add them to the body
- //App::GetApplication().signalNewObject.connect(boost::bind(&Workbench::slotNewObject, this, _1));
+ //App::GetApplication().signalNewObject.connect(boost::bind(&Workbench::slotNewObject, this, bp::_1));
}
void Workbench::deactivated()
{
// Let us be notified when a document is activated, so that we can update the ActivePartObject
- Gui::Application::Instance->signalActiveDocument.disconnect(boost::bind(&Workbench::slotActiveDocument, this, _1));
- App::GetApplication().signalNewDocument.disconnect(boost::bind(&Workbench::slotNewDocument, this, _1));
- App::GetApplication().signalFinishRestoreDocument.disconnect(boost::bind(&Workbench::slotFinishRestoreDocument, this, _1));
- App::GetApplication().signalDeleteDocument.disconnect(boost::bind(&Workbench::slotDeleteDocument, this, _1));
- //App::GetApplication().signalNewObject.disconnect(boost::bind(&Workbench::slotNewObject, this, _1));
+ Gui::Application::Instance->signalActiveDocument.disconnect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
+ App::GetApplication().signalNewDocument.disconnect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
+ App::GetApplication().signalFinishRestoreDocument.disconnect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
+ App::GetApplication().signalDeleteDocument.disconnect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
+ //App::GetApplication().signalNewObject.disconnect(boost::bind(&Workbench::slotNewObject, this, bp::_1));
removeTaskWatcher();
// reset the active Body
diff --git a/src/Mod/PartDesign/Gui/WorkflowManager.cpp b/src/Mod/PartDesign/Gui/WorkflowManager.cpp
index fadd74f8e..279c8783f 100644
--- a/src/Mod/PartDesign/Gui/WorkflowManager.cpp
+++ b/src/Mod/PartDesign/Gui/WorkflowManager.cpp
@@ -26,7 +26,7 @@
#include <vector>
#include <list>
#include <set>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <QMessageBox>
#include <QPushButton>
#endif
@@ -43,6 +43,7 @@
using namespace PartDesignGui;
+namespace bp = boost::placeholders;
WorkflowManager * WorkflowManager::_instance = nullptr;
@@ -55,11 +56,11 @@ WorkflowManager::WorkflowManager() {
}
connectNewDocument = App::GetApplication().signalNewDocument.connect(
- boost::bind( &WorkflowManager::slotNewDocument, this, _1 ) );
+ boost::bind( &WorkflowManager::slotNewDocument, this, bp::_1 ) );
connectFinishRestoreDocument = App::GetApplication().signalFinishRestoreDocument.connect(
- boost::bind( &WorkflowManager::slotFinishRestoreDocument, this, _1 ) );
+ boost::bind( &WorkflowManager::slotFinishRestoreDocument, this, bp::_1 ) );
connectDeleteDocument = App::GetApplication().signalDeleteDocument.connect(
- boost::bind( &WorkflowManager::slotDeleteDocument, this, _1 ) );
+ boost::bind( &WorkflowManager::slotDeleteDocument, this, bp::_1 ) );
}
WorkflowManager::~WorkflowManager() {
diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp
index 154085c89..68de68405 100644
--- a/src/Mod/Path/App/Area.cpp
+++ b/src/Mod/Path/App/Area.cpp
@@ -21,6 +21,9 @@
****************************************************************************/
#include "PreCompiled.h"
+// From Boost 1.75 on the geometry component requires C++14
+#define BOOST_GEOMETRY_DISABLE_DEPRECATED_03_WARNING
+
#ifndef _PreComp_
# include <cfloat>
#endif
diff --git a/src/Mod/Path/libarea/PythonStuff.cpp b/src/Mod/Path/libarea/PythonStuff.cpp
index ce6811bd2..ad1518fc9 100644
--- a/src/Mod/Path/libarea/PythonStuff.cpp
+++ b/src/Mod/Path/libarea/PythonStuff.cpp
@@ -1,540 +1,542 @@
-// PythonStuff.cpp
-// Copyright 2011, Dan Heeks
-// This program is released under the BSD license. See the file COPYING for details.
-
-#include "PythonStuff.h"
-
-#include "Area.h"
-#include "Point.h"
-#include "AreaDxf.h"
-#include "kurve/geometry.h"
-#include "Adaptive.hpp"
-
-#if defined (_POSIX_C_SOURCE)
-# undef _POSIX_C_SOURCE
-#endif
-
-#if defined (_XOPEN_SOURCE)
-# undef _XOPEN_SOURCE
-#endif
-
-#if _DEBUG
-#undef _DEBUG
-#include <Python.h>
-#define _DEBUG
-#else
-#include <Python.h>
-#endif
-
-#if defined(__GNUG__) && !defined(__clang__)
-#pragma implementation
-#endif
-
-#include <boost/progress.hpp>
-#include <boost/timer.hpp>
-#include <boost/foreach.hpp>
-#include <boost/python.hpp>
-#include <boost/python/module.hpp>
-#include <boost/python/class.hpp>
-#include <boost/python/wrapper.hpp>
-#include <boost/python/call.hpp>
-
-
-#include "clipper.hpp"
-using namespace ClipperLib;
-
-
-namespace bp = boost::python;
-
-boost::python::list getVertices(const CCurve& curve) {
- boost::python::list vlist;
- BOOST_FOREACH(const CVertex& vertex, curve.m_vertices) {
- vlist.append(vertex);
- }
- return vlist;
-}
-
-boost::python::list getCurves(const CArea& area) {
- boost::python::list clist;
- BOOST_FOREACH(const CCurve& curve, area.m_curves) {
- clist.append(curve);
- }
- return clist;
-}
-
-boost::python::tuple transformed_point(const geoff_geometry::Matrix &matrix, double x, double y, double z)
-{
- geoff_geometry::Point3d p(x,y,z);
- p = p.Transform(matrix);
-
- return bp::make_tuple(p.x,p.y,p.z);
-}
-
-static void print_curve(const CCurve& c)
-{
- std::size_t nvertices = c.m_vertices.size();
-#if defined SIZEOF_SIZE_T && SIZEOF_SIZE_T == 4
- printf("number of vertices = %d\n", nvertices);
-#else
- printf("number of vertices = %lu\n", nvertices);
-#endif
- int i = 0;
- for(std::list<CVertex>::const_iterator It = c.m_vertices.begin(); It != c.m_vertices.end(); It++, i++)
- {
- const CVertex& vertex = *It;
- printf("vertex %d type = %d, x = %g, y = %g", i+1, vertex.m_type, vertex.m_p.x / CArea::get_units(), vertex.m_p.y / CArea::get_units());
- if(vertex.m_type)printf(", xc = %g, yc = %g", vertex.m_c.x / CArea::get_units(), vertex.m_c.y / CArea::get_units());
- printf("\n");
- }
-}
-
-static void print_area(const CArea &a)
-{
- for(std::list<CCurve>::const_iterator It = a.m_curves.begin(); It != a.m_curves.end(); It++)
- {
- const CCurve& curve = *It;
- print_curve(curve);
- }
-}
-
-static unsigned int num_vertices(const CCurve& curve)
-{
- return static_cast<unsigned int>(curve.m_vertices.size());
-}
-
-static CVertex FirstVertex(const CCurve& curve)
-{
- return curve.m_vertices.front();
-}
-
-static CVertex LastVertex(const CCurve& curve)
-{
- return curve.m_vertices.back();
-}
-
-static void set_units(double units)
-{
- CArea::set_units(units);
-}
-
-static double get_units()
-{
- return CArea::get_units();
-}
-
-static bool holes_linked()
-{
- return CArea::HolesLinked();
-}
-
-static CArea AreaFromDxf(const char* filepath)
-{
- CArea area;
- AreaDxfRead dxf(&area, filepath);
- dxf.DoRead();
- return area;
-}
-
-static void append_point(CCurve& c, const Point& p)
-{
- c.m_vertices.push_back(CVertex(p));
-}
-
-static boost::python::tuple nearest_point_to_curve(CCurve& c1, const CCurve& c2)
-{
- double dist;
- Point p = c1.NearestPoint(c2, &dist);
-
- return bp::make_tuple(p, dist);
-}
-
-boost::python::list MakePocketToolpath(const CArea& a, double tool_radius, double extra_offset, double stepover, bool from_center, bool use_zig_zag, double zig_angle)
-{
- std::list<CCurve> toolpath;
-
- CAreaPocketParams params(tool_radius, extra_offset, stepover, from_center, use_zig_zag ? ZigZagPocketMode : SpiralPocketMode, zig_angle);
- a.SplitAndMakePocketToolpath(toolpath, params);
-
- boost::python::list clist;
- BOOST_FOREACH(const CCurve& c, toolpath) {
- clist.append(c);
- }
- return clist;
-}
-
-boost::python::list SplitArea(const CArea& a)
-{
- std::list<CArea> areas;
- a.Split(areas);
-
- boost::python::list alist;
- BOOST_FOREACH(const CArea& a, areas) {
- alist.append(a);
- }
- return alist;
-}
-
-void dxfArea(CArea& area, const char* /*str*/)
-{
- area = CArea();
-}
-
-boost::python::list getCurveSpans(const CCurve& c)
-{
- boost::python::list span_list;
- const Point *prev_p = NULL;
-
- for(std::list<CVertex>::const_iterator VIt = c.m_vertices.begin(); VIt != c.m_vertices.end(); VIt++)
- {
- const CVertex& vertex = *VIt;
-
- if(prev_p)
- {
- span_list.append(Span(*prev_p, vertex));
- }
- prev_p = &(vertex.m_p);
- }
-
- return span_list;
-}
-
-Span getFirstCurveSpan(const CCurve& c)
-{
- if(c.m_vertices.size() < 2)return Span();
-
- std::list<CVertex>::const_iterator VIt = c.m_vertices.begin();
- const Point &p = (*VIt).m_p;
- VIt++;
- return Span(p, *VIt, true);
-}
-
-Span getLastCurveSpan(const CCurve& c)
-{
- if(c.m_vertices.size() < 2)return Span();
-
- std::list<CVertex>::const_reverse_iterator VIt = c.m_vertices.rbegin();
- const CVertex &v = (*VIt);
- VIt++;
-
- return Span((*VIt).m_p, v, c.m_vertices.size() == 2);
-}
-
-bp::tuple TangentialArc(const Point &p0, const Point &p1, const Point &v0)
-{
- Point c;
- int dir;
- tangential_arc(p0, p1, v0, c, dir);
-
- return bp::make_tuple(c, dir);
-}
-
-boost::python::list spanIntersect(const Span& span1, const Span& span2) {
- boost::python::list plist;
- std::list<Point> pts;
- span1.Intersect(span2, pts);
- BOOST_FOREACH(const Point& p, pts) {
- plist.append(p);
- }
- return plist;
-}
-
-//Matrix(boost::python::list &l){}
-boost::shared_ptr<geoff_geometry::Matrix> matrix_constructor(const boost::python::list& lst) {
- double m[16] = {1,0,0,0,0,1,0,0, 0,0,1,0, 0,0,0,1};
-
- boost::python::ssize_t n = boost::python::len(lst);
- int j = 0;
- for(boost::python::ssize_t i=0;i<n;i++) {
- boost::python::object elem = lst[i];
- m[j] = boost::python::extract<double>(elem.attr("__float__")());
- j++;
- if(j>=16)break;
- }
-
- return boost::shared_ptr<geoff_geometry::Matrix>( new geoff_geometry::Matrix(m) );
-}
-
-boost::python::list InsideCurves(const CArea& a, const CCurve& curve) {
- boost::python::list plist;
-
- std::list<CCurve> curves_inside;
- a.InsideCurves(curve, curves_inside);
- BOOST_FOREACH(const CCurve& c, curves_inside) {
- plist.append(c);
- }
- return plist;
-}
-
-boost::python::list CurveIntersections(const CCurve& c1, const CCurve& c2) {
- boost::python::list plist;
-
- std::list<Point> pts;
- c1.CurveIntersections(c2, pts);
- BOOST_FOREACH(const Point& p, pts) {
- plist.append(p);
- }
- return plist;
-}
-
-boost::python::list AreaIntersections(const CArea& a, const CCurve& c2) {
- boost::python::list plist;
-
- std::list<Point> pts;
- a.CurveIntersections(c2, pts);
- BOOST_FOREACH(const Point& p, pts) {
- plist.append(p);
- }
- return plist;
-}
-
-double AreaGetArea(const CArea& a)
-{
- return a.GetArea();
-}
-
-
-
-// Adaptive2d.Execute wrapper
-bp::list AdaptiveExecute(AdaptivePath::Adaptive2d& ada,const boost::python::list &stock_paths, const boost::python::list &in_paths, boost::python::object progressCallbackFn) {
- bp::list out_list;
-
- // convert stock paths
- AdaptivePath::DPaths stock_dpaths;
- for(bp::ssize_t i=0;i<bp::len(stock_paths);i++) {
- bp::list in_path=bp::extract<boost::python::list>(stock_paths[i]);
- AdaptivePath::DPath dpath;
- for(bp::ssize_t j=0;j<bp::len(in_path);j++) {
- bp::list in_point = bp::extract<bp::list>(in_path[j]);
- dpath.push_back(pair<double,double>(bp::extract<double>(in_point[0]),bp::extract<double>(in_point[1])));
- }
- stock_dpaths.push_back(dpath);
- }
-
- // convert inputs
- AdaptivePath::DPaths dpaths;
- for(bp::ssize_t i=0;i<bp::len(in_paths);i++) {
- bp::list in_path=bp::extract<boost::python::list>(in_paths[i]);
- AdaptivePath::DPath dpath;
- for(bp::ssize_t j=0;j<bp::len(in_path);j++) {
- bp::list in_point = bp::extract<bp::list>(in_path[j]);
- dpath.push_back(pair<double,double>(bp::extract<double>(in_point[0]),bp::extract<double>(in_point[1])));
- }
- dpaths.push_back(dpath);
- }
- // Execute with callback
- std::list<AdaptivePath::AdaptiveOutput> result=ada.Execute(stock_dpaths,dpaths,[progressCallbackFn](AdaptivePath::TPaths tp)->bool {
- bp::list out_paths;
- for(const auto & in_pair : tp) {
- bp::list path;
- for(const auto & in_pt : in_pair.second) {
- path.append(bp::make_tuple(in_pt.first,in_pt.second));
- }
- out_paths.append(bp::make_tuple(in_pair.first,path));
- }
- return bp::extract<bool>(progressCallbackFn(out_paths));
- });
- // convert outputs back
- BOOST_FOREACH(const auto & res, result) {
- out_list.append(res);
- }
- return out_list;
-}
-
- // Converts a std::pair instance to a Python tuple.
- template <typename T1, typename T2>
- struct std_pair_to_tuple
- {
- static PyObject* convert(std::pair<T1, T2> const& p)
- {
- return boost::python::incref(
- boost::python::make_tuple(p.first, p.second).ptr());
- }
- static PyTypeObject const *get_pytype () {
- return &PyTuple_Type;
- }
- };
-
- boost::python::list AdaptiveOutput_AdaptivePaths(const AdaptivePath::AdaptiveOutput &ado) {
- bp::list olist;
- for(auto & ap : ado.AdaptivePaths) {
- bp::list op;
- for(auto & pt : ap.second) {
- op.append(bp::make_tuple(pt.first, pt.second));
- }
- olist.append(bp::make_tuple(ap.first, op));
- }
- return olist;
- }
-
-
-BOOST_PYTHON_MODULE(area) {
- bp::class_<Point>("Point")
- .def(bp::init<double, double>())
- .def(bp::init<Point>())
- .def(bp::other<double>() * bp::self)
- .def(bp::self * bp::other<double>())
- .def(bp::self / bp::other<double>())
- .def(bp::self * bp::other<Point>())
- .def(bp::self - bp::other<Point>())
- .def(bp::self + bp::other<Point>())
- .def(bp::self ^ bp::other<Point>())
- .def(bp::self == bp::other<Point>())
- .def(bp::self != bp::other<Point>())
- .def(-bp::self)
- .def(~bp::self)
- .def("dist", &Point::dist)
- .def("length", &Point::length)
- .def("normalize", &Point::normalize)
- .def("Rotate", static_cast< void (Point::*)(double, double) >(&Point::Rotate))
- .def("Rotate", static_cast< void (Point::*)(double) >(&Point::Rotate))
- .def_readwrite("x", &Point::x)
- .def_readwrite("y", &Point::y)
- .def("Transform", &Point::Transform)
- ;
-
- bp::class_<CVertex>("Vertex")
- .def(bp::init<CVertex>())
- .def(bp::init<int, Point, Point>())
- .def(bp::init<Point>())
- .def(bp::init<int, Point, Point, int>())
- .def_readwrite("type", &CVertex::m_type)
- .def_readwrite("p", &CVertex::m_p)
- .def_readwrite("c", &CVertex::m_c)
- .def_readwrite("user_data", &CVertex::m_user_data)
- ;
-
- bp::class_<Span>("Span")
- .def(bp::init<Span>())
- .def(bp::init<Point, CVertex, bool>())
- .def("NearestPoint", static_cast< Point (Span::*)(const Point& p)const >(&Span::NearestPoint))
- .def("NearestPoint", static_cast< Point (Span::*)(const Span& p, double *d)const >(&Span::NearestPoint))
- .def("GetBox", &Span::GetBox)
- .def("IncludedAngle", &Span::IncludedAngle)
- .def("GetArea", &Span::GetArea)
- .def("On", &Span::On)
- .def("MidPerim", &Span::MidPerim)
- .def("MidParam", &Span::MidParam)
- .def("Length", &Span::Length)
- .def("GetVector", &Span::GetVector)
- .def("Intersect", &spanIntersect)
- .def_readwrite("p", &Span::m_p)
- .def_readwrite("v", &Span::m_v)
- ;
-
- bp::class_<CCurve>("Curve")
- .def(bp::init<CCurve>())
- .def("getVertices", &getVertices)
- .def("append",&CCurve::append)
- .def("append",&append_point)
- .def("text", &print_curve)
- .def("NearestPoint", static_cast< Point (CCurve::*)(const Point& p)const >(&CCurve::NearestPoint))
- .def("NearestPoint", &nearest_point_to_curve)
- .def("Reverse", &CCurve::Reverse)
- .def("getNumVertices", &num_vertices)
- .def("FirstVertex", &FirstVertex)
- .def("LastVertex", &LastVertex)
- .def("GetArea", &CCurve::GetArea)
- .def("IsClockwise", &CCurve::IsClockwise)
- .def("IsClosed", &CCurve::IsClosed)
- .def("ChangeStart",&CCurve::ChangeStart)
- .def("ChangeEnd",&CCurve::ChangeEnd)
- .def("Offset",&CCurve::Offset)
- .def("OffsetForward",&CCurve::OffsetForward)
- .def("GetSpans",&getCurveSpans)
- .def("GetFirstSpan",&getFirstCurveSpan)
- .def("GetLastSpan",&getLastCurveSpan)
- .def("Break",&CCurve::Break)
- .def("Perim",&CCurve::Perim)
- .def("PerimToPoint",&CCurve::PerimToPoint)
- .def("PointToPerim",&CCurve::PointToPerim)
- .def("FitArcs",&CCurve::FitArcs)
- .def("UnFitArcs",&CCurve::UnFitArcs)
- .def("Intersections",&CurveIntersections)
- ;
-
- bp::class_<CBox2D>("Box")
- .def(bp::init<CBox2D>())
- .def("MinX", &CBox2D::MinX)
- .def("MaxX", &CBox2D::MaxX)
- .def("MinY", &CBox2D::MinY)
- .def("MaxY", &CBox2D::MaxY)
- ;
-
- bp::class_<CArea>("Area")
- .def(bp::init<CArea>())
- .def("getCurves", &getCurves)
- .def("append",&CArea::append)
- .def("Subtract",&CArea::Subtract)
- .def("Intersect",&CArea::Intersect)
- .def("Union",&CArea::Union)
- .def("Offset",&CArea::Offset)
- .def("FitArcs",&CArea::FitArcs)
- .def("text", &print_area)
- .def("num_curves", &CArea::num_curves)
- .def("NearestPoint", &CArea::NearestPoint)
- .def("GetBox", &CArea::GetBox)
- .def("Reorder", &CArea::Reorder)
- .def("MakePocketToolpath", &MakePocketToolpath)
- .def("Split", &SplitArea)
- .def("InsideCurves", &InsideCurves)
- .def("Thicken", &CArea::Thicken)
- .def("Intersections",&AreaIntersections)
- .def("GetArea",&AreaGetArea)
- ;
-
- bp::class_<geoff_geometry::Matrix, boost::shared_ptr<geoff_geometry::Matrix> > ("Matrix")
- .def(bp::init<geoff_geometry::Matrix>())
- .def("__init__", bp::make_constructor(&matrix_constructor))
- .def("TransformedPoint", &transformed_point)
- .def("Multiply", &geoff_geometry::Matrix::Multiply)
- ;
-
- bp::def("set_units", set_units);
- bp::def("get_units", get_units);
- bp::def("holes_linked", holes_linked);
- bp::def("AreaFromDxf", AreaFromDxf);
- bp::def("TangentialArc", TangentialArc);
-
-
- using namespace AdaptivePath;
-
- boost::python::to_python_converter<std::pair<double, double>, std_pair_to_tuple<double, double>,true>();
-
-
- bp::enum_<MotionType>("AdaptiveMotionType")
- .value("Cutting", MotionType::mtCutting)
- .value("LinkClear", MotionType::mtLinkClear)
- .value("LinkNotClear", MotionType::mtLinkNotClear)
- .value("LinkClearAtPrevPass", MotionType::mtLinkClearAtPrevPass);
-
- bp::enum_<OperationType>("AdaptiveOperationType")
- .value("ClearingInside", OperationType::otClearingInside)
- .value("ClearingOutside", OperationType::otClearingOutside)
- .value("ProfilingInside", OperationType::otProfilingInside)
- .value("ProfilingOutside", OperationType::otProfilingOutside);
-
- bp::class_<AdaptiveOutput> ("AdaptiveOutput")
- .def(bp::init<>())
- .add_property("HelixCenterPoint", bp::make_getter(&AdaptiveOutput::HelixCenterPoint, bp::return_value_policy<bp::return_by_value>()))
- .add_property("StartPoint", bp::make_getter(&AdaptiveOutput::StartPoint, bp::return_value_policy<bp::return_by_value>()))
- .add_property("AdaptivePaths", &AdaptiveOutput_AdaptivePaths)
- .def_readonly("ReturnMotionType",&AdaptiveOutput::ReturnMotionType);
-
- bp::class_<Adaptive2d>("Adaptive2d")
- .def(bp::init<>())
- .def("Execute",&AdaptiveExecute)
- .def_readwrite("stepOverFactor", &Adaptive2d::stepOverFactor)
- .def_readwrite("toolDiameter", &Adaptive2d::toolDiameter)
- .def_readwrite("stockToLeave", &Adaptive2d::stockToLeave)
- .def_readwrite("helixRampDiameter", &Adaptive2d::helixRampDiameter)
- .def_readwrite("forceInsideOut", &Adaptive2d::forceInsideOut)
- //.def_readwrite("polyTreeNestingLimit", &Adaptive2d::polyTreeNestingLimit)
- .def_readwrite("tolerance", &Adaptive2d::tolerance)
- .def_readwrite("keepToolDownDistRatio", &Adaptive2d::keepToolDownDistRatio)
- .def_readwrite("opType", &Adaptive2d::opType);
-
-
-}
-
-
-
+// PythonStuff.cpp
+// Copyright 2011, Dan Heeks
+// This program is released under the BSD license. See the file COPYING for details.
+
+#include "PythonStuff.h"
+
+#include "Area.h"
+#include "Point.h"
+#include "AreaDxf.h"
+#include "kurve/geometry.h"
+#include "Adaptive.hpp"
+
+#if defined (_POSIX_C_SOURCE)
+# undef _POSIX_C_SOURCE
+#endif
+
+#if defined (_XOPEN_SOURCE)
+# undef _XOPEN_SOURCE
+#endif
+
+#if _DEBUG
+#undef _DEBUG
+#include <Python.h>
+#define _DEBUG
+#else
+#include <Python.h>
+#endif
+
+#if defined(__GNUG__) && !defined(__clang__)
+#pragma implementation
+#endif
+
+#define BOOST_BIND_GLOBAL_PLACEHOLDERS
+
+#include <boost/progress.hpp>
+#include <boost/timer.hpp>
+#include <boost/foreach.hpp>
+#include <boost/python.hpp>
+#include <boost/python/module.hpp>
+#include <boost/python/class.hpp>
+#include <boost/python/wrapper.hpp>
+#include <boost/python/call.hpp>
+
+
+#include "clipper.hpp"
+using namespace ClipperLib;
+
+
+namespace bp = boost::python;
+
+boost::python::list getVertices(const CCurve& curve) {
+ boost::python::list vlist;
+ BOOST_FOREACH(const CVertex& vertex, curve.m_vertices) {
+ vlist.append(vertex);
+ }
+ return vlist;
+}
+
+boost::python::list getCurves(const CArea& area) {
+ boost::python::list clist;
+ BOOST_FOREACH(const CCurve& curve, area.m_curves) {
+ clist.append(curve);
+ }
+ return clist;
+}
+
+boost::python::tuple transformed_point(const geoff_geometry::Matrix &matrix, double x, double y, double z)
+{
+ geoff_geometry::Point3d p(x,y,z);
+ p = p.Transform(matrix);
+
+ return bp::make_tuple(p.x,p.y,p.z);
+}
+
+static void print_curve(const CCurve& c)
+{
+ std::size_t nvertices = c.m_vertices.size();
+#if defined SIZEOF_SIZE_T && SIZEOF_SIZE_T == 4
+ printf("number of vertices = %d\n", nvertices);
+#else
+ printf("number of vertices = %lu\n", nvertices);
+#endif
+ int i = 0;
+ for(std::list<CVertex>::const_iterator It = c.m_vertices.begin(); It != c.m_vertices.end(); It++, i++)
+ {
+ const CVertex& vertex = *It;
+ printf("vertex %d type = %d, x = %g, y = %g", i+1, vertex.m_type, vertex.m_p.x / CArea::get_units(), vertex.m_p.y / CArea::get_units());
+ if(vertex.m_type)printf(", xc = %g, yc = %g", vertex.m_c.x / CArea::get_units(), vertex.m_c.y / CArea::get_units());
+ printf("\n");
+ }
+}
+
+static void print_area(const CArea &a)
+{
+ for(std::list<CCurve>::const_iterator It = a.m_curves.begin(); It != a.m_curves.end(); It++)
+ {
+ const CCurve& curve = *It;
+ print_curve(curve);
+ }
+}
+
+static unsigned int num_vertices(const CCurve& curve)
+{
+ return static_cast<unsigned int>(curve.m_vertices.size());
+}
+
+static CVertex FirstVertex(const CCurve& curve)
+{
+ return curve.m_vertices.front();
+}
+
+static CVertex LastVertex(const CCurve& curve)
+{
+ return curve.m_vertices.back();
+}
+
+static void set_units(double units)
+{
+ CArea::set_units(units);
+}
+
+static double get_units()
+{
+ return CArea::get_units();
+}
+
+static bool holes_linked()
+{
+ return CArea::HolesLinked();
+}
+
+static CArea AreaFromDxf(const char* filepath)
+{
+ CArea area;
+ AreaDxfRead dxf(&area, filepath);
+ dxf.DoRead();
+ return area;
+}
+
+static void append_point(CCurve& c, const Point& p)
+{
+ c.m_vertices.push_back(CVertex(p));
+}
+
+static boost::python::tuple nearest_point_to_curve(CCurve& c1, const CCurve& c2)
+{
+ double dist;
+ Point p = c1.NearestPoint(c2, &dist);
+
+ return bp::make_tuple(p, dist);
+}
+
+boost::python::list MakePocketToolpath(const CArea& a, double tool_radius, double extra_offset, double stepover, bool from_center, bool use_zig_zag, double zig_angle)
+{
+ std::list<CCurve> toolpath;
+
+ CAreaPocketParams params(tool_radius, extra_offset, stepover, from_center, use_zig_zag ? ZigZagPocketMode : SpiralPocketMode, zig_angle);
+ a.SplitAndMakePocketToolpath(toolpath, params);
+
+ boost::python::list clist;
+ BOOST_FOREACH(const CCurve& c, toolpath) {
+ clist.append(c);
+ }
+ return clist;
+}
+
+boost::python::list SplitArea(const CArea& a)
+{
+ std::list<CArea> areas;
+ a.Split(areas);
+
+ boost::python::list alist;
+ BOOST_FOREACH(const CArea& a, areas) {
+ alist.append(a);
+ }
+ return alist;
+}
+
+void dxfArea(CArea& area, const char* /*str*/)
+{
+ area = CArea();
+}
+
+boost::python::list getCurveSpans(const CCurve& c)
+{
+ boost::python::list span_list;
+ const Point *prev_p = NULL;
+
+ for(std::list<CVertex>::const_iterator VIt = c.m_vertices.begin(); VIt != c.m_vertices.end(); VIt++)
+ {
+ const CVertex& vertex = *VIt;
+
+ if(prev_p)
+ {
+ span_list.append(Span(*prev_p, vertex));
+ }
+ prev_p = &(vertex.m_p);
+ }
+
+ return span_list;
+}
+
+Span getFirstCurveSpan(const CCurve& c)
+{
+ if(c.m_vertices.size() < 2)return Span();
+
+ std::list<CVertex>::const_iterator VIt = c.m_vertices.begin();
+ const Point &p = (*VIt).m_p;
+ VIt++;
+ return Span(p, *VIt, true);
+}
+
+Span getLastCurveSpan(const CCurve& c)
+{
+ if(c.m_vertices.size() < 2)return Span();
+
+ std::list<CVertex>::const_reverse_iterator VIt = c.m_vertices.rbegin();
+ const CVertex &v = (*VIt);
+ VIt++;
+
+ return Span((*VIt).m_p, v, c.m_vertices.size() == 2);
+}
+
+bp::tuple TangentialArc(const Point &p0, const Point &p1, const Point &v0)
+{
+ Point c;
+ int dir;
+ tangential_arc(p0, p1, v0, c, dir);
+
+ return bp::make_tuple(c, dir);
+}
+
+boost::python::list spanIntersect(const Span& span1, const Span& span2) {
+ boost::python::list plist;
+ std::list<Point> pts;
+ span1.Intersect(span2, pts);
+ BOOST_FOREACH(const Point& p, pts) {
+ plist.append(p);
+ }
+ return plist;
+}
+
+//Matrix(boost::python::list &l){}
+boost::shared_ptr<geoff_geometry::Matrix> matrix_constructor(const boost::python::list& lst) {
+ double m[16] = {1,0,0,0,0,1,0,0, 0,0,1,0, 0,0,0,1};
+
+ boost::python::ssize_t n = boost::python::len(lst);
+ int j = 0;
+ for(boost::python::ssize_t i=0;i<n;i++) {
+ boost::python::object elem = lst[i];
+ m[j] = boost::python::extract<double>(elem.attr("__float__")());
+ j++;
+ if(j>=16)break;
+ }
+
+ return boost::shared_ptr<geoff_geometry::Matrix>( new geoff_geometry::Matrix(m) );
+}
+
+boost::python::list InsideCurves(const CArea& a, const CCurve& curve) {
+ boost::python::list plist;
+
+ std::list<CCurve> curves_inside;
+ a.InsideCurves(curve, curves_inside);
+ BOOST_FOREACH(const CCurve& c, curves_inside) {
+ plist.append(c);
+ }
+ return plist;
+}
+
+boost::python::list CurveIntersections(const CCurve& c1, const CCurve& c2) {
+ boost::python::list plist;
+
+ std::list<Point> pts;
+ c1.CurveIntersections(c2, pts);
+ BOOST_FOREACH(const Point& p, pts) {
+ plist.append(p);
+ }
+ return plist;
+}
+
+boost::python::list AreaIntersections(const CArea& a, const CCurve& c2) {
+ boost::python::list plist;
+
+ std::list<Point> pts;
+ a.CurveIntersections(c2, pts);
+ BOOST_FOREACH(const Point& p, pts) {
+ plist.append(p);
+ }
+ return plist;
+}
+
+double AreaGetArea(const CArea& a)
+{
+ return a.GetArea();
+}
+
+
+
+// Adaptive2d.Execute wrapper
+bp::list AdaptiveExecute(AdaptivePath::Adaptive2d& ada,const boost::python::list &stock_paths, const boost::python::list &in_paths, boost::python::object progressCallbackFn) {
+ bp::list out_list;
+
+ // convert stock paths
+ AdaptivePath::DPaths stock_dpaths;
+ for(bp::ssize_t i=0;i<bp::len(stock_paths);i++) {
+ bp::list in_path=bp::extract<boost::python::list>(stock_paths[i]);
+ AdaptivePath::DPath dpath;
+ for(bp::ssize_t j=0;j<bp::len(in_path);j++) {
+ bp::list in_point = bp::extract<bp::list>(in_path[j]);
+ dpath.push_back(pair<double,double>(bp::extract<double>(in_point[0]),bp::extract<double>(in_point[1])));
+ }
+ stock_dpaths.push_back(dpath);
+ }
+
+ // convert inputs
+ AdaptivePath::DPaths dpaths;
+ for(bp::ssize_t i=0;i<bp::len(in_paths);i++) {
+ bp::list in_path=bp::extract<boost::python::list>(in_paths[i]);
+ AdaptivePath::DPath dpath;
+ for(bp::ssize_t j=0;j<bp::len(in_path);j++) {
+ bp::list in_point = bp::extract<bp::list>(in_path[j]);
+ dpath.push_back(pair<double,double>(bp::extract<double>(in_point[0]),bp::extract<double>(in_point[1])));
+ }
+ dpaths.push_back(dpath);
+ }
+ // Execute with callback
+ std::list<AdaptivePath::AdaptiveOutput> result=ada.Execute(stock_dpaths,dpaths,[progressCallbackFn](AdaptivePath::TPaths tp)->bool {
+ bp::list out_paths;
+ for(const auto & in_pair : tp) {
+ bp::list path;
+ for(const auto & in_pt : in_pair.second) {
+ path.append(bp::make_tuple(in_pt.first,in_pt.second));
+ }
+ out_paths.append(bp::make_tuple(in_pair.first,path));
+ }
+ return bp::extract<bool>(progressCallbackFn(out_paths));
+ });
+ // convert outputs back
+ BOOST_FOREACH(const auto & res, result) {
+ out_list.append(res);
+ }
+ return out_list;
+}
+
+ // Converts a std::pair instance to a Python tuple.
+ template <typename T1, typename T2>
+ struct std_pair_to_tuple
+ {
+ static PyObject* convert(std::pair<T1, T2> const& p)
+ {
+ return boost::python::incref(
+ boost::python::make_tuple(p.first, p.second).ptr());
+ }
+ static PyTypeObject const *get_pytype () {
+ return &PyTuple_Type;
+ }
+ };
+
+ boost::python::list AdaptiveOutput_AdaptivePaths(const AdaptivePath::AdaptiveOutput &ado) {
+ bp::list olist;
+ for(auto & ap : ado.AdaptivePaths) {
+ bp::list op;
+ for(auto & pt : ap.second) {
+ op.append(bp::make_tuple(pt.first, pt.second));
+ }
+ olist.append(bp::make_tuple(ap.first, op));
+ }
+ return olist;
+ }
+
+
+BOOST_PYTHON_MODULE(area) {
+ bp::class_<Point>("Point")
+ .def(bp::init<double, double>())
+ .def(bp::init<Point>())
+ .def(bp::other<double>() * bp::self)
+ .def(bp::self * bp::other<double>())
+ .def(bp::self / bp::other<double>())
+ .def(bp::self * bp::other<Point>())
+ .def(bp::self - bp::other<Point>())
+ .def(bp::self + bp::other<Point>())
+ .def(bp::self ^ bp::other<Point>())
+ .def(bp::self == bp::other<Point>())
+ .def(bp::self != bp::other<Point>())
+ .def(-bp::self)
+ .def(~bp::self)
+ .def("dist", &Point::dist)
+ .def("length", &Point::length)
+ .def("normalize", &Point::normalize)
+ .def("Rotate", static_cast< void (Point::*)(double, double) >(&Point::Rotate))
+ .def("Rotate", static_cast< void (Point::*)(double) >(&Point::Rotate))
+ .def_readwrite("x", &Point::x)
+ .def_readwrite("y", &Point::y)
+ .def("Transform", &Point::Transform)
+ ;
+
+ bp::class_<CVertex>("Vertex")
+ .def(bp::init<CVertex>())
+ .def(bp::init<int, Point, Point>())
+ .def(bp::init<Point>())
+ .def(bp::init<int, Point, Point, int>())
+ .def_readwrite("type", &CVertex::m_type)
+ .def_readwrite("p", &CVertex::m_p)
+ .def_readwrite("c", &CVertex::m_c)
+ .def_readwrite("user_data", &CVertex::m_user_data)
+ ;
+
+ bp::class_<Span>("Span")
+ .def(bp::init<Span>())
+ .def(bp::init<Point, CVertex, bool>())
+ .def("NearestPoint", static_cast< Point (Span::*)(const Point& p)const >(&Span::NearestPoint))
+ .def("NearestPoint", static_cast< Point (Span::*)(const Span& p, double *d)const >(&Span::NearestPoint))
+ .def("GetBox", &Span::GetBox)
+ .def("IncludedAngle", &Span::IncludedAngle)
+ .def("GetArea", &Span::GetArea)
+ .def("On", &Span::On)
+ .def("MidPerim", &Span::MidPerim)
+ .def("MidParam", &Span::MidParam)
+ .def("Length", &Span::Length)
+ .def("GetVector", &Span::GetVector)
+ .def("Intersect", &spanIntersect)
+ .def_readwrite("p", &Span::m_p)
+ .def_readwrite("v", &Span::m_v)
+ ;
+
+ bp::class_<CCurve>("Curve")
+ .def(bp::init<CCurve>())
+ .def("getVertices", &getVertices)
+ .def("append",&CCurve::append)
+ .def("append",&append_point)
+ .def("text", &print_curve)
+ .def("NearestPoint", static_cast< Point (CCurve::*)(const Point& p)const >(&CCurve::NearestPoint))
+ .def("NearestPoint", &nearest_point_to_curve)
+ .def("Reverse", &CCurve::Reverse)
+ .def("getNumVertices", &num_vertices)
+ .def("FirstVertex", &FirstVertex)
+ .def("LastVertex", &LastVertex)
+ .def("GetArea", &CCurve::GetArea)
+ .def("IsClockwise", &CCurve::IsClockwise)
+ .def("IsClosed", &CCurve::IsClosed)
+ .def("ChangeStart",&CCurve::ChangeStart)
+ .def("ChangeEnd",&CCurve::ChangeEnd)
+ .def("Offset",&CCurve::Offset)
+ .def("OffsetForward",&CCurve::OffsetForward)
+ .def("GetSpans",&getCurveSpans)
+ .def("GetFirstSpan",&getFirstCurveSpan)
+ .def("GetLastSpan",&getLastCurveSpan)
+ .def("Break",&CCurve::Break)
+ .def("Perim",&CCurve::Perim)
+ .def("PerimToPoint",&CCurve::PerimToPoint)
+ .def("PointToPerim",&CCurve::PointToPerim)
+ .def("FitArcs",&CCurve::FitArcs)
+ .def("UnFitArcs",&CCurve::UnFitArcs)
+ .def("Intersections",&CurveIntersections)
+ ;
+
+ bp::class_<CBox2D>("Box")
+ .def(bp::init<CBox2D>())
+ .def("MinX", &CBox2D::MinX)
+ .def("MaxX", &CBox2D::MaxX)
+ .def("MinY", &CBox2D::MinY)
+ .def("MaxY", &CBox2D::MaxY)
+ ;
+
+ bp::class_<CArea>("Area")
+ .def(bp::init<CArea>())
+ .def("getCurves", &getCurves)
+ .def("append",&CArea::append)
+ .def("Subtract",&CArea::Subtract)
+ .def("Intersect",&CArea::Intersect)
+ .def("Union",&CArea::Union)
+ .def("Offset",&CArea::Offset)
+ .def("FitArcs",&CArea::FitArcs)
+ .def("text", &print_area)
+ .def("num_curves", &CArea::num_curves)
+ .def("NearestPoint", &CArea::NearestPoint)
+ .def("GetBox", &CArea::GetBox)
+ .def("Reorder", &CArea::Reorder)
+ .def("MakePocketToolpath", &MakePocketToolpath)
+ .def("Split", &SplitArea)
+ .def("InsideCurves", &InsideCurves)
+ .def("Thicken", &CArea::Thicken)
+ .def("Intersections",&AreaIntersections)
+ .def("GetArea",&AreaGetArea)
+ ;
+
+ bp::class_<geoff_geometry::Matrix, boost::shared_ptr<geoff_geometry::Matrix> > ("Matrix")
+ .def(bp::init<geoff_geometry::Matrix>())
+ .def("__init__", bp::make_constructor(&matrix_constructor))
+ .def("TransformedPoint", &transformed_point)
+ .def("Multiply", &geoff_geometry::Matrix::Multiply)
+ ;
+
+ bp::def("set_units", set_units);
+ bp::def("get_units", get_units);
+ bp::def("holes_linked", holes_linked);
+ bp::def("AreaFromDxf", AreaFromDxf);
+ bp::def("TangentialArc", TangentialArc);
+
+
+ using namespace AdaptivePath;
+
+ boost::python::to_python_converter<std::pair<double, double>, std_pair_to_tuple<double, double>,true>();
+
+
+ bp::enum_<MotionType>("AdaptiveMotionType")
+ .value("Cutting", MotionType::mtCutting)
+ .value("LinkClear", MotionType::mtLinkClear)
+ .value("LinkNotClear", MotionType::mtLinkNotClear)
+ .value("LinkClearAtPrevPass", MotionType::mtLinkClearAtPrevPass);
+
+ bp::enum_<OperationType>("AdaptiveOperationType")
+ .value("ClearingInside", OperationType::otClearingInside)
+ .value("ClearingOutside", OperationType::otClearingOutside)
+ .value("ProfilingInside", OperationType::otProfilingInside)
+ .value("ProfilingOutside", OperationType::otProfilingOutside);
+
+ bp::class_<AdaptiveOutput> ("AdaptiveOutput")
+ .def(bp::init<>())
+ .add_property("HelixCenterPoint", bp::make_getter(&AdaptiveOutput::HelixCenterPoint, bp::return_value_policy<bp::return_by_value>()))
+ .add_property("StartPoint", bp::make_getter(&AdaptiveOutput::StartPoint, bp::return_value_policy<bp::return_by_value>()))
+ .add_property("AdaptivePaths", &AdaptiveOutput_AdaptivePaths)
+ .def_readonly("ReturnMotionType",&AdaptiveOutput::ReturnMotionType);
+
+ bp::class_<Adaptive2d>("Adaptive2d")
+ .def(bp::init<>())
+ .def("Execute",&AdaptiveExecute)
+ .def_readwrite("stepOverFactor", &Adaptive2d::stepOverFactor)
+ .def_readwrite("toolDiameter", &Adaptive2d::toolDiameter)
+ .def_readwrite("stockToLeave", &Adaptive2d::stockToLeave)
+ .def_readwrite("helixRampDiameter", &Adaptive2d::helixRampDiameter)
+ .def_readwrite("forceInsideOut", &Adaptive2d::forceInsideOut)
+ //.def_readwrite("polyTreeNestingLimit", &Adaptive2d::polyTreeNestingLimit)
+ .def_readwrite("tolerance", &Adaptive2d::tolerance)
+ .def_readwrite("keepToolDownDistRatio", &Adaptive2d::keepToolDownDistRatio)
+ .def_readwrite("opType", &Adaptive2d::opType);
+
+
+}
+
+
+
diff --git a/src/Mod/ReverseEngineering/App/ApproxSurface.cpp b/src/Mod/ReverseEngineering/App/ApproxSurface.cpp
index 171859ab5..c49de5e0a 100644
--- a/src/Mod/ReverseEngineering/App/ApproxSurface.cpp
+++ b/src/Mod/ReverseEngineering/App/ApproxSurface.cpp
@@ -30,7 +30,7 @@
#include <QFuture>
#include <QFutureWatcher>
#include <QtConcurrentMap>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <Mod/Mesh/App/Core/Approximation.h>
#include <Base/Sequencer.h>
@@ -40,6 +40,7 @@
#include "ApproxSurface.h"
using namespace Reen;
+namespace bp = boost::placeholders;
// SplineBasisfunction
@@ -1090,7 +1091,7 @@ bool BSplineParameterCorrection::SolveWithSmoothing(double fWeight)
std::generate(columns.begin(), columns.end(), Base::iotaGen<int>(0));
ScalarProduct scalar(M);
QFuture< std::vector<double> > future = QtConcurrent::mapped
- (columns, boost::bind(&ScalarProduct::multiply, &scalar, _1));
+ (columns, boost::bind(&ScalarProduct::multiply, &scalar, bp::_1));
QFutureWatcher< std::vector<double> > watcher;
watcher.setFuture(future);
watcher.waitForFinished();
diff --git a/src/Mod/Sandbox/App/DocumentProtector.h b/src/Mod/Sandbox/App/DocumentProtector.h
index 603b92932..f44aebdb5 100644
--- a/src/Mod/Sandbox/App/DocumentProtector.h
+++ b/src/Mod/Sandbox/App/DocumentProtector.h
@@ -25,7 +25,6 @@
#define SANDBOX_DOCUMENTPROTECTOR_H
#include <string>
-#include <boost/bind.hpp>
#include <App/DocumentObserver.h>
namespace App {
diff --git a/src/Mod/Sandbox/Gui/Command.cpp b/src/Mod/Sandbox/Gui/Command.cpp
index 67db11a1e..81158c70b 100644
--- a/src/Mod/Sandbox/Gui/Command.cpp
+++ b/src/Mod/Sandbox/Gui/Command.cpp
@@ -56,7 +56,7 @@
# if BOOST_VERSION >= 104100
# include <boost/thread/future.hpp>
# endif
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
# include <boost/shared_ptr.hpp>
#endif
@@ -81,6 +81,8 @@
#include "GLGraphicsView.h"
#include "TaskPanelView.h"
+namespace bp = boost::placeholders;
+
DEF_STD_CMD(CmdSandboxDocumentThread);
CmdSandboxDocumentThread::CmdSandboxDocumentThread()
@@ -829,7 +831,7 @@ void CmdSandboxMeshTestJob::activated(int)
Base::Console().Message("Mesh test (step %d)...\n",iteration++);
MeshTestJob meshJob;
QFuture<Mesh::MeshObject*> mesh_future = QtConcurrent::mapped
- (mesh_groups, boost::bind(&MeshTestJob::run, &meshJob, _1));
+ (mesh_groups, boost::bind(&MeshTestJob::run, &meshJob, bp::_1));
// keep it responsive during computation
QFutureWatcher<Mesh::MeshObject*> mesh_watcher;
diff --git a/src/Mod/Sandbox/Gui/TaskPanelView.cpp b/src/Mod/Sandbox/Gui/TaskPanelView.cpp
index 92f709608..ad2e78b1a 100644
--- a/src/Mod/Sandbox/Gui/TaskPanelView.cpp
+++ b/src/Mod/Sandbox/Gui/TaskPanelView.cpp
@@ -25,7 +25,7 @@
/// Here the FreeCAD includes sorted by Base,App,Gui......
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <QVariant>
#include <QAction>
#include <QApplication>
@@ -55,6 +55,7 @@
using namespace SandboxGui;
+namespace bp = boost::placeholders;
#if defined(QSINT_ACTIONPANEL)
@@ -557,27 +558,27 @@ TaskPanelView::TaskPanelView(QWidget *parent)
QAction* defaultAction = new QAction(this);
connect(ui->rbDefaultScheme, SIGNAL(toggled(bool)), defaultAction, SIGNAL(toggled(bool)));
- func->toggle(defaultAction, boost::bind(&TaskPanelView::on_rbDefaultScheme_toggled, this, _1));
+ func->toggle(defaultAction, boost::bind(&TaskPanelView::on_rbDefaultScheme_toggled, this, bp::_1));
QAction* xpBlueAction = new QAction(this);
connect(ui->rbXPBlueScheme, SIGNAL(toggled(bool)), xpBlueAction, SIGNAL(toggled(bool)));
- func->toggle(xpBlueAction, boost::bind(&TaskPanelView::on_rbXPBlueScheme_toggled, this, _1));
+ func->toggle(xpBlueAction, boost::bind(&TaskPanelView::on_rbXPBlueScheme_toggled, this, bp::_1));
QAction* xpBlue2Action = new QAction(this);
connect(ui->rbXPBlue2Scheme, SIGNAL(toggled(bool)), xpBlue2Action, SIGNAL(toggled(bool)));
- func->toggle(xpBlue2Action, boost::bind(&TaskPanelView::on_rbXPBlue2Scheme_toggled, this, _1));
+ func->toggle(xpBlue2Action, boost::bind(&TaskPanelView::on_rbXPBlue2Scheme_toggled, this, bp::_1));
QAction* vistaAction = new QAction(this);
connect(ui->rbVistaScheme, SIGNAL(toggled(bool)), vistaAction, SIGNAL(toggled(bool)));
- func->toggle(vistaAction, boost::bind(&TaskPanelView::on_rbVistaScheme_toggled, this, _1));
+ func->toggle(vistaAction, boost::bind(&TaskPanelView::on_rbVistaScheme_toggled, this, bp::_1));
QAction* macAction = new QAction(this);
connect(ui->rbMacScheme, SIGNAL(toggled(bool)), macAction, SIGNAL(toggled(bool)));
- func->toggle(macAction, boost::bind(&TaskPanelView::on_rbMacScheme_toggled, this, _1));
+ func->toggle(macAction, boost::bind(&TaskPanelView::on_rbMacScheme_toggled, this, bp::_1));
QAction* androidAction = new QAction(this);
connect(ui->rbAndroidScheme, SIGNAL(toggled(bool)), androidAction, SIGNAL(toggled(bool)));
- func->toggle(androidAction, boost::bind(&TaskPanelView::on_rbAndroidScheme_toggled, this, _1));
+ func->toggle(androidAction, boost::bind(&TaskPanelView::on_rbAndroidScheme_toggled, this, bp::_1));
}
#else
setWindowTitle(QLatin1String("Task View"));
diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp
index 8f022455a..20f664e37 100644
--- a/src/Mod/Sketcher/App/SketchObject.cpp
+++ b/src/Mod/Sketcher/App/SketchObject.cpp
@@ -58,11 +58,10 @@
# include <Standard_Version.hxx>
# include <cmath>
# include <vector>
+# include <boost/bind/bind.hpp>
//# include <QtGlobal>
#endif
-#include <boost/bind.hpp>
-
#include <App/Document.h>
#include <App/FeaturePythonPyImp.h>
#include <App/Part.h>
@@ -88,6 +87,7 @@
using namespace Sketcher;
using namespace Base;
+namespace bp = boost::placeholders;
const int GeoEnum::RtPnt = -1;
const int GeoEnum::HAxis = -1;
@@ -132,10 +132,10 @@ SketchObject::SketchObject()
noRecomputes=false;
- ExpressionEngine.setValidator(boost::bind(&Sketcher::SketchObject::validateExpression, this, _1, _2));
+ ExpressionEngine.setValidator(boost::bind(&Sketcher::SketchObject::validateExpression, this, bp::_1, bp::_2));
- constraintsRemovedConn = Constraints.signalConstraintsRemoved.connect(boost::bind(&Sketcher::SketchObject::constraintsRemoved, this, _1));
- constraintsRenamedConn = Constraints.signalConstraintsRenamed.connect(boost::bind(&Sketcher::SketchObject::constraintsRenamed, this, _1));
+ constraintsRemovedConn = Constraints.signalConstraintsRemoved.connect(boost::bind(&Sketcher::SketchObject::constraintsRemoved, this, bp::_1));
+ constraintsRenamedConn = Constraints.signalConstraintsRenamed.connect(boost::bind(&Sketcher::SketchObject::constraintsRenamed, this, bp::_1));
analyser = new SketchAnalysis(this);
}
diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp
index abfa954a2..6679422a3 100644
--- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp
+++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp
@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include "TaskDlgEditSketch.h"
@@ -32,6 +32,7 @@
#include <Gui/Command.h>
using namespace SketcherGui;
+namespace bp = boost::placeholders;
//**************************************************************************
@@ -74,9 +75,9 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView)
App::Document* document = sketchView->getObject()->getDocument();
connectUndoDocument =
- document->signalUndo.connect(boost::bind(&TaskDlgEditSketch::slotUndoDocument, this, _1));
+ document->signalUndo.connect(boost::bind(&TaskDlgEditSketch::slotUndoDocument, this, bp::_1));
connectRedoDocument =
- document->signalRedo.connect(boost::bind(&TaskDlgEditSketch::slotRedoDocument, this, _1));
+ document->signalRedo.connect(boost::bind(&TaskDlgEditSketch::slotRedoDocument, this, bp::_1));
}
TaskDlgEditSketch::~TaskDlgEditSketch()
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp
index 7eeeae6c5..e8a3ef8f6 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp
+++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp
@@ -33,6 +33,7 @@
# include <QStyledItemDelegate>
# include <QPainter>
# include <QPixmapCache>
+# include <boost/bind/bind.hpp>
#endif
#include "TaskSketcherConstrains.h"
@@ -50,7 +51,6 @@
#include <Gui/Selection.h>
#include <Gui/BitmapFactory.h>
#include <Gui/ViewProvider.h>
-#include <boost/bind.hpp>
#include <Gui/Command.h>
#include <Gui/MainWindow.h>
#include <Gui/PrefWidgets.h>
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp
index 692a66d82..9f411838d 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp
+++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp
@@ -29,6 +29,7 @@
# include <QRegExp>
# include <QShortcut>
# include <QString>
+# include <boost/bind/bind.hpp>
#endif
#include "TaskSketcherElements.h"
@@ -48,7 +49,6 @@
#include <Gui/BitmapFactory.h>
#include <Gui/ViewProvider.h>
#include <Gui/BitmapFactory.h>
-#include <boost/bind.hpp>
#include <Gui/Command.h>
using namespace SketcherGui;
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp
index 8b0e88478..58f832e23 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp
+++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp
@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
+#include <boost/bind/bind.hpp>
#endif
#include "ui_TaskSketcherGeneral.h"
@@ -40,6 +41,7 @@
using namespace SketcherGui;
using namespace Gui::TaskView;
+namespace bp = boost::placeholders;
SketcherGeneralWidget::SketcherGeneralWidget(QWidget *parent)
: QWidget(parent), ui(new Ui_TaskSketcherGeneral)
@@ -233,7 +235,7 @@ TaskSketcherGeneral::TaskSketcherGeneral(ViewProviderSketch *sketchView)
Gui::Application* app = Gui::Application::Instance;
changedSketchView = app->signalChangedObject.connect(boost::bind
- (&TaskSketcherGeneral::onChangedSketchView, this, _1, _2));
+ (&TaskSketcherGeneral::onChangedSketchView, this, bp::_1, bp::_2));
}
TaskSketcherGeneral::~TaskSketcherGeneral()
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp b/src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp
index f51f126f3..8a77c8f92 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp
+++ b/src/Mod/Sketcher/Gui/TaskSketcherMessages.cpp
@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
+# include <boost/bind/bind.hpp>
#endif
#include "ui_TaskSketcherMessages.h"
@@ -36,14 +37,13 @@
#include <Gui/Selection.h>
#include <Gui/Command.h>
-#include <boost/bind.hpp>
-
#include <Mod/Sketcher/App/SketchObject.h>
#include "ViewProviderSketch.h"
using namespace SketcherGui;
using namespace Gui::TaskView;
+namespace bp = boost::placeholders;
TaskSketcherMessages::TaskSketcherMessages(ViewProviderSketch *sketchView)
: TaskBox(Gui::BitmapFactory().pixmap("document-new"),tr("Solver messages"),true, 0)
@@ -57,8 +57,8 @@ TaskSketcherMessages::TaskSketcherMessages(ViewProviderSketch *sketchView)
this->groupLayout()->addWidget(proxy);
- connectionSetUp = sketchView->signalSetUp.connect(boost::bind(&SketcherGui::TaskSketcherMessages::slotSetUp, this,_1));
- connectionSolved = sketchView->signalSolved.connect(boost::bind(&SketcherGui::TaskSketcherMessages::slotSolved, this,_1));
+ connectionSetUp = sketchView->signalSetUp.connect(boost::bind(&SketcherGui::TaskSketcherMessages::slotSetUp, this, bp::_1));
+ connectionSolved = sketchView->signalSolved.connect(boost::bind(&SketcherGui::TaskSketcherMessages::slotSolved, this, bp::_1));
ui->labelConstrainStatus->setOpenExternalLinks(false);
diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
index 05ea71cb6..a63c2ca56 100644
--- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
+++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
@@ -73,7 +73,7 @@
#endif
#ifndef _PreComp_
-# include <boost/bind.hpp>
+# include <boost/bind/bind.hpp>
#endif
#include <Inventor/SbTime.h>
@@ -134,6 +134,7 @@
using namespace SketcherGui;
using namespace Sketcher;
+namespace bp = boost::placeholders;
SbColor ViewProviderSketch::VertexColor (1.0f,0.149f,0.0f); // #FF2600 -> (255, 38, 0)
SbColor ViewProviderSketch::CurveColor (1.0f,1.0f,1.0f); // #FFFFFF -> (255,255,255)
@@ -5693,9 +5694,9 @@ bool ViewProviderSketch::setEdit(int ModNum)
draw(false,true);
connectUndoDocument = Gui::Application::Instance->activeDocument()
- ->signalUndoDocument.connect(boost::bind(&ViewProviderSketch::slotUndoDocument, this, _1));
+ ->signalUndoDocument.connect(boost::bind(&ViewProviderSketch::slotUndoDocument, this, bp::_1));
connectRedoDocument = Gui::Application::Instance->activeDocument()
- ->signalRedoDocument.connect(boost::bind(&ViewProviderSketch::slotRedoDocument, this, _1));
+ ->signalRedoDocument.connect(boost::bind(&ViewProviderSketch::slotRedoDocument, this, bp::_1));
// Enable solver initial solution update while dragging.
ParameterGrp::handle hGrp2 = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp
index 8ed557f44..669605b4e 100644
--- a/src/Mod/Spreadsheet/App/PropertySheet.cpp
+++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp
@@ -28,7 +28,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/assign.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/regex.hpp>
#include <App/Document.h>
#include <App/DocumentObject.h>
@@ -45,6 +45,7 @@
using namespace App;
using namespace Base;
using namespace Spreadsheet;
+namespace bp = boost::placeholders;
namespace Spreadsheet {
@@ -679,7 +680,7 @@ void PropertySheet::insertRows(int row, int count)
boost::copy( data | boost::adaptors::map_keys, std::back_inserter(keys));
/* Sort them */
- std::sort(keys.begin(), keys.end(), boost::bind(&PropertySheet::rowSortFunc, this, _1, _2));
+ std::sort(keys.begin(), keys.end(), boost::bind(&PropertySheet::rowSortFunc, this, bp::_1, bp::_2));
RewriteExpressionVisitor visitor(CellAddress(row, CellAddress::MAX_COLUMNS), count, 0);
@@ -728,7 +729,7 @@ void PropertySheet::removeRows(int row, int count)
boost::copy(data | boost::adaptors::map_keys, std::back_inserter(keys));
/* Sort them */
- std::sort(keys.begin(), keys.end(), boost::bind(&PropertySheet::rowSortFunc, this, _1, _2));
+ std::sort(keys.begin(), keys.end(), boost::bind(&PropertySheet::rowSortFunc, this, bp::_1, bp::_2));
RewriteExpressionVisitor visitor(CellAddress(row + count - 1, CellAddress::MAX_COLUMNS), -count, 0);
@@ -816,7 +817,7 @@ void PropertySheet::removeColumns(int col, int count)
boost::copy(data | boost::adaptors::map_keys, std::back_inserter(keys));
/* Sort them */
- std::sort(keys.begin(), keys.end(), boost::bind(&PropertySheet::colSortFunc, this, _1, _2));
+ std::sort(keys.begin(), keys.end(), boost::bind(&PropertySheet::colSortFunc, this, bp::_1, bp::_2));
RewriteExpressionVisitor visitor(CellAddress(CellAddress::MAX_ROWS, col + count - 1), 0, -count);
diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp
index 5ff7720b0..4157ac08f 100644
--- a/src/Mod/Spreadsheet/App/Sheet.cpp
+++ b/src/Mod/Spreadsheet/App/Sheet.cpp
@@ -50,12 +50,12 @@
#include <string>
#include <iomanip>
#include <boost/regex.hpp>
-#include <boost/bind.hpp>
#include <deque>
using namespace Base;
using namespace App;
using namespace Spreadsheet;
+namespace bp = boost::placeholders;
PROPERTY_SOURCE(Spreadsheet::Sheet, App::DocumentObject)
@@ -89,8 +89,8 @@ Sheet::Sheet()
docDeps.setSize(0);
docDeps.setScope(LinkScope::Global);
- onRenamedDocumentConnection = GetApplication().signalRenameDocument.connect(boost::bind(&Spreadsheet::Sheet::onRenamedDocument, this, _1));
- onRelabledDocumentConnection = GetApplication().signalRelabelDocument.connect(boost::bind(&Spreadsheet::Sheet::onRelabledDocument, this, _1));
+ onRenamedDocumentConnection = GetApplication().signalRenameDocument.connect(boost::bind(&Spreadsheet::Sheet::onRenamedDocument, this, bp::_1));
+ onRelabledDocumentConnection = GetApplication().signalRelabelDocument.connect(boost::bind(&Spreadsheet::Sheet::onRelabledDocument, this, bp::_1));
}
/**
diff --git a/src/Mod/Spreadsheet/Gui/SheetModel.cpp b/src/Mod/Spreadsheet/Gui/SheetModel.cpp
index 222d69475..7e17dacc9 100644
--- a/src/Mod/Spreadsheet/Gui/SheetModel.cpp
+++ b/src/Mod/Spreadsheet/Gui/SheetModel.cpp
@@ -36,17 +36,18 @@
#include <Gui/Command.h>
#include <Base/Tools.h>
#include <Base/UnitsApi.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
using namespace SpreadsheetGui;
using namespace Spreadsheet;
using namespace App;
+namespace bp = boost::placeholders;
SheetModel::SheetModel(Sheet *_sheet, QObject *parent)
: QAbstractTableModel(parent)
, sheet(_sheet)
{
- cellUpdatedConnection = sheet->cellUpdated.connect(bind(&SheetModel::cellUpdated, this, _1));
+ cellUpdatedConnection = sheet->cellUpdated.connect(bind(&SheetModel::cellUpdated, this, bp::_1));
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Spreadsheet");
aliasBgColor = QColor(Base::Tools::fromStdString(hGrp->GetASCII("AliasedCellBackgroundColor", "#feff9e")));
diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp
index 5a3913234..31d008cc2 100644
--- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp
+++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp
@@ -29,7 +29,7 @@
#endif
#include <Gui/Command.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "../App/Utils.h"
#include <App/Range.h>
#include "SheetTableView.h"
@@ -39,6 +39,7 @@
using namespace SpreadsheetGui;
using namespace Spreadsheet;
using namespace App;
+namespace bp = boost::placeholders;
void SheetViewHeader::mouseReleaseEvent(QMouseEvent *event)
{
@@ -253,7 +254,7 @@ void SheetTableView::updateCellSpan(CellAddress address)
void SheetTableView::setSheet(Sheet * _sheet)
{
sheet = _sheet;
- cellSpanChangedConnection = sheet->cellSpanChanged.connect(bind(&SheetTableView::updateCellSpan, this, _1));
+ cellSpanChangedConnection = sheet->cellSpanChanged.connect(bind(&SheetTableView::updateCellSpan, this, bp::_1));
// Update row and column spans
std::vector<std::string> usedCells = sheet->getUsedCells();
diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp
index 0aedaac9a..75e510fa0 100644
--- a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp
+++ b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp
@@ -46,7 +46,7 @@
#include <App/DocumentObject.h>
#include <App/PropertyStandard.h>
#include <Gui/Command.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <Mod/Spreadsheet/App/Utils.h>
#include "qtcolorpicker.h"
#include <LineEdit.h>
@@ -57,6 +57,7 @@ using namespace SpreadsheetGui;
using namespace Spreadsheet;
using namespace Gui;
using namespace App;
+namespace bp = boost::placeholders;
/* TRANSLATOR SpreadsheetGui::SheetView */
@@ -96,8 +97,8 @@ SheetView::SheetView(Gui::Document *pcDocument, App::DocumentObject *docObj, QWi
connect(ui->cellContent, SIGNAL(returnPressed()), this, SLOT( editingFinished() ));
- columnWidthChangedConnection = sheet->columnWidthChanged.connect(bind(&SheetView::resizeColumn, this, _1, _2));
- rowHeightChangedConnection = sheet->rowHeightChanged.connect(bind(&SheetView::resizeRow, this, _1, _2));
+ columnWidthChangedConnection = sheet->columnWidthChanged.connect(bind(&SheetView::resizeColumn, this, bp::_1, bp::_2));
+ rowHeightChangedConnection = sheet->rowHeightChanged.connect(bind(&SheetView::resizeRow, this, bp::_1, bp::_2));
connect( model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(modelUpdated(const QModelIndex &, const QModelIndex &)));
diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp
index 4cc1adf14..d44c71faf 100644
--- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp
+++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp
@@ -39,7 +39,7 @@
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#include <boost/signals2.hpp>
- #include <boost/bind.hpp>
+ #include <boost/bind/bind.hpp>
#endif // #ifndef _PreComp_
@@ -95,6 +95,7 @@
using namespace TechDrawGui;
+namespace bp = boost::placeholders;
/* TRANSLATOR TechDrawGui::MDIViewPage */
@@ -139,7 +140,7 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget*
//get informed by App side about deleted DocumentObjects
App::Document* appDoc = m_vpPage->getDocument()->getDocument();
- auto bnd = boost::bind(&MDIViewPage::onDeleteObject, this, _1);
+ auto bnd = boost::bind(&MDIViewPage::onDeleteObject, this, bp::_1);
connectDeletedObject = appDoc->signalDeletedObject.connect(bnd);
diff --git a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp
index 13385ba25..589a5933c 100644
--- a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp
+++ b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp
@@ -27,7 +27,7 @@
#ifndef _PreComp_
#include <boost/signals2.hpp>
#include <boost/signals2/connection.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#endif
@@ -56,6 +56,7 @@
#include "ViewProviderDrawingView.h"
using namespace TechDrawGui;
+namespace bp = boost::placeholders;
PROPERTY_SOURCE(TechDrawGui::ViewProviderDrawingView, Gui::ViewProviderDocumentObject)
@@ -80,7 +81,7 @@ void ViewProviderDrawingView::attach(App::DocumentObject *pcFeat)
{
ViewProviderDocumentObject::attach(pcFeat);
- auto bnd = boost::bind(&ViewProviderDrawingView::onGuiRepaint, this, _1);
+ auto bnd = boost::bind(&ViewProviderDrawingView::onGuiRepaint, this, bp::_1);
auto feature = getViewObject();
if (feature != nullptr) {
connectGuiRepaint = feature->signalGuiPaint.connect(bnd);
diff --git a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp
index b03a2159f..01c850645 100644
--- a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp
+++ b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp
@@ -32,7 +32,7 @@
#include <QPointer>
#include <boost/signals2.hpp>
#include <boost/signals2/connection.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#endif
@@ -60,6 +60,7 @@
#include <Mod/TechDraw/App/DrawUtil.h>
using namespace TechDrawGui;
+namespace bp = boost::placeholders;
#define _SHOWDRAWING 10
#define _TOGGLEUPDATE 11
@@ -90,7 +91,7 @@ void ViewProviderPage::attach(App::DocumentObject *pcFeat)
{
ViewProviderDocumentObject::attach(pcFeat);
- auto bnd = boost::bind(&ViewProviderPage::onGuiRepaint, this, _1);
+ auto bnd = boost::bind(&ViewProviderPage::onGuiRepaint, this, bp::_1);
auto feature = getDrawPage();
if (feature != nullptr) {
connectGuiRepaint = feature->signalGuiPaint.connect(bnd);
--
2.28.0