Add generated PathSimulation Module

This commit is contained in:
Shai Seger
2017-10-17 22:18:30 +03:00
committed by Yorik van Havre
parent eef61c54ff
commit 84798a6aa6
7 changed files with 202 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
add_subdirectory(App)
add_subdirectory(libarea)
add_subdirectory(PathSimulator)
if(BUILD_GUI)
add_subdirectory(Gui)

View File

@@ -0,0 +1,68 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* *
* 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 <Python.h>
#endif
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
namespace PathSimulator {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("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);
}

View File

@@ -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})

View File

@@ -0,0 +1,24 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* *
* 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"

View File

@@ -0,0 +1,61 @@
/***************************************************************************
* Copyright (c) YEAR YOUR NAME <Your e-mail address> *
* *
* 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 <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define PathSimulatorAppExport __declspec(dllexport)
#else // for Linux
# define PathSimulatorAppExport
#endif
#ifdef _PreComp_
// standard
#include <cstdio>
#include <cassert>
#include <iostream>
// STL
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
// Xerces
#include <xercesc/util/XercesDefs.hpp>
#endif //_PreComp_
#endif

View File

@@ -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
# )

View File

@@ -0,0 +1,3 @@
/** \defgroup TEMPLATE PathSimulator
* \ingroup WORKBENCHES */