PartDesign: expose SubShapeBinderPython

This commit is contained in:
Zheng, Lei
2020-01-11 09:38:21 +08:00
committed by Chris Hennes
parent 8bb8bf8644
commit 73d0de60ae
6 changed files with 25 additions and 0 deletions

View File

@@ -123,6 +123,7 @@ PyMOD_INIT_FUNC(_PartDesign)
PartDesign::SubtractiveHelix ::init();
PartDesign::ShapeBinder ::init();
PartDesign::SubShapeBinder ::init();
PartDesign::SubShapeBinderPython ::init();
PartDesign::Plane ::init();
PartDesign::Line ::init();
PartDesign::Point ::init();

View File

@@ -907,3 +907,13 @@ void SubShapeBinder::handleChangedPropertyType(
}
}
////////////////////////////////////////////////////////////////////////////////////////
namespace App {
PROPERTY_SOURCE_TEMPLATE(PartDesign::SubShapeBinderPython, PartDesign::SubShapeBinder)
template<> const char* PartDesign::SubShapeBinderPython::getViewProviderName(void) const {
return "PartDesignGui::ViewProviderSubShapeBinderPython";
}
template class PartDesignExport FeaturePythonT<PartDesign::SubShapeBinder>;
}

View File

@@ -28,6 +28,7 @@
#include <boost_signals2.hpp>
#include <App/PropertyLinks.h>
#include <App/DocumentObserver.h>
#include <App/FeaturePython.h>
#include <Mod/Part/App/DatumFeature.h>
#include <Mod/PartDesign/PartDesignGlobal.h>
@@ -146,6 +147,8 @@ protected:
std::vector<App::DocumentObjectT> _CopiedObjs;
};
typedef App::FeaturePythonT<SubShapeBinder> SubShapeBinderPython;
} //namespace PartDesign

View File

@@ -152,6 +152,7 @@ PyMOD_INIT_FUNC(PartDesignGui)
PartDesignGui::ViewProviderDatumCoordinateSystem::init();
PartDesignGui::ViewProviderShapeBinder ::init();
PartDesignGui::ViewProviderSubShapeBinder::init();
PartDesignGui::ViewProviderSubShapeBinderPython::init();
PartDesignGui::ViewProviderBoolean ::init();
PartDesignGui::ViewProviderAddSub ::init();
PartDesignGui::ViewProviderPrimitive ::init();

View File

@@ -416,3 +416,10 @@ std::vector<App::DocumentObject*> ViewProviderSubShapeBinder::claimChildren(void
return ret;
}
////////////////////////////////////////////////////////////////////////////////////////
namespace Gui {
PROPERTY_SOURCE_TEMPLATE(PartDesignGui::ViewProviderSubShapeBinderPython,
PartDesignGui::ViewProviderSubShapeBinder)
template class PartDesignGuiExport ViewProviderPythonFeatureT<ViewProviderSubShapeBinder>;
}

View File

@@ -24,6 +24,7 @@
#ifndef PARTGUI_ViewProviderShapeBinder_H
#define PARTGUI_ViewProviderShapeBinder_H
#include <Gui/ViewProviderPythonFeature.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include <Mod/PartDesign/PartDesignGlobal.h>
@@ -84,6 +85,8 @@ private:
void updatePlacement(bool transaction);
};
typedef Gui::ViewProviderPythonFeatureT<ViewProviderSubShapeBinder> ViewProviderSubShapeBinderPython;
} // namespace PartDesignGui