| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #include <Base/Console.h>
|
| | #include <Base/Interpreter.h>
|
| | #include <Base/PyObjectBase.h>
|
| | #include <Gui/Application.h>
|
| | #include <Gui/Language/Translator.h>
|
| | #include <Mod/Points/App/PropertyPointKernel.h>
|
| |
|
| | #include "ViewProvider.h"
|
| | #include "Workbench.h"
|
| |
|
| |
|
| |
|
| | void CreatePointsCommands();
|
| |
|
| | void loadPointsResource()
|
| | {
|
| |
|
| | Q_INIT_RESOURCE(Points);
|
| | Q_INIT_RESOURCE(Points_translation);
|
| | Gui::Translator::instance()->refresh();
|
| | }
|
| |
|
| | namespace PointsGui
|
| | {
|
| | class Module: public Py::ExtensionModule<Module>
|
| | {
|
| | public:
|
| | Module()
|
| | : Py::ExtensionModule<Module>("PointsGui")
|
| | {
|
| | initialize("This module is the PointsGui module.");
|
| | }
|
| | };
|
| |
|
| | PyObject* initModule()
|
| | {
|
| | return Base::Interpreter().addModule(new Module);
|
| | }
|
| |
|
| | }
|
| |
|
| |
|
| |
|
| | PyMOD_INIT_FUNC(PointsGui)
|
| | {
|
| | if (!Gui::Application::Instance) {
|
| | PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
| | PyMOD_Return(nullptr);
|
| | }
|
| |
|
| |
|
| | try {
|
| | Base::Interpreter().loadModule("Points");
|
| | }
|
| | catch (const Base::Exception& e) {
|
| | PyErr_SetString(PyExc_ImportError, e.what());
|
| | PyMOD_Return(nullptr);
|
| | }
|
| |
|
| | Base::Console().log("Loading GUI of Points module… done\n");
|
| | PyObject* mod = PointsGui::initModule();
|
| |
|
| |
|
| | CreatePointsCommands();
|
| |
|
| |
|
| | PointsGui::ViewProviderPoints ::init();
|
| | PointsGui::ViewProviderScattered ::init();
|
| | PointsGui::ViewProviderStructured ::init();
|
| | PointsGui::ViewProviderPython ::init();
|
| | PointsGui::Workbench ::init();
|
| |
|
| | Gui::ViewProviderBuilder::add(
|
| | Points::PropertyPointKernel::getClassTypeId(),
|
| | PointsGui::ViewProviderPoints::getClassTypeId()
|
| | );
|
| |
|
| |
|
| | loadPointsResource();
|
| |
|
| | PyMOD_Return(mod);
|
| | }
|
| |
|