AppMeshGui.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "PreCompiled.h"
00025 #ifndef _PreComp_
00026 #endif
00027
00028 #include <Base/Interpreter.h>
00029 #include <Base/Console.h>
00030
00031 #include <Gui/Application.h>
00032 #include <Gui/BitmapFactory.h>
00033 #include <Gui/WidgetFactory.h>
00034 #include <Gui/Language/Translator.h>
00035
00036 #include <Mod/Mesh/App/MeshProperties.h>
00037
00038 #include "images.h"
00039 #include "DlgEvaluateMeshImp.h"
00040 #include "PropertyEditorMesh.h"
00041 #include "DlgSettingsMeshView.h"
00042 #include "SoFCMeshObject.h"
00043 #include "SoFCIndexedFaceSet.h"
00044 #include "ViewProvider.h"
00045 #include "ViewProviderMeshFaceSet.h"
00046 #include "ViewProviderCurvature.h"
00047 #include "ViewProviderTransform.h"
00048 #include "ViewProviderTransformDemolding.h"
00049 #include "ViewProviderDefects.h"
00050 #include "ViewProviderPython.h"
00051 #include "Workbench.h"
00052 #include "qrc_Mesh.cpp"
00053
00054
00055
00056 void CreateMeshCommands(void);
00057
00058 void loadMeshResource()
00059 {
00060
00061 Q_INIT_RESOURCE(Mesh);
00062 Gui::Translator::instance()->refresh();
00063 }
00064
00065
00066 static struct PyMethodDef MeshGui_methods[] = {
00067 {NULL, NULL}
00068 };
00069
00070
00071 extern "C" {
00072 void MeshGuiExport initMeshGui()
00073 {
00074 if (!Gui::Application::Instance) {
00075 PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
00076 return;
00077 }
00078
00079
00080 try {
00081 Base::Interpreter().loadModule("Mesh");
00082 }
00083 catch(const Base::Exception& e) {
00084 PyErr_SetString(PyExc_ImportError, e.what());
00085 return;
00086 }
00087 (void) Py_InitModule("MeshGui", MeshGui_methods);
00088 Base::Console().Log("Loading GUI of Mesh module... done\n");
00089
00090
00091 Gui::BitmapFactory().addXPM("curv_info", curv_info);
00092 Gui::BitmapFactory().addXPM("import_mesh", import_mesh);
00093 Gui::BitmapFactory().addXPM("export_mesh", export_mesh);
00094 Gui::BitmapFactory().addXPM("solid_mesh", solid_mesh);
00095 Gui::BitmapFactory().addXPM("mesh_fillhole", mesh_fillhole);
00096 Gui::BitmapFactory().addXPM("mesh_pipette", mesh_pipette);
00097
00098
00099 CreateMeshCommands();
00100 (void)new MeshGui::CleanupHandler;
00101
00102
00103 (void)new Gui::PrefPageProducer<MeshGui::DlgSettingsMeshView> ("Display");
00104
00105 MeshGui::SoFCMeshObjectElement ::initClass();
00106 MeshGui::SoSFMeshObject ::initClass();
00107 MeshGui::SoFCMeshObjectNode ::initClass();
00108 MeshGui::SoFCMeshObjectShape ::initClass();
00109 MeshGui::SoFCMeshSegmentShape ::initClass();
00110 MeshGui::SoFCMeshObjectBoundary ::initClass();
00111 MeshGui::SoFCIndexedFaceSet ::initClass();
00112 MeshGui::SoFCMeshPickNode ::initClass();
00113 MeshGui::SoFCMeshGridNode ::initClass();
00114 MeshGui::PropertyMeshKernelItem ::init();
00115 MeshGui::ViewProviderMesh ::init();
00116 MeshGui::ViewProviderMeshObject ::init();
00117 MeshGui::ViewProviderIndexedFaceSet ::init();
00118 MeshGui::ViewProviderMeshFaceSet ::init();
00119 MeshGui::ViewProviderPython ::init();
00120 MeshGui::ViewProviderExport ::init();
00121 MeshGui::ViewProviderMeshCurvature ::init();
00122 MeshGui::ViewProviderMeshTransform ::init();
00123 MeshGui::ViewProviderMeshTransformDemolding ::init();
00124 MeshGui::ViewProviderMeshDefects ::init();
00125 MeshGui::ViewProviderMeshOrientation ::init();
00126 MeshGui::ViewProviderMeshNonManifolds ::init();
00127 MeshGui::ViewProviderMeshDuplicatedFaces ::init();
00128 MeshGui::ViewProviderMeshDuplicatedPoints ::init();
00129 MeshGui::ViewProviderMeshDegenerations ::init();
00130 MeshGui::ViewProviderMeshIndices ::init();
00131 MeshGui::ViewProviderMeshSelfIntersections ::init();
00132 MeshGui::ViewProviderMeshFolds ::init();
00133 MeshGui::Workbench ::init();
00134 Gui::ViewProviderBuilder::add(
00135 Mesh::PropertyMeshKernel::getClassTypeId(),
00136 MeshGui::ViewProviderMeshFaceSet::getClassTypeId());
00137
00138
00139 loadMeshResource();
00140 }
00141
00142 }