| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <Base/Console.h>
|
| | #include <Base/Interpreter.h>
|
| | #include <Base/PyObjectBase.h>
|
| | #include <Base/ServiceProvider.h>
|
| |
|
| | #include <Gui/Application.h>
|
| | #include <Gui/BitmapFactory.h>
|
| | #include <Gui/Dialogs/DlgPreferencesImp.h>
|
| | #include <Gui/WidgetFactory.h>
|
| | #include <Gui/Language/Translator.h>
|
| |
|
| | #include <Mod/Part/App/PreviewExtension.h>
|
| |
|
| | #include "AttacherTexts.h"
|
| | #include "PropertyEnumAttacherItem.h"
|
| | #include "DlgSettings3DViewPartImp.h"
|
| | #include "DlgSettingsGeneral.h"
|
| | #include "DlgSettingsObjectColor.h"
|
| | #include "PreviewUpdateScheduler.h"
|
| | #include "SoBrepEdgeSet.h"
|
| | #include "SoBrepFaceSet.h"
|
| | #include "SoBrepPointSet.h"
|
| | #include "SoFCShapeObject.h"
|
| | #include "ViewProvider.h"
|
| | #include "ViewProvider2DObject.h"
|
| | #include "ViewProviderAttachExtension.h"
|
| | #include "ViewProviderDatum.h"
|
| | #include "ViewProviderGridExtension.h"
|
| | #include "ViewProviderBoolean.h"
|
| | #include "ViewProviderBox.h"
|
| | #include "ViewProviderCircleParametric.h"
|
| | #include "ViewProviderCompound.h"
|
| | #include "ViewProviderConeParametric.h"
|
| | #include "ViewProviderCurveNet.h"
|
| | #include "ViewProviderCylinderParametric.h"
|
| | #include "ViewProviderEllipseParametric.h"
|
| | #include "ViewProviderExt.h"
|
| | #include "ViewProviderExtrusion.h"
|
| | #include "ViewProviderScale.h"
|
| | #include "ViewProviderHelixParametric.h"
|
| | #include "ViewProviderPrimitive.h"
|
| | #include "ViewProviderPython.h"
|
| | #include "ViewProviderImport.h"
|
| | #include "ViewProviderLineParametric.h"
|
| | #include "ViewProviderMirror.h"
|
| | #include "ViewProviderPlaneParametric.h"
|
| | #include "ViewProviderPointParametric.h"
|
| | #include "ViewProviderPreviewExtension.h"
|
| | #include "ViewProviderPrism.h"
|
| | #include "ViewProviderProjectOnSurface.h"
|
| | #include "ViewProviderRegularPolygon.h"
|
| | #include "ViewProviderRuledSurface.h"
|
| | #include "ViewProviderSphereParametric.h"
|
| | #include "ViewProviderSpline.h"
|
| | #include "ViewProviderTorusParametric.h"
|
| | #include "Workbench.h"
|
| | #include "WorkbenchManipulator.h"
|
| |
|
| |
|
| |
|
| | void CreatePartCommands();
|
| | void CreateSimplePartCommands();
|
| | void CreateParamPartCommands();
|
| | void CreatePartSelectCommands();
|
| |
|
| | void loadPartResource()
|
| | {
|
| |
|
| | Q_INIT_RESOURCE(Part);
|
| | Q_INIT_RESOURCE(Part_translation);
|
| | Gui::Translator::instance()->refresh();
|
| | }
|
| |
|
| | namespace PartGui
|
| | {
|
| | class Module: public Py::ExtensionModule<Module>
|
| | {
|
| | public:
|
| | Module()
|
| | : Py::ExtensionModule<Module>("PartGui")
|
| | {
|
| | initialize("This module is the PartGui module.");
|
| | }
|
| |
|
| | private:
|
| | };
|
| |
|
| | PyObject* initModule()
|
| | {
|
| | return Base::Interpreter().addModule(new Module);
|
| | }
|
| |
|
| | }
|
| |
|
| | PyMOD_INIT_FUNC(PartGui)
|
| | {
|
| | if (!Gui::Application::Instance) {
|
| | PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
| | PyMOD_Return(nullptr);
|
| | }
|
| |
|
| |
|
| | try {
|
| | Base::Interpreter().runString("import Part");
|
| | Base::Interpreter().runString("import MatGui");
|
| | }
|
| | catch (const Base::Exception& e) {
|
| | PyErr_SetString(PyExc_ImportError, e.what());
|
| | PyMOD_Return(nullptr);
|
| | }
|
| |
|
| | PyObject* partGuiModule = PartGui::initModule();
|
| |
|
| | Base::Console().log("Loading GUI of Part module… done\n");
|
| |
|
| | Gui::BitmapFactory().addPath(QStringLiteral(":/icons/booleans"));
|
| | Gui::BitmapFactory().addPath(QStringLiteral(":/icons/create"));
|
| | Gui::BitmapFactory().addPath(QStringLiteral(":/icons/parametric"));
|
| | Gui::BitmapFactory().addPath(QStringLiteral(":/icons/tools"));
|
| |
|
| |
|
| | static struct PyModuleDef pAttachEngineTextsModuleDef = {
|
| | PyModuleDef_HEAD_INIT,
|
| | "AttachEngineResources",
|
| | "AttachEngineResources",
|
| | -1,
|
| | AttacherGui::AttacherGuiPy::Methods,
|
| | nullptr, nullptr, nullptr, nullptr
|
| | };
|
| |
|
| |
|
| | PyObject* pAttachEngineTextsModule = PyModule_Create(&pAttachEngineTextsModuleDef);
|
| |
|
| | Py_INCREF(pAttachEngineTextsModule);
|
| | PyModule_AddObject(partGuiModule, "AttachEngineResources", pAttachEngineTextsModule);
|
| |
|
| |
|
| | PartGui::PropertyEnumAttacherItem ::init();
|
| | PartGui::SoBrepFaceSet ::initClass();
|
| | PartGui::SoBrepEdgeSet ::initClass();
|
| | PartGui::SoBrepPointSet ::initClass();
|
| | PartGui::SoFCControlPoints ::initClass();
|
| | PartGui::SoFCShape ::initClass();
|
| | PartGui::SoPreviewShape ::initClass();
|
| | PartGui::ViewProviderAttachExtension ::init();
|
| | PartGui::ViewProviderAttachExtensionPython ::init();
|
| | PartGui::ViewProviderGridExtension ::init();
|
| | PartGui::ViewProviderGridExtensionPython ::init();
|
| | PartGui::ViewProviderPreviewExtension ::init();
|
| | PartGui::ViewProviderPreviewExtensionPython ::init();
|
| | PartGui::ViewProviderSplineExtension ::init();
|
| | PartGui::ViewProviderSplineExtensionPython ::init();
|
| | PartGui::ViewProviderLine ::init();
|
| | PartGui::ViewProviderPlane ::init();
|
| | PartGui::ViewProviderPoint ::init();
|
| | PartGui::ViewProviderLCS ::init();
|
| | PartGui::ViewProviderPartExt ::init();
|
| | PartGui::ViewProviderPart ::init();
|
| | PartGui::ViewProviderPrimitive ::init();
|
| | PartGui::ViewProviderEllipsoid ::init();
|
| | PartGui::ViewProviderPython ::init();
|
| | PartGui::ViewProviderBox ::init();
|
| | PartGui::ViewProviderPrism ::init();
|
| | PartGui::ViewProviderRegularPolygon ::init();
|
| | PartGui::ViewProviderWedge ::init();
|
| | PartGui::ViewProviderImport ::init();
|
| | PartGui::ViewProviderCurveNet ::init();
|
| | PartGui::ViewProviderExtrusion ::init();
|
| | PartGui::ViewProviderScale ::init();
|
| | PartGui::ViewProvider2DObject ::init();
|
| | PartGui::ViewProvider2DObjectPython ::init();
|
| | PartGui::ViewProvider2DObjectGrid ::init();
|
| | PartGui::ViewProviderMirror ::init();
|
| | PartGui::ViewProviderFillet ::init();
|
| | PartGui::ViewProviderChamfer ::init();
|
| | PartGui::ViewProviderRevolution ::init();
|
| | PartGui::ViewProviderLoft ::init();
|
| | PartGui::ViewProviderSweep ::init();
|
| | PartGui::ViewProviderOffset ::init();
|
| | PartGui::ViewProviderOffset2D ::init();
|
| | PartGui::ViewProviderThickness ::init();
|
| | PartGui::ViewProviderRefine ::init();
|
| | PartGui::ViewProviderReverse ::init();
|
| | PartGui::ViewProviderCustom ::init();
|
| | PartGui::ViewProviderCustomPython ::init();
|
| | PartGui::ViewProviderBoolean ::init();
|
| | PartGui::ViewProviderMultiFuse ::init();
|
| | PartGui::ViewProviderMultiCommon ::init();
|
| | PartGui::ViewProviderCompound ::init();
|
| | PartGui::ViewProviderSpline ::init();
|
| | PartGui::ViewProviderCircleParametric ::init();
|
| | PartGui::ViewProviderLineParametric ::init();
|
| | PartGui::ViewProviderPointParametric ::init();
|
| | PartGui::ViewProviderEllipseParametric ::init();
|
| | PartGui::ViewProviderHelixParametric ::init();
|
| | PartGui::ViewProviderSpiralParametric ::init();
|
| | PartGui::ViewProviderPlaneParametric ::init();
|
| | PartGui::ViewProviderSphereParametric ::init();
|
| | PartGui::ViewProviderCylinderParametric ::init();
|
| | PartGui::ViewProviderConeParametric ::init();
|
| | PartGui::ViewProviderTorusParametric ::init();
|
| | PartGui::ViewProviderRuledSurface ::init();
|
| | PartGui::ViewProviderFace ::init();
|
| | PartGui::ViewProviderProjectOnSurface ::init();
|
| |
|
| | PartGui::Workbench ::init();
|
| | auto manip = std::make_shared<PartGui::WorkbenchManipulator>();
|
| | Gui::WorkbenchManipulator::installManipulator(manip);
|
| |
|
| | Base::registerServiceImplementation<Part::PreviewUpdateScheduler>(new PartGui::QtPreviewUpdateScheduler);
|
| |
|
| |
|
| | CreatePartCommands();
|
| | CreateSimplePartCommands();
|
| | CreateParamPartCommands();
|
| | CreatePartSelectCommands();
|
| | try {
|
| | const char* cmd = "__import__('AttachmentEditor.Commands').Commands";
|
| | Py::Object ae = Base::Interpreter().runStringObject(cmd);
|
| | Py::Module(partGuiModule).setAttr(std::string("AttachmentEditor"), ae);
|
| | }
|
| | catch (Base::PyException& err) {
|
| | err.reportException();
|
| | }
|
| |
|
| |
|
| | Gui::Dialog::DlgPreferencesImp::setGroupData("Part/Part Design", "Part design", QObject::tr("Part and Part Design workbench"));
|
| | (void)new Gui::PrefPageProducer<PartGui::DlgSettingsGeneral>(QT_TRANSLATE_NOOP("QObject", "Part/Part Design"));
|
| | (void)new Gui::PrefPageProducer<PartGui::DlgSettings3DViewPart>(QT_TRANSLATE_NOOP("QObject", "Part/Part Design"));
|
| | (void)new Gui::PrefPageProducer<PartGui::DlgSettingsObjectColor>(QT_TRANSLATE_NOOP("QObject", "Part/Part Design"));
|
| | (void)new Gui::PrefPageProducer<PartGui::DlgImportExportIges>(QT_TRANSLATE_NOOP("QObject", "Import-Export"));
|
| | (void)new Gui::PrefPageProducer<PartGui::DlgImportExportStep>(QT_TRANSLATE_NOOP("QObject", "Import-Export"));
|
| | Gui::ViewProviderBuilder::add(Part::PropertyPartShape::getClassTypeId(),
|
| | PartGui::ViewProviderPart::getClassTypeId());
|
| |
|
| |
|
| |
|
| | loadPartResource();
|
| |
|
| | PyMOD_Return(partGuiModule);
|
| | }
|
| |
|