AppImport.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   (c) Jürgen Riegel (juergen.riegel@web.de) 2002                        *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU Library General Public License (LGPL)   *
00008  *   as published by the Free Software Foundation; either version 2 of     *
00009  *   the License, or (at your option) any later version.                   *
00010  *   for detail see the LICENCE text file.                                 *
00011  *                                                                         *
00012  *   FreeCAD is distributed in the hope that it will be useful,            *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU Library General Public License for more details.                  *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU Library General Public     *
00018  *   License along with FreeCAD; if not, write to the Free Software        *
00019  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00020  *   USA                                                                   *
00021  *                                                                         *
00022  *   Juergen Riegel 2002                                                   *
00023  ***************************************************************************/
00024 
00025 
00026 #include "PreCompiled.h"
00027 #ifndef _PreComp_
00028 #       include <stdio.h>
00029 # if defined (_POSIX_C_SOURCE)
00030 #   undef  _POSIX_C_SOURCE
00031 # endif // (re-)defined in pyconfig.h
00032 #       include <Python.h>
00033 #endif
00034 
00035 #include <Base/Console.h>
00036 #include <Base/Interpreter.h>
00037 
00038 #include <App/Application.h>
00039 #include <Mod/Part/App/TopologyPy.h>
00040 
00041 #include "FeatureImportStep.h"
00042 #include "FeatureImportIges.h"
00043 
00044 
00045 /* registration table  */
00046 extern struct PyMethodDef Import_methods[];
00047 
00048 
00049 // python entry
00050 #ifdef FC_OS_WIN32
00051 #       define ModuleExport __declspec(dllexport)
00052 #else
00053 #       define ModuleExport
00054 #endif
00055 extern "C" {
00056 void ModuleExport initImport() {
00057 
00058         (void) Py_InitModule("Import", Import_methods);   /* mod name, table ptr */
00059 
00060   // load dependend module
00061   Base::Interpreter().loadModule("Part");
00062 
00063         App::AbstractFeatureFactory().AddProducer("ImportStep",new App::AbstractFeatureProducer<Import::FeatureImportStep>);
00064         App::AbstractFeatureFactory().AddProducer("ImportIges",new App::AbstractFeatureProducer<Import::FeatureImportIges>);
00065 
00066         Base::Console().Log("Import loaded\n");
00067 
00068         return;
00069 }
00070 
00071 
00072 } // extern "C" {

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