From 84798a6aa68b2282bb677b38fa7ca355a95d92c2 Mon Sep 17 00:00:00 2001 From: Shai Seger Date: Tue, 17 Oct 2017 22:18:30 +0300 Subject: [PATCH] Add generated PathSimulation Module --- src/Mod/Path/CMakeLists.txt | 1 + .../PathSimulator/App/AppPathSimulator.cpp | 68 +++++++++++++++++++ src/Mod/Path/PathSimulator/App/CMakeLists.txt | 32 +++++++++ .../Path/PathSimulator/App/PreCompiled.cpp | 24 +++++++ src/Mod/Path/PathSimulator/App/PreCompiled.h | 61 +++++++++++++++++ src/Mod/Path/PathSimulator/CMakeLists.txt | 13 ++++ src/Mod/Path/PathSimulator/PathSimulator.dox | 3 + 7 files changed, 202 insertions(+) create mode 100644 src/Mod/Path/PathSimulator/App/AppPathSimulator.cpp create mode 100644 src/Mod/Path/PathSimulator/App/CMakeLists.txt create mode 100644 src/Mod/Path/PathSimulator/App/PreCompiled.cpp create mode 100644 src/Mod/Path/PathSimulator/App/PreCompiled.h create mode 100644 src/Mod/Path/PathSimulator/CMakeLists.txt create mode 100644 src/Mod/Path/PathSimulator/PathSimulator.dox diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt index d6b3047518..67164ba86a 100644 --- a/src/Mod/Path/CMakeLists.txt +++ b/src/Mod/Path/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory(App) add_subdirectory(libarea) +add_subdirectory(PathSimulator) if(BUILD_GUI) add_subdirectory(Gui) diff --git a/src/Mod/Path/PathSimulator/App/AppPathSimulator.cpp b/src/Mod/Path/PathSimulator/App/AppPathSimulator.cpp new file mode 100644 index 0000000000..ef62700c77 --- /dev/null +++ b/src/Mod/Path/PathSimulator/App/AppPathSimulator.cpp @@ -0,0 +1,68 @@ +/*************************************************************************** + * Copyright (c) YEAR YOUR NAME * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" +#ifndef _PreComp_ +# include +#endif + +#include +#include + +#include +#include + + +namespace PathSimulator { +class Module : public Py::ExtensionModule +{ +public: + Module() : Py::ExtensionModule("PathSimulator") + { + initialize("This module is the PathSimulator module."); // register with Python + } + + virtual ~Module() {} + +private: +}; + +PyObject* initModule() +{ + return (new Module)->module().ptr(); +} + + +} // namespace PathSimulator + + +/* Python entry */ +PyMOD_INIT_FUNC(PathSimulator) +{ + // ADD YOUR CODE HERE + // + // + PyObject* mod = PathSimulator::initModule(); + Base::Console().Log("Loading PathSimulator module... done\n"); + PyMOD_Return(mod); +} diff --git a/src/Mod/Path/PathSimulator/App/CMakeLists.txt b/src/Mod/Path/PathSimulator/App/CMakeLists.txt new file mode 100644 index 0000000000..611a8d74e5 --- /dev/null +++ b/src/Mod/Path/PathSimulator/App/CMakeLists.txt @@ -0,0 +1,32 @@ + +include_directories( + ${Boost_INCLUDE_DIRS} + ${OCC_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} + ${XercesC_INCLUDE_DIRS} +) + +set(PathSimulator_LIBS + FreeCADApp +) + +SET(PathSimulator_SRCS + AppPathSimulator.cpp + PreCompiled.cpp + PreCompiled.h +) + +add_library(PathSimulator SHARED ${PathSimulator_SRCS}) +target_link_libraries(PathSimulator ${PathSimulator_LIBS}) + + +fc_target_copy_resource(PathSimulator + ${CMAKE_SOURCE_DIR}/src/Mod/PathSimulator + ${CMAKE_BINARY_DIR}/Mod/PathSimulator + Init.py) + +SET_BIN_DIR(PathSimulator PathSimulator /Mod/PathSimulator) +SET_PYTHON_PREFIX_SUFFIX(PathSimulator) + +install(TARGETS PathSimulator DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Mod/Path/PathSimulator/App/PreCompiled.cpp b/src/Mod/Path/PathSimulator/App/PreCompiled.cpp new file mode 100644 index 0000000000..59619b4a2a --- /dev/null +++ b/src/Mod/Path/PathSimulator/App/PreCompiled.cpp @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (c) YEAR YOUR NAME * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" diff --git a/src/Mod/Path/PathSimulator/App/PreCompiled.h b/src/Mod/Path/PathSimulator/App/PreCompiled.h new file mode 100644 index 0000000000..a27ee97cd3 --- /dev/null +++ b/src/Mod/Path/PathSimulator/App/PreCompiled.h @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (c) YEAR YOUR NAME * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef APP_PRECOMPILED_H +#define APP_PRECOMPILED_H + +#include + +// Exporting of App classes +#ifdef FC_OS_WIN32 +# define PathSimulatorAppExport __declspec(dllexport) +#else // for Linux +# define PathSimulatorAppExport +#endif + +#ifdef _PreComp_ + +// standard +#include +#include +#include + +// STL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Xerces +#include + +#endif //_PreComp_ + +#endif + diff --git a/src/Mod/Path/PathSimulator/CMakeLists.txt b/src/Mod/Path/PathSimulator/CMakeLists.txt new file mode 100644 index 0000000000..b0fed48a19 --- /dev/null +++ b/src/Mod/Path/PathSimulator/CMakeLists.txt @@ -0,0 +1,13 @@ + +add_subdirectory(App) +# if(BUILD_GUI) + # add_subdirectory(Gui) +# endif(BUILD_GUI) + +# install( + # FILES + # Init.py + # InitGui.py + # DESTINATION + # Mod/PathSimulator +# ) diff --git a/src/Mod/Path/PathSimulator/PathSimulator.dox b/src/Mod/Path/PathSimulator/PathSimulator.dox new file mode 100644 index 0000000000..065c59ef12 --- /dev/null +++ b/src/Mod/Path/PathSimulator/PathSimulator.dox @@ -0,0 +1,3 @@ +/** \defgroup TEMPLATE PathSimulator + * \ingroup WORKBENCHES */ +