AppDrawing.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU Library General Public License as       *
00005  *   published by the Free Software Foundation; either version 2 of the    *
00006  *   License, or (at your option) any later version.                       *
00007  *   for detail see the LICENCE text file.                                 *
00008  *   Jürgen Riegel 2007                                                    *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #include "PreCompiled.h"
00013 #ifndef _PreComp_
00014 # include <Python.h>
00015 #endif
00016 
00017 #include <Base/Console.h>
00018 #include <Base/Interpreter.h>
00019  
00020 #include "FeaturePage.h"
00021 #include "FeatureView.h"
00022 #include "FeatureViewPart.h"
00023 #include "FeatureProjection.h"
00024 #include "PageGroup.h"
00025 
00026 extern struct PyMethodDef Drawing_methods[];
00027 
00028 PyDoc_STRVAR(module_drawing_doc,
00029 "This module is the drawing module.");
00030 
00031 
00032 /* Python entry */
00033 extern "C" {
00034 void DrawingExport initDrawing()
00035 {
00036     // load dependent module
00037     try {
00038         Base::Interpreter().loadModule("Part");
00039         //Base::Interpreter().loadModule("Mesh");
00040     }
00041     catch(const Base::Exception& e) {
00042         PyErr_SetString(PyExc_ImportError, e.what());
00043         return;
00044     }
00045     Py_InitModule3("Drawing", Drawing_methods, module_drawing_doc);   /* mod name, table ptr */
00046     Base::Console().Log("Loading Drawing module... done\n");
00047 
00048 
00049     // NOTE: To finish the initialization of our own type objects we must
00050     // call PyType_Ready, otherwise we run into a segmentation fault, later on.
00051     // This function is responsible for adding inherited slots from a type's base class.
00052  
00053     Drawing::FeaturePage            ::init();
00054     Drawing::FeatureView            ::init();
00055     Drawing::FeatureViewPart        ::init();
00056     Drawing::PageGroup              ::init();
00057     Drawing::FeatureProjection      ::init();
00058     Drawing::FeatureViewPartPython  ::init();
00059     Drawing::FeatureViewPython      ::init();
00060 }
00061 
00062 } // extern "C"

Generated on Wed Nov 23 18:59:55 2011 for FreeCAD by  doxygen 1.6.1