Merge remote-tracking branch 'refs/remotes/origin/jriegel/NewWinBuild' into jriegel/Rift
This commit is contained in:
commit
889e7bbdce
254
CMakeLists.txt
254
CMakeLists.txt
|
@ -113,181 +113,181 @@ endif(MSVC)
|
|||
# ==============================================================================
|
||||
# == All the options for the build process ============
|
||||
|
||||
OPTION(FREECAD_BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON)
|
||||
OPTION(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON)
|
||||
OPTION(FREECAD_MAINTAINERS_BUILD "Build FreeCAD for Maintainers, with Docu and 3rd party libs. On Windows the Installer is build." OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF)
|
||||
OPTION(FREECAD_USE_EXTERNAL_PIVY "Use system installed python-pivy instead of the bundled." OFF)
|
||||
OPTION(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
|
||||
OPTION(BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
|
||||
|
||||
OPTION(FREECAD_BUILD_CAM "Build the FreeCAD CAM module and the needed libs, be aware, unfinished code!" OFF)
|
||||
OPTION(FREECAD_BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON)
|
||||
OPTION(FREECAD_BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF)
|
||||
OPTION(FREECAD_BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF)
|
||||
OPTION(FREECAD_BUILD_ARCH "Build the FreeCAD Architecture module" ON)
|
||||
OPTION(FREECAD_BUILD_ASSEMBLY "Build the FreeCAD Assembly module" ON)
|
||||
OPTION(FREECAD_BUILD_COMPLETE "Build the FreeCAD complete module" ON)
|
||||
OPTION(FREECAD_BUILD_DRAFT "Build the FreeCAD draft module" ON)
|
||||
OPTION(FREECAD_BUILD_DRAWING "Build the FreeCAD drawing module" ON)
|
||||
OPTION(FREECAD_BUILD_IDF "Build the FreeCAD idf module" ON)
|
||||
OPTION(FREECAD_BUILD_IMAGE "Build the FreeCAD image module" ON)
|
||||
OPTION(FREECAD_BUILD_IMPORT "Build the FreeCAD import module" ON)
|
||||
OPTION(FREECAD_BUILD_INSPECTION "Build the FreeCAD inspection module" ON)
|
||||
OPTION(FREECAD_BUILD_JTREADER "Build the FreeCAD jt reader module" OFF)
|
||||
OPTION(FREECAD_BUILD_MATERIAL "Build the FreeCAD material module" ON)
|
||||
OPTION(FREECAD_BUILD_MESH "Build the FreeCAD mesh module" ON)
|
||||
OPTION(FREECAD_BUILD_MESH_PART "Build the FreeCAD mesh part module" ON)
|
||||
OPTION(FREECAD_BUILD_OPENSCAD "Build the FreeCAD openscad module" ON)
|
||||
OPTION(FREECAD_BUILD_PART "Build the FreeCAD part module" ON)
|
||||
OPTION(FREECAD_BUILD_PART_DESIGN "Build the FreeCAD part design module" ON)
|
||||
OPTION(FREECAD_BUILD_PLOT "Build the FreeCAD plot module" ON)
|
||||
OPTION(FREECAD_BUILD_POINTS "Build the FreeCAD points module" ON)
|
||||
OPTION(FREECAD_BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON)
|
||||
OPTION(FREECAD_BUILD_REVERSEENGINEERING "Build the FreeCAD reverse engineering module" ON)
|
||||
OPTION(FREECAD_BUILD_ROBOT "Build the FreeCAD robot module" ON)
|
||||
OPTION(FREECAD_BUILD_SHIP "Build the FreeCAD ship module" ON)
|
||||
OPTION(FREECAD_BUILD_SKETCHER "Build the FreeCAD sketcher module" ON)
|
||||
OPTION(FREECAD_BUILD_SPREADSHEET "Build the FreeCAD spreadsheet module" ON)
|
||||
OPTION(FREECAD_BUILD_START "Build the FreeCAD start module" ON)
|
||||
OPTION(FREECAD_BUILD_TEST "Build the FreeCAD test module" ON)
|
||||
OPTION(FREECAD_BUILD_WEB "Build the FreeCAD web module" ON)
|
||||
OPTION(BUILD_CAM "Build the FreeCAD CAM module and the needed libs, be aware, unfinished code!" OFF)
|
||||
OPTION(BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON)
|
||||
OPTION(BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF)
|
||||
OPTION(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF)
|
||||
OPTION(BUILD_ARCH "Build the FreeCAD Architecture module" ON)
|
||||
OPTION(BUILD_ASSEMBLY "Build the FreeCAD Assembly module" ON)
|
||||
OPTION(BUILD_COMPLETE "Build the FreeCAD complete module" ON)
|
||||
OPTION(BUILD_DRAFT "Build the FreeCAD draft module" ON)
|
||||
OPTION(BUILD_DRAWING "Build the FreeCAD drawing module" ON)
|
||||
OPTION(BUILD_IDF "Build the FreeCAD idf module" ON)
|
||||
OPTION(BUILD_IMAGE "Build the FreeCAD image module" ON)
|
||||
OPTION(BUILD_IMPORT "Build the FreeCAD import module" ON)
|
||||
OPTION(BUILD_INSPECTION "Build the FreeCAD inspection module" ON)
|
||||
OPTION(BUILD_JTREADER "Build the FreeCAD jt reader module" OFF)
|
||||
OPTION(BUILD_MATERIAL "Build the FreeCAD material module" ON)
|
||||
OPTION(BUILD_MESH "Build the FreeCAD mesh module" ON)
|
||||
OPTION(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON)
|
||||
OPTION(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON)
|
||||
OPTION(BUILD_PART "Build the FreeCAD part module" ON)
|
||||
OPTION(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON)
|
||||
OPTION(BUILD_PLOT "Build the FreeCAD plot module" ON)
|
||||
OPTION(BUILD_POINTS "Build the FreeCAD points module" ON)
|
||||
OPTION(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON)
|
||||
OPTION(BUILD_REVERSEENGINEERING "Build the FreeCAD reverse engineering module" ON)
|
||||
OPTION(BUILD_ROBOT "Build the FreeCAD robot module" ON)
|
||||
OPTION(BUILD_SHIP "Build the FreeCAD ship module" ON)
|
||||
OPTION(BUILD_SKETCHER "Build the FreeCAD sketcher module" ON)
|
||||
OPTION(BUILD_SPREADSHEET "Build the FreeCAD spreadsheet module" ON)
|
||||
OPTION(BUILD_START "Build the FreeCAD start module" ON)
|
||||
OPTION(BUILD_TEST "Build the FreeCAD test module" ON)
|
||||
OPTION(BUILD_WEB "Build the FreeCAD web module" ON)
|
||||
|
||||
if(MSVC)
|
||||
OPTION(FREECAD_USE_3DCONNEXION "Use the 3D connexion SDK to support 3d mouse." ON)
|
||||
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" OFF)
|
||||
OPTION(FREECAD_BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
else(MSVC)
|
||||
set(FREECAD_USE_3DCONNEXION OFF)
|
||||
OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON)
|
||||
OPTION(FREECAD_BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
|
||||
OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
|
||||
endif(MSVC)
|
||||
|
||||
# if this is set override some options
|
||||
if (FREECAD_BUILD_DEBIAN)
|
||||
if (BUILD_DEBIAN)
|
||||
set(FREECAD_USE_EXTERNAL_ZIPIOS ON)
|
||||
set(FREECAD_USE_EXTERNAL_PIVY ON)
|
||||
endif (FREECAD_BUILD_DEBIAN)
|
||||
endif (BUILD_DEBIAN)
|
||||
|
||||
# ==============================================================================
|
||||
#inter-module dependencies
|
||||
|
||||
#took these from Mod/Complete/App/AppComplete.cpp. appears to be working.
|
||||
if(FREECAD_BUILD_COMPLETE)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
set(FREECAD_BUILD_POINTS ON)
|
||||
set(FREECAD_BUILD_DRAWING ON)
|
||||
set(FREECAD_BUILD_RAYTRACING ON)
|
||||
set(FREECAD_BUILD_PART_DESIGN ON)
|
||||
set(FREECAD_BUILD_IMAGE ON)
|
||||
set(FREECAD_BUILD_DRAFT ON)
|
||||
endif(FREECAD_BUILD_COMPLETE)
|
||||
if(BUILD_COMPLETE)
|
||||
set(BUILD_MESH ON)
|
||||
set(BUILD_POINTS ON)
|
||||
set(BUILD_DRAWING ON)
|
||||
set(BUILD_RAYTRACING ON)
|
||||
set(BUILD_PART_DESIGN ON)
|
||||
set(BUILD_IMAGE ON)
|
||||
set(BUILD_DRAFT ON)
|
||||
endif(BUILD_COMPLETE)
|
||||
|
||||
#inferred from .py files. appears to be working.
|
||||
if(FREECAD_BUILD_ARCH)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
set(FREECAD_BUILD_DRAFT ON)
|
||||
endif(FREECAD_BUILD_ARCH)
|
||||
if(BUILD_ARCH)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_MESH ON)
|
||||
set(BUILD_DRAFT ON)
|
||||
endif(BUILD_ARCH)
|
||||
|
||||
#inferred from .py files. appears to be working.
|
||||
if(FREECAD_BUILD_OPENSCAD)
|
||||
set(FREECAD_BUILD_MESH_PART ON)
|
||||
set(FREECAD_BUILD_DRAFT ON)
|
||||
endif(FREECAD_BUILD_OPENSCAD)
|
||||
if(BUILD_OPENSCAD)
|
||||
set(BUILD_MESH_PART ON)
|
||||
set(BUILD_DRAFT ON)
|
||||
endif(BUILD_OPENSCAD)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_INSPECTION)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
set(FREECAD_BUILD_POINTS ON)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_INSPECTION)
|
||||
if(BUILD_INSPECTION)
|
||||
set(BUILD_MESH ON)
|
||||
set(BUILD_POINTS ON)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_INSPECTION)
|
||||
|
||||
#inferred from .py files. appears to be working.
|
||||
if(FREECAD_BUILD_SHIP)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_PLOT ON)
|
||||
set(FREECAD_BUILD_IMAGE ON)
|
||||
endif(FREECAD_BUILD_SHIP)
|
||||
if(BUILD_SHIP)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_PLOT ON)
|
||||
set(BUILD_IMAGE ON)
|
||||
endif(BUILD_SHIP)
|
||||
|
||||
#inferred from .py files. appears to be working.
|
||||
if(FREECAD_BUILD_SPREADSHEET)
|
||||
set(FREECAD_BUILD_DRAFT ON)
|
||||
endif(FREECAD_BUILD_SPREADSHEET)
|
||||
if(BUILD_SPREADSHEET)
|
||||
set(BUILD_DRAFT ON)
|
||||
endif(BUILD_SPREADSHEET)
|
||||
|
||||
#this has been tested. appears to be working.
|
||||
if(FREECAD_BUILD_DRAFT)
|
||||
set(FREECAD_BUILD_SKETCHER ON)
|
||||
endif(FREECAD_BUILD_DRAFT)
|
||||
if(BUILD_DRAFT)
|
||||
set(BUILD_SKETCHER ON)
|
||||
endif(BUILD_DRAFT)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_PART_DESIGN)
|
||||
set(FREECAD_BUILD_SKETCHER ON)
|
||||
endif(FREECAD_BUILD_PART_DESIGN)
|
||||
if(BUILD_PART_DESIGN)
|
||||
set(BUILD_SKETCHER ON)
|
||||
endif(BUILD_PART_DESIGN)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_REVERSEENGINEERING)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
endif(FREECAD_BUILD_REVERSEENGINEERING)
|
||||
if(BUILD_REVERSEENGINEERING)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_MESH ON)
|
||||
endif(BUILD_REVERSEENGINEERING)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_MESH_PART)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
set(FREECAD_BUILD_SMESH ON)
|
||||
endif(FREECAD_BUILD_MESH_PART)
|
||||
if(BUILD_MESH_PART)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_MESH ON)
|
||||
set(BUILD_SMESH ON)
|
||||
endif(BUILD_MESH_PART)
|
||||
|
||||
#inferred from cmakelists.txt. build errors. obsolete?
|
||||
if(FREECAD_BUILD_CAM)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
endif(FREECAD_BUILD_CAM)
|
||||
if(BUILD_CAM)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_MESH ON)
|
||||
endif(BUILD_CAM)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_RAYTRACING)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_RAYTRACING)
|
||||
if(BUILD_RAYTRACING)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_RAYTRACING)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_DRAWING)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_DRAWING)
|
||||
if(BUILD_DRAWING)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_DRAWING)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_ROBOT)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_ROBOT)
|
||||
if(BUILD_ROBOT)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_ROBOT)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_SKETCHER)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_SKETCHER)
|
||||
if(BUILD_SKETCHER)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_SKETCHER)
|
||||
|
||||
#inferred from .py files. built, but not sure how to test.
|
||||
if(FREECAD_BUILD_IDF)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_IDF)
|
||||
if(BUILD_IDF)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_IDF)
|
||||
|
||||
#inferred from cmakelists.txt. built, but not sure how to test.
|
||||
if(FREECAD_BUILD_IMPORT)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
endif(FREECAD_BUILD_IMPORT)
|
||||
if(BUILD_IMPORT)
|
||||
set(BUILD_PART ON)
|
||||
endif(BUILD_IMPORT)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_FEM)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_SMESH ON)
|
||||
endif(FREECAD_BUILD_FEM)
|
||||
if(BUILD_FEM)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_SMESH ON)
|
||||
endif(BUILD_FEM)
|
||||
|
||||
#inferred from cmakelists.txt. appears to be working.
|
||||
if(FREECAD_BUILD_SANDBOX)
|
||||
set(FREECAD_BUILD_PART ON)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
endif(FREECAD_BUILD_SANDBOX)
|
||||
if(BUILD_SANDBOX)
|
||||
set(BUILD_PART ON)
|
||||
set(BUILD_MESH ON)
|
||||
endif(BUILD_SANDBOX)
|
||||
|
||||
#inferred from header includes. not tested.
|
||||
if(FREECAD_BUILD_JTREADER)
|
||||
set(FREECAD_BUILD_MESH ON)
|
||||
endif(FREECAD_BUILD_JTREADER)
|
||||
if(BUILD_JTREADER)
|
||||
set(BUILD_MESH ON)
|
||||
endif(BUILD_JTREADER)
|
||||
|
||||
#leaving test module for someone else.
|
||||
#image has none. as far as I can tell.
|
||||
|
@ -309,6 +309,7 @@ if(FREECAD_LIBPACK_USE)
|
|||
find_file(FREECAD_LIBPACK_CHECKFILE7X boost_program_options-vc90-mt-gd-1_39.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKFILE8X boost_program_options-vc90-mt-gd-1_48.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKFILE9X boost_program_options-vc90-mt-gd-1_54.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKFILE10X boost_program_options-vc110-mt-1_55.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
find_file(FREECAD_LIBPACK_CHECKCUSTOM boost_program_options-vc90-mt-gd-1_41.lib ${FREECAD_LIBPACK_DIR}/lib )
|
||||
|
||||
# don't show them in the GUI
|
||||
|
@ -316,6 +317,7 @@ if(FREECAD_LIBPACK_USE)
|
|||
set(FREECAD_LIBPACK_CHECKFILE7X "${FREECAD_LIBPACK_CHECKFILE7X}" CACHE INTERNAL "Find libpack")
|
||||
set(FREECAD_LIBPACK_CHECKFILE8X "${FREECAD_LIBPACK_CHECKFILE8X}" CACHE INTERNAL "Find libpack")
|
||||
set(FREECAD_LIBPACK_CHECKFILE9X "${FREECAD_LIBPACK_CHECKFILE9X}" CACHE INTERNAL "Find libpack")
|
||||
set(FREECAD_LIBPACK_CHECKFILE10X "${FREECAD_LIBPACK_CHECKFILE10X}" CACHE INTERNAL "Find libpack")
|
||||
set(FREECAD_LIBPACK_CHECKCUSTOM "${FREECAD_LIBPACK_CHECKCUSTOM}" CACHE INTERNAL "Find libpack")
|
||||
|
||||
IF(FREECAD_LIBPACK_CHECKFILE6X)
|
||||
|
@ -340,6 +342,10 @@ if(FREECAD_LIBPACK_USE)
|
|||
file(GLOB FREECAD_LIBPACK_PYSIDE "${FREECAD_LIBPACK_DIR}/pyside/lib/site-packages/PySide/*.py*")
|
||||
file(GLOB_RECURSE FREECAD_LIBPACK_PYSIDEUIC RELATIVE "${FREECAD_LIBPACK_PYSIDEUIC_REL}" "${FREECAD_LIBPACK_PYSIDEUIC_REL}/pysideuic/*.py")
|
||||
file(GLOB FREECAD_LIBPACK_PYTHON "${FREECAD_LIBPACK_DIR}/bin/*.py*")
|
||||
ELSEIF(FREECAD_LIBPACK_CHECKFILE10X)
|
||||
set(FREECAD_LIBPACK_VERSION "10.x" CACHE STRING "Displays if the libpack has been found" FORCE)
|
||||
include(cMake/UseLibPack10x.cmake)
|
||||
set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-3.0.2/swig.exe CACHE STRING "Swig" FORCE)
|
||||
ELSEIF(FREECAD_LIBPACK_CHECKCUSTOM)
|
||||
set(FREECAD_LIBPACK_VERSION "Custom" CACHE STRING "Displays if the libpack has been found" FORCE)
|
||||
include(cMake/UseLibPackCustom.cmake)
|
||||
|
@ -494,9 +500,9 @@ else(FREECAD_LIBPACK_USE)
|
|||
|
||||
# -------------------------------- Netgen --------------------------------
|
||||
|
||||
if (FREECAD_BUILD_FEM_NETGEN)
|
||||
if (BUILD_FEM_NETGEN)
|
||||
find_package(NETGEN)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
# -------------------------------- OpenCV --------------------------------
|
||||
|
||||
|
@ -515,6 +521,10 @@ else(FREECAD_LIBPACK_USE)
|
|||
|
||||
find_package(Eigen3)
|
||||
|
||||
# -------------------------------- pcl ----------------------------------
|
||||
|
||||
find_package(PCL COMPONENTS common kdtree features surface)
|
||||
|
||||
# -------------------------------- ODE ----------------------------------
|
||||
|
||||
# find_package(ODE)
|
||||
|
@ -526,12 +536,12 @@ else(FREECAD_LIBPACK_USE)
|
|||
SET(QT_MIN_VERSION 4.5.0)
|
||||
set(QT_USE_QTNETWORK TRUE)
|
||||
set(QT_USE_QTXML TRUE)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
set(QT_USE_QTOPENGL TRUE)
|
||||
set(QT_USE_QTSVG TRUE)
|
||||
set(QT_USE_QTUITOOLS TRUE)
|
||||
set(QT_USE_QTWEBKIT TRUE)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
find_package(Qt4 REQUIRED)
|
||||
|
||||
include(${QT_USE_FILE})
|
||||
|
@ -577,7 +587,7 @@ else(FREECAD_LIBPACK_USE)
|
|||
|
||||
#---------------------------------------------------
|
||||
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
# -------------------------------- OpenGL --------------------------------
|
||||
|
||||
find_package(OpenGL)
|
||||
|
@ -623,7 +633,7 @@ else(FREECAD_LIBPACK_USE)
|
|||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
|
||||
endif(FREECAD_LIBPACK_USE)
|
||||
|
|
511
cMake/UseLibPack10x.cmake
Normal file
511
cMake/UseLibPack10x.cmake
Normal file
|
@ -0,0 +1,511 @@
|
|||
# ================================================================================
|
||||
# == Win32 is default behaviour use the LibPack copied in Source tree ============
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# General includes
|
||||
|
||||
link_directories(${FREECAD_LIBPACK_DIR}/lib)
|
||||
include_directories(${FREECAD_LIBPACK_DIR}/include)
|
||||
|
||||
# OpenGL
|
||||
set(OPENGL_gl_LIBRARY opengl32 glu32)
|
||||
|
||||
# Python
|
||||
set(PYTHON_DEBUG_LIBRARY python27_d.lib)
|
||||
set(PYTHON_LIBRARY python27.lib)
|
||||
set(PYTHON_INCLUDE_PATH ${FREECAD_LIBPACK_DIR}/include/Python-2.7.5)
|
||||
set(PYTHON_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/python.exe)
|
||||
set(PYTHONLIBS_FOUND TRUE)
|
||||
|
||||
# XercesC
|
||||
set(XERCESC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/xerces-c-3.1.1)
|
||||
set(XERCESC_LIBRARIES xerces-c_3.lib)
|
||||
set(XERCESC_DEBUG_LIBRARIES xerces-c_3D.lib)
|
||||
set(XERCESC_FOUND TRUE)
|
||||
|
||||
# Boost
|
||||
set(Boost_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/boost-1_55)
|
||||
set(Boost_LIBRARIES
|
||||
optimized boost_filesystem-vc110-mt-1_55.lib
|
||||
optimized boost_system-vc110-mt-1_55.lib
|
||||
optimized boost_graph-vc110-mt-1_55.lib
|
||||
optimized boost_program_options-vc110-mt-1_55.lib
|
||||
optimized boost_regex-vc110-mt-1_55.lib
|
||||
optimized boost_signals-vc110-mt-1_55.lib
|
||||
optimized boost_thread-vc110-mt-1_55.lib
|
||||
)
|
||||
set(Boost_DEBUG_LIBRARIES
|
||||
debug boost_filesystem-vc110-mt-gd-1_55.lib
|
||||
debug boost_system-vc110-mt-gd-1_55.lib
|
||||
debug boost_graph-vc110-mt-gd-1_55.lib
|
||||
debug boost_program_options-vc110-mt-gd-1_55.lib
|
||||
debug boost_regex-vc110-mt-gd-1_55.lib
|
||||
debug boost_signals-vc110-mt-gd-1_55.lib
|
||||
debug boost_thread-vc110-mt-gd-1_55.lib
|
||||
)
|
||||
set(Boost_FOUND TRUE)
|
||||
|
||||
# Zlib
|
||||
set(ZLIB_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/zlib-1.2.7)
|
||||
set(ZLIB_LIBRARIES zlib.lib)
|
||||
set(ZLIB_FOUND TRUE)
|
||||
|
||||
# SMESH
|
||||
#set(SMESH_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/smesh)
|
||||
#set(SMESH_LIBRARIES
|
||||
# StdMeshers.lib
|
||||
# MEFISTO2.lib
|
||||
# SMESH.lib
|
||||
# DriverUNV.lib
|
||||
# SMESHDS.lib
|
||||
# DriverSTL.lib
|
||||
# DriverDAT.lib
|
||||
# Driver.lib
|
||||
# SMDS.lib
|
||||
#)
|
||||
|
||||
set(SMESH_FOUND TRUE)
|
||||
|
||||
# Coin3D
|
||||
|
||||
find_path(COIN3D_INCLUDE_DIR Inventor/So.h
|
||||
${FREECAD_LIBPACK_DIR}/include/Coin-4.0.0
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin4
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin4d
|
||||
"${FREECAD_LIBPACK_DIR}/lib"
|
||||
)
|
||||
|
||||
set(COIN3D_FOUND TRUE)
|
||||
|
||||
|
||||
# QT
|
||||
set(QT_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/Qt
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtCore
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtGui
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtDesigner
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtSvg
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtNetwork
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtSql
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtTest
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtUiTools
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtXml
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtOpenGl
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtWebKit
|
||||
)
|
||||
|
||||
set(QT_QTCORE_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/QtCore
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_INCLUDE_DIR
|
||||
${FREECAD_LIBPACK_DIR}/include/Qt-4.8.6/Qt3Support
|
||||
)
|
||||
|
||||
set(QT_LIBRARIES
|
||||
optimized QtCore4.lib
|
||||
optimized QtGui4.lib
|
||||
optimized QtDesigner4.lib
|
||||
optimized QtSvg4.lib
|
||||
optimized QtNetwork4.lib
|
||||
optimized QtSql4.lib
|
||||
optimized QtTest4.lib
|
||||
optimized QtXml4.lib
|
||||
optimized QtOpenGl4.lib
|
||||
optimized QtWebKit4.lib
|
||||
)
|
||||
set(QT_DEBUG_LIBRARIES
|
||||
debug QtCored4.lib
|
||||
debug QtGuid4.lib
|
||||
debug QtDesignerd4.lib
|
||||
debug QtSvgd4.lib
|
||||
debug QtNetworkd4.lib
|
||||
debug QtSqld4.lib
|
||||
debug QtTestd4.lib
|
||||
debug QtXmld4.lib
|
||||
debug QtOpenGld4.lib
|
||||
debug QtWebKitd4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY_DEBUG
|
||||
debug QtCored4.lib
|
||||
)
|
||||
|
||||
set(QT_QTCORE_LIBRARY
|
||||
optimized QtCore4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY_DEBUG
|
||||
debug Qt3Supportd4.lib
|
||||
)
|
||||
|
||||
set(QT_QT3SUPPORT_LIBRARY
|
||||
optimized Qt3Support4.lib
|
||||
)
|
||||
|
||||
set(QT_UIC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/uic.exe)
|
||||
set(QT_MOC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/moc.exe)
|
||||
set(QT_RCC_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/rcc.exe)
|
||||
set(QT_HELPCOMPILER_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/qhelpgenerator.exe)
|
||||
set(QT_COLLECTIOMGENERATOR_EXECUTABLE ${FREECAD_LIBPACK_DIR}/bin/qcollectiongenerator.exe)
|
||||
|
||||
|
||||
|
||||
MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
|
||||
SET(${_qt4_files})
|
||||
SET(${_qt4_options})
|
||||
#SET(_QT4_DOING_OPTIONS FALSE)
|
||||
FOREACH(_currentArg ${ARGN})
|
||||
# IF ("${_currentArg}" STREQUAL "OPTIONS")
|
||||
# SET(_QT4_DOING_OPTIONS TRUE)
|
||||
# ELSE ("${_currentArg}" STREQUAL "OPTIONS")
|
||||
# IF(_QT4_DOING_OPTIONS)
|
||||
# LIST(APPEND ${_qt4_options} "${_currentArg}")
|
||||
# ELSE(_QT4_DOING_OPTIONS)
|
||||
LIST(APPEND ${_qt4_files} "${_currentArg}")
|
||||
# ENDIF(_QT4_DOING_OPTIONS)
|
||||
# ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
|
||||
ENDFOREACH(_currentArg)
|
||||
ENDMACRO (QT4_EXTRACT_OPTIONS)
|
||||
|
||||
# macro used to create the names of output files preserving relative dirs
|
||||
MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
|
||||
STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
|
||||
STRING(LENGTH ${infile} _infileLength)
|
||||
SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
IF(_infileLength GREATER _binlength)
|
||||
STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
|
||||
IF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
|
||||
ELSE(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
|
||||
ENDIF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
ELSE(_infileLength GREATER _binlength)
|
||||
FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
|
||||
ENDIF(_infileLength GREATER _binlength)
|
||||
SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
|
||||
STRING(REPLACE ".." "__" _outfile ${_outfile})
|
||||
GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
|
||||
GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
|
||||
FILE(MAKE_DIRECTORY ${outpath})
|
||||
SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
|
||||
ENDMACRO (QT4_MAKE_OUTPUT_FILE )
|
||||
|
||||
MACRO (QT4_WRAP_CPP outfiles )
|
||||
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
||||
SET(ARGN)
|
||||
foreach(it ${moc_files})
|
||||
get_filename_component(it ${it} ABSOLUTE)
|
||||
QT4_MAKE_OUTPUT_FILE(${it} moc_ cpp outfile)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_MOC_EXECUTABLE}
|
||||
ARGS ${moc_options} ${it} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${it}
|
||||
)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
endforeach(it)
|
||||
ENDMACRO (QT4_WRAP_CPP)
|
||||
|
||||
|
||||
# This is a special version of the built in macro qt4_wrap_cpp
|
||||
# It is required since moc'ed files are now included instead of being added to projects directly
|
||||
# It adds a reverse dependency to solve this
|
||||
# This has the unfortunate side effect that some files are always rebuilt
|
||||
# There is probably a cleaner solution than this
|
||||
|
||||
include(AddFileDependencies)
|
||||
|
||||
macro(fc_wrap_cpp outfiles )
|
||||
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
|
||||
# fixes bug 0000585: bug with boost 1.48
|
||||
SET(moc_options ${moc_options} -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
|
||||
SET(ARGN)
|
||||
foreach(it ${moc_files})
|
||||
get_filename_component(it ${it} ABSOLUTE)
|
||||
QT4_MAKE_OUTPUT_FILE(${it} moc_ cpp outfile)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_MOC_EXECUTABLE}
|
||||
ARGS ${moc_options} ${it} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${it}
|
||||
)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
add_file_dependencies(${it} ${outfile})
|
||||
endforeach(it)
|
||||
endmacro(fc_wrap_cpp)
|
||||
|
||||
|
||||
MACRO (QT4_ADD_RESOURCES outfiles )
|
||||
QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
|
||||
SET(ARGN)
|
||||
FOREACH (it ${rcc_files})
|
||||
GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
|
||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
|
||||
# parse file for dependencies
|
||||
# all files are absolute paths or relative to the location of the qrc file
|
||||
FILE(READ "${infile}" _RC_FILE_CONTENTS)
|
||||
STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
|
||||
SET(_RC_DEPENDS)
|
||||
FOREACH(_RC_FILE ${_RC_FILES})
|
||||
STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
|
||||
STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
|
||||
IF(NOT _ABS_PATH_INDICATOR)
|
||||
SET(_RC_FILE "${rc_path}/${_RC_FILE}")
|
||||
ENDIF(NOT _ABS_PATH_INDICATOR)
|
||||
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
|
||||
ENDFOREACH(_RC_FILE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_RCC_EXECUTABLE}
|
||||
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
DEPENDS ${_RC_DEPENDS})
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH (it)
|
||||
ENDMACRO (QT4_ADD_RESOURCES)
|
||||
|
||||
MACRO (QT4_WRAP_UI outfiles )
|
||||
QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
|
||||
|
||||
FOREACH (it ${ui_files})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${QT_UIC_EXECUTABLE}
|
||||
ARGS -o ${outfile} ${infile}
|
||||
MAIN_DEPENDENCY ${infile})
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH (it)
|
||||
ENDMACRO (QT4_WRAP_UI)
|
||||
|
||||
|
||||
set(QT4_FOUND TRUE)
|
||||
|
||||
# SoQt
|
||||
set(SOQT_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/SoQt-1.6.0)
|
||||
set(SOQT_LIBRARY_RELEASE soqt1.lib)
|
||||
set(SOQT_LIBRARY_DEBUG soqt1d.lib)
|
||||
set(SOQT_FOUND TRUE)
|
||||
|
||||
# OpenCV
|
||||
set(OPENCV2_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/opencv)
|
||||
set(OPENCV2_LIBRARIES
|
||||
optimized opencv_calib3d249.lib
|
||||
debug opencv_calib3d249d.lib
|
||||
optimized opencv_contrib249.lib
|
||||
debug opencv_contrib249d.lib
|
||||
optimized opencv_core249.lib
|
||||
debug opencv_core249d.lib
|
||||
optimized opencv_features2d249.lib
|
||||
debug opencv_features2d249d.lib
|
||||
optimized opencv_flann249.lib
|
||||
debug opencv_flann249d.lib
|
||||
optimized opencv_gpu249.lib
|
||||
debug opencv_gpu249d.lib
|
||||
optimized opencv_highgui249.lib
|
||||
debug opencv_highgui249d.lib
|
||||
optimized opencv_imgproc249.lib
|
||||
debug opencv_imgproc249d.lib
|
||||
optimized opencv_legacy249.lib
|
||||
debug opencv_legacy249d.lib
|
||||
optimized opencv_ml249.lib
|
||||
debug opencv_ml249d.lib
|
||||
optimized opencv_nonfree249.lib
|
||||
debug opencv_nonfree249d.lib
|
||||
optimized opencv_objdetect249.lib
|
||||
debug opencv_objdetect249d.lib
|
||||
optimized opencv_ocl249.lib
|
||||
debug opencv_ocl249d.lib
|
||||
optimized opencv_photo249.lib
|
||||
debug opencv_photo249d.lib
|
||||
optimized opencv_stitching249.lib
|
||||
debug opencv_stitching249d.lib
|
||||
optimized opencv_superres249.lib
|
||||
debug opencv_superres249d.lib
|
||||
optimized opencv_ts249.lib
|
||||
debug opencv_ts249d.lib
|
||||
optimized opencv_video249.lib
|
||||
debug opencv_video249d.lib
|
||||
optimized opencv_videostab249.lib
|
||||
debug opencv_videostab249d.lib
|
||||
)
|
||||
set(OPENCV2_FOUND TRUE)
|
||||
|
||||
# NGLIB (NetGen)
|
||||
|
||||
set(NGLIB_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/nglib/include)
|
||||
set(NGLIB_LIBRARY_DIR
|
||||
${FREECAD_LIBPACK_DIR}/lib
|
||||
)
|
||||
set(NGLIB_LIBRARIES
|
||||
optimized nglib
|
||||
)
|
||||
set(NGLIB_DEBUG_LIBRARIES
|
||||
debug nglibd
|
||||
)
|
||||
|
||||
|
||||
# Pointscloud library
|
||||
set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.7)
|
||||
set(PCL_LIBRARIES
|
||||
debug pcl_common_debug.lib
|
||||
optimized pcl_common_release.lib
|
||||
debug pcl_features_debug.lib
|
||||
optimized pcl_features_release.lib
|
||||
debug pcl_filters_debug.lib
|
||||
optimized pcl_filters_release.lib
|
||||
debug pcl_io_debug.lib
|
||||
debug pcl_io_ply_debug.lib
|
||||
optimized pcl_io_ply_release.lib
|
||||
optimized pcl_io_release.lib
|
||||
debug pcl_kdtree_debug.lib
|
||||
optimized pcl_kdtree_release.lib
|
||||
debug pcl_keypoints_debug.lib
|
||||
optimized pcl_keypoints_release.lib
|
||||
debug pcl_ml_debug.lib
|
||||
optimized pcl_ml_release.lib
|
||||
debug pcl_octree_debug.lib
|
||||
optimized pcl_octree_release.lib
|
||||
debug pcl_recognition_debug.lib
|
||||
optimized pcl_recognition_release.lib
|
||||
debug pcl_registration_debug.lib
|
||||
optimized pcl_registration_release.lib
|
||||
debug pcl_sample_consensus_debug.lib
|
||||
optimized pcl_sample_consensus_release.lib
|
||||
debug pcl_search_debug.lib
|
||||
optimized pcl_search_release.lib
|
||||
debug pcl_segmentation_debug.lib
|
||||
optimized pcl_segmentation_release.lib
|
||||
debug pcl_stereo_debug.lib
|
||||
optimized pcl_stereo_release.lib
|
||||
debug pcl_surface_debug.lib
|
||||
optimized pcl_surface_release.lib
|
||||
debug pcl_tracking_debug.lib
|
||||
optimized pcl_tracking_release.lib
|
||||
)
|
||||
set(PCL_FOUND TRUE)
|
||||
|
||||
set(FLANN_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/flann-1.8)
|
||||
|
||||
|
||||
set(OCC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/oce-0.15)
|
||||
set(OCC_LIBRARY_DIR ${FREECAD_LIBPACK_DIR}/lib)
|
||||
set(OCC_LIBRARIES
|
||||
optimized TKFillet
|
||||
optimized TKMesh
|
||||
optimized TKernel
|
||||
optimized TKG2d
|
||||
optimized TKG3d
|
||||
optimized TKMath
|
||||
optimized TKIGES
|
||||
optimized TKSTL
|
||||
optimized TKShHealing
|
||||
optimized TKXSBase
|
||||
optimized TKBool
|
||||
optimized TKBO
|
||||
optimized TKBRep
|
||||
optimized TKTopAlgo
|
||||
optimized TKGeomAlgo
|
||||
optimized TKGeomBase
|
||||
optimized TKOffset
|
||||
optimized TKPrim
|
||||
optimized TKSTEP
|
||||
optimized TKSTEPBase
|
||||
optimized TKSTEPAttr
|
||||
optimized TKHLR
|
||||
optimized TKFeat
|
||||
)
|
||||
set(OCC_DEBUG_LIBRARIES
|
||||
debug TKFilletd
|
||||
debug TKMeshd
|
||||
debug TKerneld
|
||||
debug TKG2dd
|
||||
debug TKG3dd
|
||||
debug TKMathd
|
||||
debug TKIGESd
|
||||
debug TKSTLd
|
||||
debug TKShHealingd
|
||||
debug TKXSBased
|
||||
debug TKBoold
|
||||
debug TKBOd
|
||||
debug TKBRepd
|
||||
debug TKTopAlgod
|
||||
debug TKGeomAlgod
|
||||
debug TKGeomBased
|
||||
debug TKOffsetd
|
||||
debug TKPrimd
|
||||
debug TKSTEPd
|
||||
debug TKSTEPBased
|
||||
debug TKSTEPAttrd
|
||||
debug TKHLRd
|
||||
debug TKFeatd
|
||||
)
|
||||
set(OCC_OCAF_LIBRARIES
|
||||
optimized TKCAF
|
||||
optimized TKXCAF
|
||||
optimized TKLCAF
|
||||
optimized TKXDESTEP
|
||||
optimized TKXDEIGES
|
||||
optimized TKMeshVS
|
||||
optimized TKAdvTools
|
||||
)
|
||||
set(OCC_OCAF_DEBUG_LIBRARIES
|
||||
debug TKCAFd
|
||||
debug TKXCAFd
|
||||
debug TKLCAFd
|
||||
debug TKXDESTEPd
|
||||
debug TKXDEIGESd
|
||||
debug TKMeshVSd
|
||||
debug TKAdvToolsd
|
||||
)
|
||||
set(OCC_FOUND TRUE)
|
||||
|
||||
|
||||
set(EIGEN3_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/eigen3)
|
||||
set(EIGEN3_FOUND TRUE)
|
||||
|
||||
set(ODE_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/ode-0.11.1)
|
||||
set(ODE_LIBRARIES ${FREECAD_LIBPACK_DIR}/lib/ode_double.lib)
|
||||
set(ODE_FOUND TRUE)
|
||||
|
||||
# FreeType
|
||||
if(FREECAD_USE_FREETYPE)
|
||||
set(FREETYPE_LIBRARIES
|
||||
optimized ${FREECAD_LIBPACK_DIR}/lib/freetype.lib
|
||||
debug ${FREECAD_LIBPACK_DIR}/lib/freetyped.lib
|
||||
)
|
||||
set(FREETYPE_INCLUDE_DIRS
|
||||
${FREECAD_LIBPACK_DIR}/include/FreeType-2.4.12
|
||||
)
|
||||
set(FREETYPE_VERSION_STRING
|
||||
"2.4.12"
|
||||
)
|
||||
set(FREETYPE_FOUND
|
||||
TRUE
|
||||
)
|
||||
endif(FREECAD_USE_FREETYPE)
|
||||
|
||||
|
||||
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
|
||||
# SHIBOKEN_LIBRARY - Files to link against to use SHIBOKEN
|
||||
# SHIBOKEN_BINARY - Executable name
|
||||
|
||||
SET(SHIBOKEN_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/shiboken-1.2.2)
|
||||
SET(SHIBOKEN_LIBRARY optimized ${FREECAD_LIBPACK_DIR}/lib/shiboken-python2.7.lib debug ${FREECAD_LIBPACK_DIR}/lib/shiboken-python2.7_d.lib)
|
||||
set(SHIBOKEN_BINARY ${FREECAD_LIBPACK_DIR}/bin/shiboken)
|
||||
|
||||
# PYSIDE_INCLUDE_DIR - Directories to include to use PySide
|
||||
# PYSIDE_LIBRARY - Files to link against to use PySide
|
||||
# PYSIDE_PYTHONPATH - Path to where the PySide Python module files could be found
|
||||
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide
|
||||
|
||||
SET(PYSIDE_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/PySide-1.2.2)
|
||||
SET(PYSIDE_LIBRARY optimized ${FREECAD_LIBPACK_DIR}/lib/pyside-python2.7.lib debug ${FREECAD_LIBPACK_DIR}/lib/pyside-python2.7_d.lib)
|
||||
SET(PYSIDE_PYTHONPATH ${FREECAD_LIBPACK_DIR}/pyside/Lib/site-packages)
|
||||
SET(PYSIDE_TYPESYSTEMS ${FREECAD_LIBPACK_DIR}/pyside/share/PySide/typesystems)
|
16
src/3rdParty/CMakeLists.txt
vendored
16
src/3rdParty/CMakeLists.txt
vendored
|
@ -1,21 +1,21 @@
|
|||
|
||||
if(FREECAD_BUILD_CAM)
|
||||
if(BUILD_CAM)
|
||||
add_subdirectory(ANN)
|
||||
endif(FREECAD_BUILD_CAM)
|
||||
endif(BUILD_CAM)
|
||||
|
||||
if(FREECAD_BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
||||
if(BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
||||
if(FREECAD_LIBPACK_CHECKFILE6X)
|
||||
add_subdirectory(Pivy)
|
||||
elseif(FREECAD_LIBPACK_CHECKFILE7X)
|
||||
add_subdirectory(Pivy-0.5)
|
||||
#elseif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKCUSTOM)
|
||||
#elseif(BUILD_GUI AND FREECAD_LIBPACK_CHECKCUSTOM)
|
||||
# find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
|
||||
# if (COIN_VERSION3)
|
||||
# add_subdirectory(Pivy-0.5)
|
||||
# else (COIN_VERSION3)
|
||||
# add_subdirectory(Pivy)
|
||||
# endif(COIN_VERSION3)
|
||||
#endif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
|
||||
#endif(BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
|
||||
#if (MINGW)
|
||||
# add_subdirectory(Pivy)
|
||||
#endif(MINGW)
|
||||
|
@ -32,10 +32,10 @@ if(FREECAD_BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
|||
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
|
||||
endif(COIN_VERSION3)
|
||||
endif (FREECAD_LIBPACK_CHECKFILE6X)
|
||||
endif(FREECAD_BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
||||
endif(BUILD_GUI AND NOT FREECAD_USE_EXTERNAL_PIVY)
|
||||
|
||||
# Build SalomeMesh for all Platforms since heavily patched
|
||||
if (FREECAD_BUILD_SMESH)
|
||||
if (BUILD_SMESH)
|
||||
add_subdirectory(salomesmesh)
|
||||
endif(FREECAD_BUILD_SMESH)
|
||||
endif(BUILD_SMESH)
|
||||
|
||||
|
|
101
src/3rdParty/salomesmesh/CMakeLists.txt
vendored
101
src/3rdParty/salomesmesh/CMakeLists.txt
vendored
|
@ -27,7 +27,7 @@ include_directories(
|
|||
link_directories(${OCC_LIBRARY_DIR})
|
||||
|
||||
if(MSVC)
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
set(SMESH_LIBS
|
||||
debug MSVCRTD.LIB
|
||||
debug MSVCPRTD.LIB
|
||||
|
@ -41,7 +41,7 @@ if(MSVC)
|
|||
${OCC_OCAF_DEBUG_LIBRARIES}
|
||||
${OCC_OCAF_LIBRARIES}
|
||||
)
|
||||
else(FREECAD_BUILD_FEM_NETGEN)
|
||||
else(BUILD_FEM_NETGEN)
|
||||
set(SMESH_LIBS
|
||||
debug MSVCRTD.LIB
|
||||
debug MSVCPRTD.LIB
|
||||
|
@ -53,21 +53,21 @@ if(MSVC)
|
|||
${OCC_OCAF_DEBUG_LIBRARIES}
|
||||
${OCC_OCAF_LIBRARIES}
|
||||
)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
else(MSVC)
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
set(SMESH_LIBS
|
||||
${NGLIB_LIBRARIES}
|
||||
${OCC_LIBRARIES}
|
||||
${OCC_OCAF_LIBRARIES}
|
||||
)
|
||||
else(FREECAD_BUILD_FEM_NETGEN)
|
||||
else(BUILD_FEM_NETGEN)
|
||||
set(SMESH_LIBS
|
||||
${OCC_LIBRARIES}
|
||||
${OCC_OCAF_LIBRARIES}
|
||||
)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
endif(MSVC)
|
||||
|
||||
|
||||
|
@ -127,7 +127,7 @@ ELSE(UNIX)
|
|||
######### Windows ###########
|
||||
#MESSAGE("-- Windows system detected")
|
||||
IF(MSVC)
|
||||
ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB /wd4290 /wd4251 /wd4018 /wd4800 /wd4996 /wd4244 /wd4806 /wd4275)
|
||||
ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -DNO_My_ctype -DNO_ISATTY -DNO_FPINIT /wd4290 /wd4251 /wd4018 /wd4800 /wd4996 /wd4244 /wd4806 /wd4275)
|
||||
ELSE(MSVC)
|
||||
ADD_DEFINITIONS(-DWNT -DWIN32 -D_WINDOWS -DCSFDB)
|
||||
ENDIF(MSVC)
|
||||
|
@ -268,49 +268,58 @@ endif(WIN32)
|
|||
##############
|
||||
# MEFISTO2 #
|
||||
##############
|
||||
if (MSVC)
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# Mefisto2f.lib was built using f2c which created
|
||||
# all function names with an '_' at the end.
|
||||
FILE(GLOB MEFISTO2_source_files
|
||||
src/MEFISTO2/*.cpp
|
||||
#if (MSVC)
|
||||
#IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# # Mefisto2f.lib was built using f2c which created
|
||||
# # all function names with an '_' at the end.
|
||||
# FILE(GLOB MEFISTO2_source_files
|
||||
# src/MEFISTO2/*.cpp
|
||||
# inc/Rn.h
|
||||
# inc/aptrte.h
|
||||
# )
|
||||
#ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# FILE(GLOB MEFISTO2_source_files
|
||||
# src/MEFISTO2/*.cpp
|
||||
# src/MEFISTO2/MEFISTO2F.def
|
||||
# inc/Rn.h
|
||||
# inc/aptrte.h
|
||||
# )
|
||||
#ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
set(MEFISTO2_source_files
|
||||
src/MEFISTO2/aptrte.cpp
|
||||
src/MEFISTO2/trte.c
|
||||
inc/Rn.h
|
||||
inc/aptrte.h
|
||||
)
|
||||
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
FILE(GLOB MEFISTO2_source_files
|
||||
src/MEFISTO2/*.cpp
|
||||
src/MEFISTO2/MEFISTO2F.def
|
||||
inc/Rn.h
|
||||
inc/aptrte.h
|
||||
)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
else(MSVC)
|
||||
FILE(GLOB MEFISTO2_source_files
|
||||
src/MEFISTO2/*.cpp
|
||||
src/MEFISTO2/trte.f
|
||||
inc/Rn.h
|
||||
inc/aptrte.h
|
||||
)
|
||||
endif(MSVC)
|
||||
|
||||
#else(MSVC)
|
||||
# FILE(GLOB MEFISTO2_source_files
|
||||
# src/MEFISTO2/*.cpp
|
||||
# src/MEFISTO2/trte.f
|
||||
# inc/Rn.h
|
||||
# inc/aptrte.h
|
||||
# )
|
||||
#endif(MSVC)
|
||||
|
||||
ADD_LIBRARY(MEFISTO2 SHARED ${MEFISTO2_source_files})
|
||||
|
||||
SET_BIN_DIR(MEFISTO2 MEFISTO2)
|
||||
if(MSVC)
|
||||
TARGET_LINK_LIBRARIES(MEFISTO2 ${SMESH_LIBS} MEFISTO2f.lib) # in case of Windows link the prebuild Fortran lib
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
#if(MSVC)
|
||||
TARGET_LINK_LIBRARIES(MEFISTO2 ${SMESH_LIBS}) # in case of Windows link the prebuild Fortran lib
|
||||
set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "-DMEFISTO2D_EXPORTS")
|
||||
else(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "-DMEFISTO2D_EXPORTS -D__WATCOM__")
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
elseif(MINGW)
|
||||
TARGET_LINK_LIBRARIES(MEFISTO2 ${SMESH_LIBS} gfortran)
|
||||
set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "-DMEFISTO2D_EXPORTS")
|
||||
else(MSVC)
|
||||
TARGET_LINK_LIBRARIES(MEFISTO2 ${SMESH_LIBS} gfortran)
|
||||
set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "${MEFISTO2_CFLAGS}")
|
||||
endif(MSVC)
|
||||
# if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "-DMEFISTO2D_EXPORTS")
|
||||
# else(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "-DMEFISTO2D_EXPORTS -D__WATCOM__")
|
||||
# endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
#elseif(MINGW)
|
||||
# TARGET_LINK_LIBRARIES(MEFISTO2 ${SMESH_LIBS} gfortran)
|
||||
# set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "-DMEFISTO2D_EXPORTS")
|
||||
#else(MSVC)
|
||||
# TARGET_LINK_LIBRARIES(MEFISTO2 ${SMESH_LIBS} gfortran)
|
||||
# set_target_properties(MEFISTO2 PROPERTIES COMPILE_FLAGS "${MEFISTO2_CFLAGS}")
|
||||
#endif(MSVC)
|
||||
|
||||
|
||||
##############
|
||||
|
@ -337,7 +346,7 @@ endif(WIN32)
|
|||
#ENDIF(MINGW)
|
||||
|
||||
# Disable for all other compilers but MSVC
|
||||
if (FREECAD_BUILD_FEM_NETGEN)
|
||||
if (BUILD_FEM_NETGEN)
|
||||
|
||||
################
|
||||
# NETGENPlugin #
|
||||
|
@ -351,7 +360,7 @@ if(WIN32)
|
|||
set_target_properties(NETGENPlugin PROPERTIES COMPILE_FLAGS "-DNETGENPLUGIN_EXPORTS -DNO_PARALLEL_THREADS -DOCCGEOMETRY -DNETGEN_V5")
|
||||
endif(WIN32)
|
||||
|
||||
endif (FREECAD_BUILD_FEM_NETGEN)
|
||||
endif (BUILD_FEM_NETGEN)
|
||||
|
||||
#IF(WIN32)
|
||||
# SET_TARGET_PROPERTIES(SMESH PROPERTIES COMPILE_FLAGS "-DNETGENPluginimpl_EXPORTS ")
|
||||
|
@ -372,7 +381,7 @@ else(WIN32)
|
|||
)
|
||||
endif(WIN32)
|
||||
|
||||
if (FREECAD_BUILD_FEM_NETGEN)
|
||||
if (BUILD_FEM_NETGEN)
|
||||
if(WIN32)
|
||||
INSTALL(TARGETS NETGENPlugin
|
||||
RUNTIME DESTINATION bin
|
||||
|
@ -383,5 +392,5 @@ if (FREECAD_BUILD_FEM_NETGEN)
|
|||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
endif(WIN32)
|
||||
endif (FREECAD_BUILD_FEM_NETGEN)
|
||||
endif (BUILD_FEM_NETGEN)
|
||||
|
||||
|
|
17
src/3rdParty/salomesmesh/inc/aptrte.h
vendored
17
src/3rdParty/salomesmesh/inc/aptrte.h
vendored
|
@ -135,7 +135,22 @@ MEFISTO2D_EXPORT
|
|||
#elif defined(WIN32) && defined (__WATCOM__)
|
||||
|
||||
#define MEFISTO2D_STDCALL
|
||||
|
||||
#define insoar insoar_
|
||||
#define azeroi azeroi_
|
||||
#define fasoar fasoar_
|
||||
#define teajte teajte_
|
||||
#define tehote tehote_
|
||||
#define tetrte tetrte_
|
||||
#define aisoar aisoar_
|
||||
#define tedela tedela_
|
||||
#define terefr terefr_
|
||||
#define tesuex tesuex_
|
||||
#define teamqt teamqt_
|
||||
#define nusotr nusotr_
|
||||
#define qutr2d qutr2d_
|
||||
#define surtd2 surtd2_
|
||||
#define qualitetrte qualitetrte_
|
||||
#define areteideale areteideale_
|
||||
#else //Lin and MacOSX use f77
|
||||
|
||||
#define MEFISTO2D_STDCALL
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
EXPORTS
|
||||
insoar
|
||||
azeroi
|
||||
fasoar
|
||||
teajte
|
||||
tehote
|
||||
tetrte
|
||||
aisoar
|
||||
tedela
|
||||
terefr
|
||||
tesuex
|
||||
teamqt
|
||||
qutr2d
|
||||
surtd2
|
||||
nusotr
|
|
@ -24,10 +24,12 @@
|
|||
// Author : Alain PERRONNET
|
||||
// Date : 13 novembre 2006
|
||||
|
||||
|
||||
#include "Rn.h"
|
||||
#include "aptrte.h"
|
||||
#include "utilities.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern "C"
|
||||
|
@ -839,6 +841,6 @@ void MEFISTO2D_STDCALL qualitetrte( R3 *mnpxyd,
|
|||
if( nbtrianeg>0 )
|
||||
MESSAGE( "ATTENTION: "<< nbtrianeg << " TRIANGLES d'AIRE NEGATIVE" );
|
||||
|
||||
MESSAGE(" ");
|
||||
MESSAGE("_");
|
||||
return;
|
||||
}
|
||||
|
|
217
src/3rdParty/salomesmesh/src/MEFISTO2/mefisto.patch
vendored
217
src/3rdParty/salomesmesh/src/MEFISTO2/mefisto.patch
vendored
|
@ -1,217 +0,0 @@
|
|||
diff --git a/MEFISTO2F.def b/MEFISTO2F.def
|
||||
new file mode 100644
|
||||
index 0000000..d4a0728
|
||||
--- /dev/null
|
||||
+++ b/MEFISTO2F.def
|
||||
@@ -0,0 +1,15 @@
|
||||
+EXPORTS
|
||||
+ insoar_
|
||||
+ azeroi_
|
||||
+ fasoar_
|
||||
+ teajte_
|
||||
+ tehote_
|
||||
+ tetrte_
|
||||
+ aisoar_
|
||||
+ tedela_
|
||||
+ terefr_
|
||||
+ tesuex_
|
||||
+ teamqt_
|
||||
+ qutr2d_
|
||||
+ surtd2_
|
||||
+ nusotr_
|
||||
diff --git a/Mefisto2.def b/Mefisto2.def
|
||||
new file mode 100644
|
||||
index 0000000..844f04f
|
||||
--- /dev/null
|
||||
+++ b/Mefisto2.def
|
||||
@@ -0,0 +1,5 @@
|
||||
+LIBRARY MEFISTO2.dll
|
||||
+EXPORTS
|
||||
+ areteideale_
|
||||
+ qualitetrte_
|
||||
+
|
||||
diff --git a/Mefisto2d.def b/Mefisto2d.def
|
||||
new file mode 100644
|
||||
index 0000000..dff1325
|
||||
--- /dev/null
|
||||
+++ b/Mefisto2d.def
|
||||
@@ -0,0 +1,5 @@
|
||||
+LIBRARY MEFISTO2d.dll
|
||||
+EXPORTS
|
||||
+ areteideale_
|
||||
+ qualitetrte_
|
||||
+
|
||||
diff --git a/arithchk.c b/arithchk.c
|
||||
index 6a3c2a5..40f1f47 100644
|
||||
--- a/arithchk.c
|
||||
+++ b/arithchk.c
|
||||
@@ -29,6 +29,7 @@ THIS SOFTWARE.
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h> /* another possible place for ssize_t */
|
||||
+#include <stddef.h>
|
||||
|
||||
#ifdef NO_FPINIT
|
||||
#define fpinit_ASL()
|
||||
@@ -42,6 +43,8 @@ extern
|
||||
#endif /*KR_headers*/
|
||||
#endif /*NO_FPINIT*/
|
||||
|
||||
+ typedef int ssize_t;
|
||||
+
|
||||
static int dalign;
|
||||
typedef struct
|
||||
Akind {
|
||||
diff --git a/derf_.c b/derf_.c
|
||||
index d935d31..e757916 100644
|
||||
--- a/derf_.c
|
||||
+++ b/derf_.c
|
||||
@@ -13,6 +13,38 @@ double derf_(doublereal *x)
|
||||
{
|
||||
return( erf(*x) );
|
||||
}
|
||||
+
|
||||
+/* http://stackoverflow.com/questions/6281020/error-function-erfx-not-found-in-math-h-for-visual-studio-2005 */
|
||||
+double erf(double x)
|
||||
+{
|
||||
+ /* constants */
|
||||
+ double a1 = 0.254829592;
|
||||
+ double a2 = -0.284496736;
|
||||
+ double a3 = 1.421413741;
|
||||
+ double a4 = -1.453152027;
|
||||
+ double a5 = 1.061405429;
|
||||
+ double p = 0.3275911;
|
||||
+ double t;
|
||||
+ double y;
|
||||
+
|
||||
+ /* Save the sign of x */
|
||||
+ int sign = 1;
|
||||
+ if (x < 0)
|
||||
+ sign = -1;
|
||||
+ x = fabs(x);
|
||||
+
|
||||
+ /* A&S formula 7.1.26 */
|
||||
+ t = 1.0/(1.0 + p*x);
|
||||
+ y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
|
||||
+
|
||||
+ return sign*y;
|
||||
+}
|
||||
+/* http://www.boost.org/doc/libs/1_39_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_function.html*/
|
||||
+/* erfc(z) = 1-erf(z) */
|
||||
+double erfc(double x)
|
||||
+{
|
||||
+ return 1.0 - erf(x);
|
||||
+}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
diff --git a/libf2c.lbc b/libf2c.lbc
|
||||
index c51c0aa..b77ae3c 100644
|
||||
--- a/libf2c.lbc
|
||||
+++ b/libf2c.lbc
|
||||
@@ -1,3 +1,4 @@
|
||||
+trte.obj
|
||||
abort_.obj
|
||||
backspac.obj
|
||||
c_abs.obj
|
||||
diff --git a/main.c b/main.c
|
||||
index d95fdc9..22d1011 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -135,7 +135,7 @@ f_init();
|
||||
#ifndef NO_ONEXIT
|
||||
ONEXIT(f_exit);
|
||||
#endif
|
||||
-MAIN__();
|
||||
+/*MAIN__();*/
|
||||
#ifdef NO_ONEXIT
|
||||
f_exit();
|
||||
#endif
|
||||
diff --git a/makefile.vc b/makefile.vc
|
||||
index b3dd90c..3e9c82f 100644
|
||||
--- a/makefile.vc
|
||||
+++ b/makefile.vc
|
||||
@@ -6,12 +6,13 @@
|
||||
# to the objects in the "w =" list below.
|
||||
|
||||
CC = cl
|
||||
-CFLAGS = -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -Ot1 -DNO_My_ctype -DNO_ISATTY
|
||||
+CFLAGS = -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -Ot1 -DNO_My_ctype -DNO_ISATTY -MD
|
||||
|
||||
.c.obj:
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
w = \
|
||||
+ trte.obj \
|
||||
abort_.obj \
|
||||
backspac.obj \
|
||||
c_abs.obj \
|
||||
@@ -166,7 +167,7 @@ w = \
|
||||
z_sin.obj \
|
||||
z_sqrt.obj
|
||||
|
||||
-all: f2c.h math.h signal1.h sysdep1.h vcf2c.lib
|
||||
+all: f2c.h math.h signal1.h sysdep1.h MEFISTO2F.lib MEFISTO2Fd.lib
|
||||
|
||||
f2c.h: f2c.h0
|
||||
copy f2c.h0 f2c.h
|
||||
@@ -180,8 +181,17 @@ signal1.h: signal1.h0
|
||||
sysdep1.h: sysdep1.h0
|
||||
copy sysdep1.h0 sysdep1.h
|
||||
|
||||
-vcf2c.lib: $w
|
||||
- lib -out:vcf2c.lib @libf2c.lbc
|
||||
+MEFISTO2F.lib: $w
|
||||
+ lib /DEF:Mefisto2.def /OUT:mef.lib
|
||||
+ link -out:MEFISTO2F.dll @libf2c.lbc -DLL -IMPLIB:MEFISTO2F.lib -DEF:MEFISTO2F.def mef.lib
|
||||
+ del mef.lib
|
||||
+ del mef.exp
|
||||
+
|
||||
+MEFISTO2Fd.lib: $w
|
||||
+ lib /DEF:Mefisto2d.def /OUT:mefd.lib
|
||||
+ link -out:MEFISTO2Fd.dll @libf2c.lbc -DLL -IMPLIB:MEFISTO2Fd.lib -DEF:MEFISTO2F.def mefd.lib
|
||||
+ del mefd.lib
|
||||
+ del mefd.exp
|
||||
|
||||
open.obj: open.c
|
||||
$(CC) -c $(CFLAGS) -DMSDOS open.c
|
||||
@@ -189,7 +199,7 @@ open.obj: open.c
|
||||
signbit.obj uninit.obj: arith.h
|
||||
|
||||
arith.h: arithchk.c
|
||||
- comptry.bat $(CC) $(CFLAGS) -DNO_FPINIT arithchk.c
|
||||
+ $(CC) -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -Ot1 -DNO_My_ctype -DNO_ISATTY -DNO_FPINIT arithchk.c
|
||||
arithchk >arith.h
|
||||
del arithchk.exe
|
||||
del arithchk.obj
|
||||
diff --git a/open.c b/open.c
|
||||
index a06428d..d1f3da7 100644
|
||||
--- a/open.c
|
||||
+++ b/open.c
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifdef MSDOS
|
||||
#include "io.h"
|
||||
#else
|
||||
-#include "unistd.h" /* for access */
|
||||
+#include "unistd.h" /* for _access */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -204,7 +204,7 @@ integer f_open(olist *a)
|
||||
opnerr(a->oerr,errno,"open")
|
||||
fclose(tf);
|
||||
#else
|
||||
- if (access(buf,0))
|
||||
+ if (_access(buf,0))
|
||||
opnerr(a->oerr,errno,"open")
|
||||
#endif
|
||||
break;
|
||||
@@ -234,7 +234,7 @@ integer f_open(olist *a)
|
||||
opnerr(a->oerr,128,"open")
|
||||
}
|
||||
#else
|
||||
- if (!access(buf,0))
|
||||
+ if (!_access(buf,0))
|
||||
opnerr(a->oerr,128,"open")
|
||||
#endif
|
||||
/* no break */
|
11311
src/3rdParty/salomesmesh/src/MEFISTO2/trte.c
vendored
Normal file
11311
src/3rdParty/salomesmesh/src/MEFISTO2/trte.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -54,7 +54,7 @@ DocumentObjectExecReturn *FeaturePythonImp::execute()
|
|||
Py::Object feature = static_cast<PropertyPythonObject*>(proxy)->getValue();
|
||||
if (feature.hasAttr("__object__")) {
|
||||
Py::Callable method(feature.getAttr(std::string("execute")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
method.apply(args);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -89,7 +89,7 @@ std::string PropertyPythonObject::toString() const
|
|||
Py::Callable method(pickle.getAttr(std::string("dumps")));
|
||||
Py::Object dump;
|
||||
if (this->object.hasAttr("__getstate__")) {
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Callable state(this->object.getAttr("__getstate__"));
|
||||
dump = state.apply(args);
|
||||
}
|
||||
|
|
|
@ -451,9 +451,9 @@ std::vector<std::pair<std::string,bool> > ParameterGrp::GetBoolMap(const char *
|
|||
// check on filter condition
|
||||
if (sFilter == NULL || Name.find(sFilter)!= std::string::npos) {
|
||||
if (strcmp(StrX(((DOMElement*)pcTemp)->getAttribute(XStr("Value").unicodeForm())).c_str(),"1"))
|
||||
vrValues.push_back(std::make_pair<std::string, bool>(Name, false));
|
||||
vrValues.push_back(std::make_pair(Name, false));
|
||||
else
|
||||
vrValues.push_back(std::make_pair<std::string, bool>(Name, true));
|
||||
vrValues.push_back(std::make_pair(Name, true));
|
||||
}
|
||||
pcTemp = FindNextElement(pcTemp,"FCBool");
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ std::vector<std::pair<std::string,long> > ParameterGrp::GetIntMap(const char * s
|
|||
Name = StrX( ((DOMElement*)pcTemp)->getAttributes()->getNamedItem(XStr("Name").unicodeForm())->getNodeValue()).c_str();
|
||||
// check on filter condition
|
||||
if (sFilter == NULL || Name.find(sFilter)!= std::string::npos) {
|
||||
vrValues.push_back(std::make_pair<std::string, long>(Name,
|
||||
vrValues.push_back(std::make_pair(Name,
|
||||
( atol (StrX(((DOMElement*)pcTemp)->getAttribute(XStr("Value").unicodeForm())).c_str()))));
|
||||
}
|
||||
pcTemp = FindNextElement(pcTemp,"FCInt") ;
|
||||
|
@ -574,7 +574,7 @@ std::vector<std::pair<std::string,unsigned long> > ParameterGrp::GetUnsignedMap(
|
|||
Name = StrX( ((DOMElement*)pcTemp)->getAttributes()->getNamedItem(XStr("Name").unicodeForm())->getNodeValue()).c_str();
|
||||
// check on filter condition
|
||||
if (sFilter == NULL || Name.find(sFilter)!= std::string::npos) {
|
||||
vrValues.push_back(std::make_pair<std::string, unsigned long>(Name,
|
||||
vrValues.push_back(std::make_pair(Name,
|
||||
( strtoul (StrX(((DOMElement*)pcTemp)->getAttribute(XStr("Value").unicodeForm())).c_str(),0,10) )));
|
||||
}
|
||||
pcTemp = FindNextElement(pcTemp,"FCUInt");
|
||||
|
@ -635,7 +635,7 @@ std::vector<std::pair<std::string,double> > ParameterGrp::GetFloatMap(const char
|
|||
Name = StrX( ((DOMElement*)pcTemp)->getAttributes()->getNamedItem(XStr("Name").unicodeForm())->getNodeValue()).c_str();
|
||||
// check on filter condition
|
||||
if (sFilter == NULL || Name.find(sFilter)!= std::string::npos) {
|
||||
vrValues.push_back(std::make_pair<std::string, double>(Name,
|
||||
vrValues.push_back(std::make_pair(Name,
|
||||
( atof (StrX(((DOMElement*)pcTemp)->getAttribute(XStr("Value").unicodeForm())).c_str()))));
|
||||
}
|
||||
pcTemp = FindNextElement(pcTemp,"FCFloat");
|
||||
|
@ -735,7 +735,7 @@ std::vector<std::pair<std::string,std::string> > ParameterGrp::GetASCIIMap(const
|
|||
// retrive the text element
|
||||
DOMNode *pcElem2 = pcTemp->getFirstChild();
|
||||
if (pcElem2)
|
||||
vrValues.push_back(std::make_pair<std::string, std::string>(Name, std::string(StrXUTF8(pcElem2->getNodeValue()).c_str())));
|
||||
vrValues.push_back(std::make_pair(Name, std::string(StrXUTF8(pcElem2->getNodeValue()).c_str())));
|
||||
}
|
||||
pcTemp = FindNextElement(pcTemp,"FCText");
|
||||
}
|
||||
|
|
|
@ -5,16 +5,16 @@ add_subdirectory(Base)
|
|||
add_subdirectory(App)
|
||||
add_subdirectory(Main)
|
||||
add_subdirectory(Mod)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
configure_file(Doc/Start_Page.html ${CMAKE_BINARY_DIR}/doc/Start_Page.html COPYONLY)
|
||||
configure_file(Doc/freecad.qhc ${CMAKE_BINARY_DIR}/doc/freecad.qhc COPYONLY)
|
||||
configure_file(Doc/freecad.qch ${CMAKE_BINARY_DIR}/doc/freecad.qch COPYONLY)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
if(FREECAD_BUILD_TEMPLATE)
|
||||
if(BUILD_TEMPLATE)
|
||||
add_subdirectory(Tools/_TEMPLATE_)
|
||||
endif(FREECAD_BUILD_TEMPLATE)
|
||||
endif(BUILD_TEMPLATE)
|
||||
|
||||
add_subdirectory(Doc)
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
namespace Py
|
||||
{
|
||||
typedef int sequence_index_type; // type of an index into a sequence
|
||||
typedef size_t sequence_index_type; // type of an index into a sequence
|
||||
|
||||
// Forward declarations
|
||||
class Object;
|
||||
|
@ -1115,7 +1115,7 @@ namespace Py
|
|||
{
|
||||
protected:
|
||||
SeqBase<T>& s; // the sequence
|
||||
int offset; // item number
|
||||
size_t offset; // item number
|
||||
T the_item; // lvalue
|
||||
public:
|
||||
|
||||
|
@ -1449,7 +1449,7 @@ namespace Py
|
|||
protected:
|
||||
friend class SeqBase<T>;
|
||||
SeqBase<T>* seq;
|
||||
int count;
|
||||
size_type count;
|
||||
|
||||
public:
|
||||
~iterator ()
|
||||
|
@ -1460,7 +1460,7 @@ namespace Py
|
|||
, count( 0 )
|
||||
{}
|
||||
|
||||
iterator (SeqBase<T>* s, int where)
|
||||
iterator (SeqBase<T>* s, size_type where)
|
||||
: seq( s )
|
||||
, count( where )
|
||||
{}
|
||||
|
@ -1587,7 +1587,7 @@ namespace Py
|
|||
sequence_index_type count;
|
||||
|
||||
private:
|
||||
const_iterator (const SeqBase<T>* s, int where)
|
||||
const_iterator (const SeqBase<T>* s, size_type where)
|
||||
: seq( s )
|
||||
, count( where )
|
||||
{}
|
||||
|
@ -2314,7 +2314,7 @@ namespace Py
|
|||
}
|
||||
|
||||
// New tuple of a given size
|
||||
explicit Tuple (int size = 0)
|
||||
explicit Tuple (sequence_index_type size = 0)
|
||||
{
|
||||
set(PyTuple_New (size), true);
|
||||
validate ();
|
||||
|
@ -2372,7 +2372,7 @@ namespace Py
|
|||
{
|
||||
public:
|
||||
TupleN()
|
||||
: Tuple( 0 )
|
||||
: Tuple( (sequence_index_type)0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -2496,7 +2496,7 @@ namespace Py
|
|||
validate();
|
||||
}
|
||||
// Creation at a fixed size
|
||||
List (int size = 0)
|
||||
List (sequence_index_type size = 0)
|
||||
{
|
||||
set(PyList_New (size), true);
|
||||
validate();
|
||||
|
@ -2512,7 +2512,7 @@ namespace Py
|
|||
// List from a sequence
|
||||
List (const Sequence& s): Sequence()
|
||||
{
|
||||
int n = (int)s.length();
|
||||
sequence_index_type n = s.length();
|
||||
set(PyList_New (n), true);
|
||||
validate();
|
||||
for (sequence_index_type i=0; i < n; i++)
|
||||
|
@ -2858,7 +2858,7 @@ namespace Py
|
|||
return mapref<T>(*this, key);
|
||||
}
|
||||
|
||||
int length () const
|
||||
size_type length () const
|
||||
{
|
||||
return PyMapping_Length (ptr());
|
||||
}
|
||||
|
@ -2956,7 +2956,7 @@ namespace Py
|
|||
//
|
||||
MapBase<T>* map;
|
||||
List keys; // for iterating over the map
|
||||
int pos; // index into the keys
|
||||
size_type pos; // index into the keys
|
||||
|
||||
private:
|
||||
iterator( MapBase<T>* m, List k, int p )
|
||||
|
@ -3059,7 +3059,7 @@ namespace Py
|
|||
friend class MapBase<T>;
|
||||
const MapBase<T>* map;
|
||||
List keys; // for iterating over the map
|
||||
int pos; // index into the keys
|
||||
size_type pos; // index into the keys
|
||||
|
||||
private:
|
||||
const_iterator( const MapBase<T>* m, List k, int p )
|
||||
|
@ -3292,7 +3292,7 @@ namespace Py
|
|||
inline Object Object::callMemberFunction( const std::string &function_name ) const
|
||||
{
|
||||
Callable target( getAttr( function_name ) );
|
||||
Tuple args( 0 );
|
||||
Tuple args( (sequence_index_type)0 );
|
||||
return target.apply( args );
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ if(DOXYGEN_FOUND)
|
|||
MARK_AS_ADVANCED(DOXYGEN_LANGUAGE)
|
||||
|
||||
# note: this test is obsolete if DevDoc target is used
|
||||
if (NOT FREECAD_BUILD_GUI)
|
||||
if (NOT BUILD_GUI)
|
||||
message("Note: Gui is not built. Documentation may lack some parts.")
|
||||
endif (NOT FREECAD_BUILD_GUI)
|
||||
endif (NOT BUILD_GUI)
|
||||
|
||||
# directory order seems important for correct macro expansion
|
||||
# (files containing macros definitions must be parsed before the files using them)
|
||||
|
@ -97,7 +97,7 @@ if(DOXYGEN_FOUND)
|
|||
# generate source documentation
|
||||
# delete CMakeCache to reset to default build options next time
|
||||
ADD_CUSTOM_TARGET(DevDoc
|
||||
${CMAKE_COMMAND} -D FREECAD_BUILD_GUI:BOOL=ON -D FREECAD_BUILD_FEM:BOOL=ON ${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_COMMAND} -D BUILD_GUI:BOOL=ON -D BUILD_FEM:BOOL=ON ${CMAKE_SOURCE_DIR}
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/BuildDevDoc.cfg
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/CMakeCache.txt
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
|
||||
#ifndef HAVE_INT8_T
|
||||
#define HAVE_INT8_T
|
||||
typedef char int8_t;
|
||||
typedef signed char int8_t;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_UINT8_T
|
||||
|
|
|
@ -38,7 +38,8 @@ if(MSVC)
|
|||
optimized ${SOQT_LIBRARY_RELEASE}
|
||||
${QT_DEBUG_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
QtUiTools.lib
|
||||
optimized QtUiTools.lib
|
||||
debug QtUiToolsd.lib
|
||||
${OPENGL_gl_LIBRARY}
|
||||
)
|
||||
else(MSVC)
|
||||
|
|
|
@ -115,8 +115,8 @@
|
|||
|
||||
#if defined(Q_OS_WIN32)
|
||||
#define slots
|
||||
#include <private/qmainwindowlayout_p.h>
|
||||
#include <private/qwidgetresizehandler_p.h>
|
||||
//#include <private/qmainwindowlayout_p.h>
|
||||
//#include <private/qwidgetresizehandler_p.h>
|
||||
#endif
|
||||
|
||||
using namespace Gui;
|
||||
|
@ -412,7 +412,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
|
|||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
|
||||
pDockMgr->registerDockWindow("Std_PythonView", pcPython);
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
#if 0 //defined(Q_OS_WIN32) this porsion of code is not able to run with a vanilla Qtlib build on Windows. Since it is not build on Linux I pressume its not needed.... (JR 8.2014)
|
||||
// add our own QTabBar-derived class to the main window layout
|
||||
// NOTE: This uses some private stuff from QMainWindow which doesn't
|
||||
// seem to be accessible on all platforms.
|
||||
|
|
|
@ -236,7 +236,7 @@ bool TaskWatcherPython::shouldShow()
|
|||
try {
|
||||
if (watcher.hasAttr(std::string("shouldShow"))) {
|
||||
Py::Callable method(watcher.getAttr(std::string("shouldShow")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ void TaskDialogPython::open()
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("open"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("open")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
method.apply(args);
|
||||
}
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ bool TaskDialogPython::accept()
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("accept"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("accept")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ bool TaskDialogPython::reject()
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("reject"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("reject")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ void TaskDialogPython::helpRequested()
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("helpRequested"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("helpRequested")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
method.apply(args);
|
||||
}
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ QDialogButtonBox::StandardButtons TaskDialogPython::getStandardButtons(void) con
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("getStandardButtons"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("getStandardButtons")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Int ret(method.apply(args));
|
||||
int value = (int)ret;
|
||||
return QDialogButtonBox::StandardButtons(value);
|
||||
|
@ -437,7 +437,7 @@ bool TaskDialogPython::isAllowedAlterDocument(void) const
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("isAllowedAlterDocument"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("isAllowedAlterDocument")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ bool TaskDialogPython::isAllowedAlterView(void) const
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("isAllowedAlterView"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("isAllowedAlterView")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ bool TaskDialogPython::isAllowedAlterSelection(void) const
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("isAllowedAlterSelection"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("isAllowedAlterSelection")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ bool TaskDialogPython::needsFullSpace() const
|
|||
try {
|
||||
if (dlg.hasAttr(std::string("needsFullSpace"))) {
|
||||
Py::Callable method(dlg.getAttr(std::string("needsFullSpace")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Boolean ret(method.apply(args));
|
||||
return (bool)ret;
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ QIcon ViewProviderPythonFeatureImp::getIcon() const
|
|||
Py::Object vp = static_cast<App::PropertyPythonObject*>(proxy)->getValue();
|
||||
if (vp.hasAttr(std::string("getIcon"))) {
|
||||
Py::Callable method(vp.getAttr(std::string("getIcon")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::String str(method.apply(args));
|
||||
std::string content = str.as_std_string();
|
||||
QPixmap icon;
|
||||
|
@ -296,7 +296,7 @@ std::vector<App::DocumentObject*> ViewProviderPythonFeatureImp::claimChildren(co
|
|||
Py::Object vp = static_cast<App::PropertyPythonObject*>(proxy)->getValue();
|
||||
if (vp.hasAttr(std::string("claimChildren"))) {
|
||||
Py::Callable method(vp.getAttr(std::string("claimChildren")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Sequence list(method.apply(args));
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
PyObject* item = (*it).ptr();
|
||||
|
@ -528,7 +528,7 @@ void ViewProviderPythonFeatureImp::attach(App::DocumentObject *pcObject)
|
|||
if (vp.hasAttr(std::string("attach"))) {
|
||||
if (vp.hasAttr("__object__")) {
|
||||
Py::Callable method(vp.getAttr(std::string("attach")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
method.apply(args);
|
||||
}
|
||||
else {
|
||||
|
@ -647,7 +647,7 @@ const char* ViewProviderPythonFeatureImp::getDefaultDisplayMode() const
|
|||
Py::Object vp = static_cast<App::PropertyPythonObject*>(proxy)->getValue();
|
||||
if (vp.hasAttr(std::string("getDefaultDisplayMode"))) {
|
||||
Py::Callable method(vp.getAttr(std::string("getDefaultDisplayMode")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::String str(method.apply(args));
|
||||
if (str.isUnicode())
|
||||
str = str.encode("ascii"); // json converts strings into unicode
|
||||
|
@ -676,7 +676,7 @@ std::vector<std::string> ViewProviderPythonFeatureImp::getDisplayModes(void) con
|
|||
if (vp.hasAttr(std::string("getDisplayModes"))) {
|
||||
if (vp.hasAttr("__object__")) {
|
||||
Py::Callable method(vp.getAttr(std::string("getDisplayModes")));
|
||||
Py::Tuple args(0);
|
||||
Py::Tuple args;
|
||||
Py::Sequence list(method.apply(args));
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
Py::String str(*it);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#add_defintions(-D_FC_GUI_ENABLED_)
|
||||
#add_defintions(-DFREECADMAINPY)
|
||||
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
include_directories(
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${COIN3D_INCLUDE_DIR}
|
||||
|
@ -11,7 +11,7 @@ if(FREECAD_BUILD_GUI)
|
|||
${PYTHON_INCLUDE_PATH}
|
||||
${XERCESC_INCLUDE_DIR}
|
||||
)
|
||||
else(FREECAD_BUILD_GUI)
|
||||
else(BUILD_GUI)
|
||||
include_directories(
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
|
@ -19,10 +19,10 @@ else(FREECAD_BUILD_GUI)
|
|||
${PYTHON_INCLUDE_PATH}
|
||||
${XERCESC_INCLUDE_DIR}
|
||||
)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
######################## FreeCADMain ########################
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
|
||||
SET(FreeCAD_SRCS
|
||||
freecad.rc
|
||||
|
@ -57,7 +57,7 @@ if(FREECAD_BUILD_GUI)
|
|||
RUNTIME DESTINATION bin
|
||||
)
|
||||
endif(WIN32)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
######################## FreeCADMainCmd ########################
|
||||
|
||||
SET(FreeCADMainCmd_SRCS
|
||||
|
@ -109,7 +109,7 @@ else(WIN32)
|
|||
endif(WIN32)
|
||||
|
||||
######################## FreeCADGuiPy ########################
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
|
||||
SET(FreeCADGuiPy_SRCS
|
||||
FreeCADGuiPy.cpp
|
||||
|
@ -138,4 +138,4 @@ if(FREECAD_BUILD_GUI)
|
|||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
endif(WIN32)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
|
|
@ -116,7 +116,6 @@
|
|||
#include <Standard_Static.hxx>
|
||||
#include <Standard_Storable.hxx>
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <Standard_String.hxx>
|
||||
//#include <Standard_theForMapOfTypes.hxx>
|
||||
#include <Standard_TooManyUsers.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,127 +1,127 @@
|
|||
|
||||
if(FREECAD_BUILD_POINTS)
|
||||
if(BUILD_POINTS)
|
||||
add_subdirectory(Points)
|
||||
endif(FREECAD_BUILD_POINTS)
|
||||
endif(BUILD_POINTS)
|
||||
|
||||
if(FREECAD_BUILD_COMPLETE)
|
||||
if(BUILD_COMPLETE)
|
||||
add_subdirectory(Complete)
|
||||
endif(FREECAD_BUILD_COMPLETE)
|
||||
endif(BUILD_COMPLETE)
|
||||
|
||||
if(FREECAD_BUILD_TEST)
|
||||
if(BUILD_TEST)
|
||||
add_subdirectory(Test)
|
||||
endif(FREECAD_BUILD_TEST)
|
||||
endif(BUILD_TEST)
|
||||
|
||||
#add_subdirectory(TemplatePyMod)
|
||||
|
||||
if(FREECAD_BUILD_IMAGE)
|
||||
if(BUILD_IMAGE)
|
||||
add_subdirectory(Image)
|
||||
endif(FREECAD_BUILD_IMAGE)
|
||||
endif(BUILD_IMAGE)
|
||||
|
||||
if(FREECAD_BUILD_MESH)
|
||||
if(BUILD_MESH)
|
||||
add_subdirectory(Mesh)
|
||||
endif(FREECAD_BUILD_MESH)
|
||||
endif(BUILD_MESH)
|
||||
|
||||
if(FREECAD_BUILD_PART)
|
||||
if(BUILD_PART)
|
||||
add_subdirectory(Part)
|
||||
endif(FREECAD_BUILD_PART)
|
||||
endif(BUILD_PART)
|
||||
|
||||
if(FREECAD_BUILD_MATERIAL)
|
||||
if(BUILD_MATERIAL)
|
||||
add_subdirectory(Material)
|
||||
endif(FREECAD_BUILD_MATERIAL)
|
||||
endif(BUILD_MATERIAL)
|
||||
|
||||
if(FREECAD_BUILD_PART_DESIGN)
|
||||
if(BUILD_PART_DESIGN)
|
||||
add_subdirectory(PartDesign)
|
||||
endif(FREECAD_BUILD_PART_DESIGN)
|
||||
endif(BUILD_PART_DESIGN)
|
||||
|
||||
if(FREECAD_BUILD_RAYTRACING)
|
||||
if(BUILD_RAYTRACING)
|
||||
add_subdirectory(Raytracing)
|
||||
endif(FREECAD_BUILD_RAYTRACING)
|
||||
endif(BUILD_RAYTRACING)
|
||||
|
||||
if(FREECAD_BUILD_DRAWING)
|
||||
if(BUILD_DRAWING)
|
||||
add_subdirectory(Drawing)
|
||||
endif(FREECAD_BUILD_DRAWING)
|
||||
endif(BUILD_DRAWING)
|
||||
|
||||
IF(EIGEN3_FOUND)
|
||||
if(FREECAD_BUILD_SKETCHER)
|
||||
if(BUILD_SKETCHER)
|
||||
add_subdirectory(Sketcher)
|
||||
endif(FREECAD_BUILD_SKETCHER)
|
||||
endif(BUILD_SKETCHER)
|
||||
|
||||
if(FREECAD_BUILD_ROBOT)
|
||||
if(BUILD_ROBOT)
|
||||
add_subdirectory(Robot)
|
||||
endif(FREECAD_BUILD_ROBOT)
|
||||
endif(BUILD_ROBOT)
|
||||
ELSE(EIGEN3_FOUND)
|
||||
MESSAGE("Due to the missing Eigen3 library the Sketcher module won't be built")
|
||||
MESSAGE("Due to the missing Eigen3 library the Robot module won't be built")
|
||||
ENDIF(EIGEN3_FOUND)
|
||||
|
||||
if(FREECAD_BUILD_REVERSEENGINEERING)
|
||||
if(BUILD_REVERSEENGINEERING)
|
||||
add_subdirectory(ReverseEngineering)
|
||||
endif(FREECAD_BUILD_REVERSEENGINEERING)
|
||||
endif(BUILD_REVERSEENGINEERING)
|
||||
|
||||
if(FREECAD_BUILD_MESH_PART)
|
||||
if(BUILD_MESH_PART)
|
||||
add_subdirectory(MeshPart)
|
||||
endif(FREECAD_BUILD_MESH_PART)
|
||||
endif(BUILD_MESH_PART)
|
||||
|
||||
if(FREECAD_BUILD_DRAFT)
|
||||
if(BUILD_DRAFT)
|
||||
add_subdirectory(Draft)
|
||||
endif(FREECAD_BUILD_DRAFT)
|
||||
endif(BUILD_DRAFT)
|
||||
|
||||
if(FREECAD_BUILD_WEB)
|
||||
if(BUILD_WEB)
|
||||
add_subdirectory(Web)
|
||||
endif(FREECAD_BUILD_WEB)
|
||||
endif(BUILD_WEB)
|
||||
|
||||
if(FREECAD_BUILD_START)
|
||||
if(BUILD_START)
|
||||
add_subdirectory(Start)
|
||||
endif(FREECAD_BUILD_START)
|
||||
endif(BUILD_START)
|
||||
|
||||
if(FREECAD_BUILD_IDF)
|
||||
if(BUILD_IDF)
|
||||
add_subdirectory(Idf)
|
||||
endif(FREECAD_BUILD_IDF)
|
||||
endif(BUILD_IDF)
|
||||
|
||||
if(FREECAD_BUILD_IMPORT)
|
||||
if(BUILD_IMPORT)
|
||||
add_subdirectory(Import)
|
||||
endif(FREECAD_BUILD_IMPORT)
|
||||
endif(BUILD_IMPORT)
|
||||
|
||||
if(FREECAD_BUILD_INSPECTION)
|
||||
if(BUILD_INSPECTION)
|
||||
add_subdirectory(Inspection)
|
||||
endif(FREECAD_BUILD_INSPECTION)
|
||||
endif(BUILD_INSPECTION)
|
||||
|
||||
if(FREECAD_BUILD_ARCH)
|
||||
if(BUILD_ARCH)
|
||||
add_subdirectory(Arch)
|
||||
endif(FREECAD_BUILD_ARCH)
|
||||
endif(BUILD_ARCH)
|
||||
|
||||
if(FREECAD_BUILD_ASSEMBLY)
|
||||
if(BUILD_ASSEMBLY)
|
||||
add_subdirectory(Assembly)
|
||||
endif(FREECAD_BUILD_ASSEMBLY)
|
||||
endif(BUILD_ASSEMBLY)
|
||||
|
||||
if(FREECAD_BUILD_CAM)
|
||||
if(BUILD_CAM)
|
||||
add_subdirectory(Cam)
|
||||
endif(FREECAD_BUILD_CAM)
|
||||
endif(BUILD_CAM)
|
||||
|
||||
if(FREECAD_BUILD_FEM)
|
||||
if(BUILD_FEM)
|
||||
add_subdirectory(Fem)
|
||||
endif(FREECAD_BUILD_FEM)
|
||||
endif(BUILD_FEM)
|
||||
|
||||
if(FREECAD_BUILD_SANDBOX)
|
||||
if(BUILD_SANDBOX)
|
||||
add_subdirectory(Sandbox)
|
||||
endif(FREECAD_BUILD_SANDBOX)
|
||||
endif(BUILD_SANDBOX)
|
||||
|
||||
if(FREECAD_BUILD_SHIP)
|
||||
if(BUILD_SHIP)
|
||||
add_subdirectory(Ship)
|
||||
endif(FREECAD_BUILD_SHIP)
|
||||
endif(BUILD_SHIP)
|
||||
|
||||
if(FREECAD_BUILD_OPENSCAD)
|
||||
if(BUILD_OPENSCAD)
|
||||
add_subdirectory(OpenSCAD)
|
||||
endif(FREECAD_BUILD_OPENSCAD)
|
||||
endif(BUILD_OPENSCAD)
|
||||
|
||||
if(FREECAD_BUILD_PLOT)
|
||||
if(BUILD_PLOT)
|
||||
add_subdirectory(Plot)
|
||||
endif(FREECAD_BUILD_PLOT)
|
||||
endif(BUILD_PLOT)
|
||||
|
||||
if(FREECAD_BUILD_SPREADSHEET)
|
||||
if(BUILD_SPREADSHEET)
|
||||
add_subdirectory(Spreadsheet)
|
||||
endif(FREECAD_BUILD_SPREADSHEET)
|
||||
endif(BUILD_SPREADSHEET)
|
||||
|
||||
if(FREECAD_BUILD_JTREADER)
|
||||
if(BUILD_JTREADER)
|
||||
add_subdirectory(JtReader)
|
||||
endif(FREECAD_BUILD_JTREADER)
|
||||
endif(BUILD_JTREADER)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -106,7 +106,6 @@
|
|||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_Storable.hxx>
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <Standard_String.hxx>
|
||||
#include <Standard_TooManyUsers.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Transient_proto.hxx>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -98,7 +98,6 @@ void pagesize(string & page_template, int dims[4], int block[4])
|
|||
catch (Standard_Failure)
|
||||
{ }
|
||||
|
||||
file.close();
|
||||
|
||||
if (t3 != 0)
|
||||
{
|
||||
|
|
|
@ -4,9 +4,9 @@ else(MSVC)
|
|||
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
|
||||
endif(MSVC)
|
||||
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DFCWithNetgen)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
|
||||
include_directories(
|
||||
|
@ -27,7 +27,7 @@ include_directories(
|
|||
link_directories(${OCC_LIBRARY_DIR})
|
||||
|
||||
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
set(Fem_LIBS
|
||||
Part
|
||||
FreeCADApp
|
||||
|
@ -35,14 +35,14 @@ if(FREECAD_BUILD_FEM_NETGEN)
|
|||
NETGENPlugin
|
||||
SMESH
|
||||
)
|
||||
else(FREECAD_BUILD_FEM_NETGEN)
|
||||
else(BUILD_FEM_NETGEN)
|
||||
set(Fem_LIBS
|
||||
Part
|
||||
FreeCADApp
|
||||
StdMeshers
|
||||
SMESH
|
||||
)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
generate_from_xml(FemMeshPy)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
|
||||
INSTALL(
|
||||
|
|
|
@ -4,9 +4,9 @@ else(MSVC)
|
|||
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
|
||||
endif(MSVC)
|
||||
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DFCWithNetgen)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
|
|
|
@ -2,8 +2,12 @@ if(WIN32)
|
|||
add_definitions(-DFCAppImage)
|
||||
endif(WIN32)
|
||||
|
||||
if(OPENCV2_FOUND)
|
||||
add_definitions(-DHAVE_OPENCV2)
|
||||
endif(OPENCV2_FOUND)
|
||||
|
||||
include_directories(
|
||||
#${OPENCV_INCLUDE_DIR}
|
||||
${OPENCV_INCLUDE2_DIR}
|
||||
${PYTHON_INCLUDE_PATH}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
|
@ -12,13 +16,11 @@ include_directories(
|
|||
)
|
||||
|
||||
set(Image_LIBS
|
||||
#${OPENCV_LIBRARIES}
|
||||
${OPENCV2_LIBRARIES}
|
||||
FreeCADApp
|
||||
)
|
||||
|
||||
set(Image_SRCS
|
||||
#CaptureClass.cpp
|
||||
#CaptureClass.h
|
||||
ImageBase.cpp
|
||||
ImageBase.h
|
||||
ImagePlane.cpp
|
||||
|
|
|
@ -1,147 +0,0 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2007 *
|
||||
* *
|
||||
* 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 <stdio.h>
|
||||
#endif
|
||||
|
||||
#include "CaptureClass.h"
|
||||
|
||||
#ifdef _MSC_VER // this file is not available on Linux
|
||||
//# include <cvcam.h>
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
/// Constructor with an Capture number, 0 will ask for one
|
||||
Capturerer::Capturerer(int num)
|
||||
: capture(NULL),captureImage(0),_bIsWinOn(false)
|
||||
{
|
||||
capture = cvCaptureFromCAM( num );
|
||||
|
||||
if( !capture )
|
||||
throw "Cant create capture device";
|
||||
|
||||
hScale=0.5;
|
||||
vScale=0.5;
|
||||
lineWidth=1;
|
||||
useLabel=true;
|
||||
|
||||
// Init font
|
||||
cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX/*|CV_FONT_ITALIC*/, hScale,vScale,0,lineWidth);
|
||||
|
||||
|
||||
}
|
||||
/// Constructor with an File name. Object will capture from that Video file
|
||||
Capturerer::Capturerer(const char* fileName)
|
||||
: capture(NULL), captureImage(0),_bIsWinOn(false)
|
||||
{
|
||||
capture = cvCaptureFromAVI( fileName );
|
||||
|
||||
if( !capture )
|
||||
throw "Cant create capture device";
|
||||
|
||||
}
|
||||
|
||||
int Capturerer::chooseCamNum(void)
|
||||
{
|
||||
#if 0
|
||||
int ncams = cvcamGetCamerasCount( );//returns the number of available cameras in the system
|
||||
//printf("Number of Cams: %d\n",ncams);
|
||||
int* out;
|
||||
if(ncams >1){
|
||||
int nselected = cvcamSelectCamera(&out);
|
||||
if(nselected>0)
|
||||
printf("the 1-st selected camera is camera number %d", out[0]);
|
||||
if(nselected == 2)
|
||||
printf("the 2-nd selected camera is camera number %d", out[1]);
|
||||
}else if (ncams < 1){
|
||||
printf("No camara in system! Terminating.\n");
|
||||
return -1;
|
||||
}else
|
||||
out = new int(0);
|
||||
|
||||
return *out;
|
||||
#else
|
||||
//FIXME: cvcamGetCamerasCount is not available on Linux
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
Capturerer::~Capturerer()
|
||||
{
|
||||
if(_bIsWinOn)
|
||||
cvDestroyWindow("Capture");
|
||||
if(capture)
|
||||
cvReleaseCapture(&capture);
|
||||
}
|
||||
|
||||
|
||||
void Capturerer::setCaptureWindows(bool On)
|
||||
{
|
||||
if(!_bIsWinOn && On)
|
||||
{
|
||||
cvNamedWindow( "Capture", 0 );
|
||||
_bIsWinOn = true;
|
||||
}
|
||||
if(_bIsWinOn && !On)
|
||||
{
|
||||
cvDestroyWindow("Capture");
|
||||
_bIsWinOn = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char Capturerer::getOneCapture(const char *text)
|
||||
{
|
||||
//static int i = 0;
|
||||
// Get frame
|
||||
IplImage* frame = NULL;
|
||||
frame = cvQueryFrame( capture );
|
||||
|
||||
if( !frame )
|
||||
throw "Cannot get frame";
|
||||
|
||||
if(! captureImage)
|
||||
size = cvGetSize(frame);
|
||||
captureImage = cvCreateImage( size, 8, 3 );
|
||||
|
||||
// copy memory frame to image
|
||||
cvCopy( frame, captureImage, 0 );
|
||||
|
||||
// Flip
|
||||
cvFlip(captureImage, captureImage);
|
||||
|
||||
// label
|
||||
if (text)
|
||||
cvPutText (captureImage,text, cvPoint(0,size.height - 5) , &font, cvScalar(0,255,0));
|
||||
|
||||
|
||||
if(_bIsWinOn)
|
||||
cvShowImage( "Capture", captureImage );
|
||||
|
||||
return cvWaitKey(1);
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
|
||||
if(OPENCV2_FOUND)
|
||||
add_definitions(-DHAVE_OPENCV2)
|
||||
endif(OPENCV2_FOUND)
|
||||
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${COIN3D_INCLUDE_DIR}
|
||||
#${OPENCV_INCLUDE_DIR}
|
||||
${OPENCV2_INCLUDE_DIR}
|
||||
${QT_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${SOQT_INCLUDE_DIR}
|
||||
|
@ -13,7 +19,7 @@ include_directories(
|
|||
set(ImageGui_LIBS
|
||||
Image
|
||||
FreeCADGui
|
||||
#${OpenCV_LIBRARIES}
|
||||
${OpenCV2_LIBRARIES}
|
||||
${OPENGL_glu_LIBRARY}
|
||||
)
|
||||
|
||||
|
|
|
@ -31,10 +31,9 @@
|
|||
#include <Gui/BitmapFactory.h>
|
||||
#include "ImageOrientationDialog.h"
|
||||
|
||||
//#include <Mod/Image/App/CaptureClass.h>
|
||||
|
||||
//#include <cv.h>
|
||||
//#include <highgui.h>
|
||||
#if HAVE_OPENCV2
|
||||
# include "opencv2/opencv.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
#include "ImageView.h"
|
||||
|
@ -148,7 +147,7 @@ bool CmdCreateImagePlane::isActive()
|
|||
}
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#if 0
|
||||
#if HAVE_OPENCV2
|
||||
DEF_STD_CMD(CmdImageCapturerTest);
|
||||
|
||||
CmdImageCapturerTest::CmdImageCapturerTest()
|
||||
|
@ -165,69 +164,26 @@ CmdImageCapturerTest::CmdImageCapturerTest()
|
|||
|
||||
void CmdImageCapturerTest::activated(int iMsg)
|
||||
{
|
||||
#if 0
|
||||
// Reading an image
|
||||
QString s = QFileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an image file to open"), QString::null,
|
||||
QObject::tr("Images (*.png *.xpm *.jpg *.bmp)"));
|
||||
if (s.isEmpty()) return;
|
||||
using namespace cv;
|
||||
|
||||
IplImage* image = cvLoadImage(
|
||||
(const char*)s.toLatin1(),
|
||||
CV_LOAD_IMAGE_GRAYSCALE
|
||||
);
|
||||
IplImage* src = cvLoadImage( (const char*)s.toLatin1() ); //Changed for prettier show in color
|
||||
CvMemStorage* storage = cvCreateMemStorage(0);
|
||||
cvSmooth(image, image, CV_GAUSSIAN, 5, 5 );
|
||||
CvSeq* results = cvHoughCircles(
|
||||
image,
|
||||
storage,
|
||||
CV_HOUGH_GRADIENT,
|
||||
2,
|
||||
image->width/10
|
||||
);
|
||||
for( int i = 0; i < results->total; i++ ) {
|
||||
float* p = (float*) cvGetSeqElem( results, i );
|
||||
CvPoint pt = cvPoint( cvRound( p[0] ), cvRound( p[1] ) );
|
||||
cvCircle(
|
||||
src,
|
||||
pt,
|
||||
cvRound( p[2] ),
|
||||
CV_RGB(0xff,0,0)
|
||||
);
|
||||
}
|
||||
cvNamedWindow( "cvHoughCircles", 1 );
|
||||
cvShowImage( "cvHoughCircles", src);
|
||||
cvWaitKey(0);
|
||||
#else
|
||||
struct tm *newtime;
|
||||
#if defined (_MSC_VER)
|
||||
struct _timeb tstruct;
|
||||
__int64 ltime;
|
||||
#elif defined(__GNUC__)
|
||||
struct timeb tstruct;
|
||||
time_t ltime;
|
||||
#endif
|
||||
VideoCapture cap(0); // open the default camera
|
||||
if(!cap.isOpened()) // check if we succeeded
|
||||
return;
|
||||
|
||||
char buff[100];
|
||||
Capturerer cap(Capturerer::chooseCamNum());
|
||||
cap.setCaptureWindows(true);
|
||||
for(int i = 0; i< 200;i++){
|
||||
#if defined (_MSC_VER)
|
||||
_ftime( &tstruct );
|
||||
_time64( <ime );
|
||||
// Obtain coordinated universal time:
|
||||
newtime = _gmtime64( <ime ); // C4996
|
||||
#elif defined(__GNUC__)
|
||||
ftime( &tstruct );
|
||||
time( <ime );
|
||||
// Obtain coordinated universal time:
|
||||
newtime = gmtime( <ime ); // C4996
|
||||
#endif
|
||||
sprintf(buff,"%2d:%2d:%2d:%3d - %4d",newtime->tm_hour,newtime->tm_min,newtime->tm_sec,tstruct.millitm,i );
|
||||
if (cap.getOneCapture(buff)==27)
|
||||
break;
|
||||
Mat edges;
|
||||
namedWindow("edges",1);
|
||||
for(;;)
|
||||
{
|
||||
Mat frame;
|
||||
cap >> frame; // get a new frame from camera
|
||||
cvtColor(frame, edges, CV_BGR2GRAY);
|
||||
GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
|
||||
Canny(edges, edges, 0, 30, 3);
|
||||
imshow("edges", edges);
|
||||
if(waitKey(30) >= 0) break;
|
||||
}
|
||||
#endif
|
||||
// the camera will be deinitialized automatically in VideoCapture destructor
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -237,5 +193,7 @@ void CreateImageCommands(void)
|
|||
|
||||
rcCmdMgr.addCommand(new CmdImageOpen());
|
||||
rcCmdMgr.addCommand(new CmdCreateImagePlane());
|
||||
//rcCmdMgr.addCommand(new CmdImageCapturerTest());
|
||||
#if HAVE_OPENCV2
|
||||
rcCmdMgr.addCommand(new CmdImageCapturerTest());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
|||
Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
|
||||
Gui::ToolBarItem* part = new Gui::ToolBarItem(root);
|
||||
part->setCommand("Image");
|
||||
*part << "Image_Open" << "Image_CreateImagePlane";
|
||||
*part << "Image_Open" << "Image_CreateImagePlane"<< "Image_CapturerTest";
|
||||
return root;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const
|
|||
Gui::ToolBarItem* root = new Gui::ToolBarItem;
|
||||
Gui::ToolBarItem* img = new Gui::ToolBarItem(root);
|
||||
img->setCommand("Image");
|
||||
*img << "Image_Open"/* << "Image_CapturerTest"*/;
|
||||
*img << "Image_Open" << "Image_CapturerTest";
|
||||
return root;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -52,9 +52,9 @@ namespace ublas = boost::numeric::ublas;
|
|||
extern "C" void LAPACK_DGESV (int const* n, int const* nrhs,
|
||||
double* a, int const* lda, int* ipiv,
|
||||
double* b, int const* ldb, int* info);
|
||||
#elif defined(FC_USE_EIGEN)
|
||||
# include <Eigen/LeastSquares>
|
||||
|
||||
#endif
|
||||
|
||||
# include <Eigen/LeastSquares>
|
||||
|
||||
using namespace MeshCore;
|
||||
|
|
|
@ -368,8 +368,7 @@ bool MeshEvalTopology::Evaluate ()
|
|||
else {
|
||||
if (count > 2) {
|
||||
// Edge that is shared by more than 2 facets
|
||||
nonManifoldList.push_back(std::make_pair
|
||||
<unsigned long, unsigned long>(p0, p1));
|
||||
nonManifoldList.push_back(std::make_pair(p0, p1));
|
||||
nonManifoldFacets.push_back(facets);
|
||||
}
|
||||
|
||||
|
@ -395,7 +394,7 @@ void MeshEvalTopology::GetFacetManifolds (std::vector<unsigned long> &raclFacetI
|
|||
for (int i = 0; i < 3; i++) {
|
||||
unsigned long ulPt0 = std::min<unsigned long>(pI->_aulPoints[i], pI->_aulPoints[(i+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(pI->_aulPoints[i], pI->_aulPoints[(i+1)%3]);
|
||||
std::pair<unsigned long, unsigned long> edge = std::make_pair<unsigned long, unsigned long>(ulPt0, ulPt1);
|
||||
std::pair<unsigned long,unsigned long> edge = std::make_pair(ulPt0, ulPt1);
|
||||
|
||||
if (std::find(nonManifoldList.begin(), nonManifoldList.end(), edge) != nonManifoldList.end())
|
||||
raclFacetIndList.push_back(pI - rclFAry.begin());
|
||||
|
@ -745,8 +744,7 @@ void MeshEvalSelfIntersection::GetIntersections(std::vector<std::pair<unsigned l
|
|||
facet2 = *cMFI;
|
||||
int ret = facet1.IntersectWithFacet(facet2, pt1, pt2);
|
||||
if (ret == 2) {
|
||||
intersection.push_back(std::make_pair
|
||||
<unsigned long, unsigned long>(*it,*jt));
|
||||
intersection.push_back(std::make_pair (*it,*jt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ unsigned long MeshKernel::AddFacets(const std::vector<MeshFacet> &rclFAry)
|
|||
unsigned long ulT1 = pF->_aulPoints[(i+1)%3];
|
||||
unsigned long ulP0 = std::min<unsigned long>(ulT0, ulT1);
|
||||
unsigned long ulP1 = std::max<unsigned long>(ulT0, ulT1);
|
||||
edgeMap[std::make_pair<unsigned long, unsigned long>(ulP0, ulP1)].push_front(k);
|
||||
edgeMap[std::make_pair(ulP0, ulP1)].push_front(k);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ unsigned long MeshKernel::AddFacets(const std::vector<MeshFacet> &rclFAry)
|
|||
unsigned long ulT1 = pF->_aulPoints[(i+1)%3];
|
||||
unsigned long ulP0 = std::min<unsigned long>(ulT0, ulT1);
|
||||
unsigned long ulP1 = std::max<unsigned long>(ulT0, ulT1);
|
||||
std::pair<unsigned long, unsigned long> edge = std::make_pair<unsigned long, unsigned long>(ulP0, ulP1);
|
||||
std::pair<unsigned long, unsigned long> edge = std::make_pair(ulP0, ulP1);
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::list<unsigned long> >::iterator pI = edgeMap.find(edge);
|
||||
// Does the current facet share the same edge?
|
||||
if (pI != edgeMap.end()) {
|
||||
|
|
|
@ -444,7 +444,7 @@ void MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection()
|
|||
unsigned long ulT1 = jt->_aulPoints[(i+1)%3];
|
||||
unsigned long ulP0 = std::min<unsigned long>(ulT0, ulT1);
|
||||
unsigned long ulP1 = std::max<unsigned long>(ulT0, ulT1);
|
||||
aclEdgeMap[std::make_pair<unsigned long, unsigned long>(ulP0, ulP1)].push_front(k);
|
||||
aclEdgeMap[std::make_pair(ulP0, ulP1)].push_front(k);
|
||||
aIdx.push_back( (int)jt->_aulPoints[i] );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1147,8 +1147,7 @@ void MeshObject::removeSelfIntersections(const std::vector<unsigned long>& indic
|
|||
for (it = indices.begin(); it != indices.end(); ) {
|
||||
unsigned long id1 = *it; ++it;
|
||||
unsigned long id2 = *it; ++it;
|
||||
selfIntersections.push_back(std::make_pair
|
||||
<unsigned long, unsigned long>(id1,id2));
|
||||
selfIntersections.push_back(std::make_pair(id1,id2));
|
||||
}
|
||||
|
||||
if (!selfIntersections.empty()) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -646,8 +646,7 @@ void ViewProviderMeshSelfIntersections::showDefects(const std::vector<unsigned l
|
|||
for (it = indices.begin(); it != indices.end(); ) {
|
||||
unsigned long id1 = *it; ++it;
|
||||
unsigned long id2 = *it; ++it;
|
||||
intersection.push_back(std::make_pair
|
||||
<unsigned long, unsigned long>(id1,id2));
|
||||
intersection.push_back(std::make_pair(id1,id2));
|
||||
}
|
||||
|
||||
std::vector<std::pair<Base::Vector3f, Base::Vector3f> > lines;
|
||||
|
|
|
@ -4,13 +4,13 @@ else(MSVC)
|
|||
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
|
||||
endif(MSVC)
|
||||
|
||||
if (FREECAD_BUILD_SMESH)
|
||||
if (BUILD_SMESH)
|
||||
add_definitions(-DHAVE_SMESH -DHAVE_MEFISTO)
|
||||
endif(FREECAD_BUILD_SMESH)
|
||||
endif(BUILD_SMESH)
|
||||
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DHAVE_NETGEN)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
|
@ -27,7 +27,7 @@ include_directories(
|
|||
link_directories(${OCC_LIBRARY_DIR})
|
||||
|
||||
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
set(MeshPart_LIBS
|
||||
Part
|
||||
Mesh
|
||||
|
@ -35,14 +35,14 @@ if(FREECAD_BUILD_FEM_NETGEN)
|
|||
NETGENPlugin
|
||||
SMESH
|
||||
)
|
||||
else(FREECAD_BUILD_FEM_NETGEN)
|
||||
else(BUILD_FEM_NETGEN)
|
||||
set(MeshPart_LIBS
|
||||
Part
|
||||
Mesh
|
||||
StdMeshers
|
||||
SMESH
|
||||
)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
|
||||
SET(MeshPart_SRCS
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -4,13 +4,13 @@ else(MSVC)
|
|||
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
|
||||
endif(MSVC)
|
||||
|
||||
if (FREECAD_BUILD_SMESH)
|
||||
if (BUILD_SMESH)
|
||||
add_definitions(-DHAVE_SMESH -DHAVE_MEFISTO)
|
||||
endif(FREECAD_BUILD_SMESH)
|
||||
endif(BUILD_SMESH)
|
||||
|
||||
if(FREECAD_BUILD_FEM_NETGEN)
|
||||
if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DHAVE_NETGEN)
|
||||
endif(FREECAD_BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
|
|
|
@ -97,6 +97,8 @@ void PartExport initPart()
|
|||
str << OCC_VERSION_MAJOR << "." << OCC_VERSION_MINOR << "." << OCC_VERSION_MAINTENANCE;
|
||||
App::Application::Config()["OCC_VERSION"] = str.str();
|
||||
|
||||
Base::Console().Log("Module: Part\n");
|
||||
|
||||
// This is highly experimental and we should keep an eye on it
|
||||
// if we have mysterious crashes
|
||||
// The argument must be 'Standard_False' to avoid FPE caused by
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -34,6 +34,13 @@
|
|||
#include <App/DocumentObject.h>
|
||||
#include <App/Property.h>
|
||||
|
||||
// PCL test
|
||||
#ifdef HAVE_PCL
|
||||
# include <iostream>
|
||||
# include <pcl/io/ply_io.h>
|
||||
# include <pcl/point_types.h>
|
||||
#endif
|
||||
|
||||
#include "Points.h"
|
||||
#include "PointsPy.h"
|
||||
#include "PointsAlgos.h"
|
||||
|
@ -66,6 +73,27 @@ open(PyObject *self, PyObject *args)
|
|||
pcFeature->Points.setValue( pkTemp );
|
||||
|
||||
}
|
||||
#ifdef HAVE_PCL
|
||||
else
|
||||
if (file.hasExtension("ply")) {
|
||||
// create new document import
|
||||
App::Document *pcDoc = App::GetApplication().newDocument("Unnamed");
|
||||
Points::Feature *pcFeature = (Points::Feature *)pcDoc->addObject("Points::Feature", file.fileNamePure().c_str());
|
||||
Points::PointKernel pkTemp;
|
||||
|
||||
// pcl test
|
||||
pcl::PointCloud<pcl::PointXYZRGB> cloud_in;
|
||||
pcl::io::loadPLYFile<pcl::PointXYZRGB>(Name,cloud_in);
|
||||
|
||||
for(pcl::PointCloud<pcl::PointXYZRGB>::const_iterator it = cloud_in.begin();it!=cloud_in.end();++it)
|
||||
pkTemp.push_back(Base::Vector3d(it->x,it->y,it->z));
|
||||
|
||||
|
||||
|
||||
pcFeature->Points.setValue( pkTemp );
|
||||
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
Py_Error(PyExc_Exception,"unknown file ending");
|
||||
}
|
||||
|
@ -140,3 +168,4 @@ struct PyMethodDef Points_Import_methods[] = {
|
|||
|
||||
{NULL, NULL} /* end of table marker */
|
||||
};
|
||||
|
||||
|
|
|
@ -2,10 +2,16 @@ if(WIN32)
|
|||
add_definitions(-DFCAppPoints)
|
||||
endif(WIN32)
|
||||
|
||||
if(PCL_FOUND)
|
||||
add_definitions(-DHAVE_PCL)
|
||||
endif(PCL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
${PCL_INCLUDE_DIRS}
|
||||
${PYTHON_INCLUDE_PATH}
|
||||
${XERCESC_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
|
@ -13,6 +19,8 @@ include_directories(
|
|||
|
||||
set(Points_LIBS
|
||||
FreeCADApp
|
||||
${PCL_LIBRARIES}
|
||||
${PCL_DEBUG_LIBRARIES}
|
||||
)
|
||||
|
||||
generate_from_xml(PointsPy)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
|
||||
if(PCL_FOUND)
|
||||
add_definitions(-DHAVE_PCL)
|
||||
endif(PCL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
|
|
|
@ -36,5 +36,6 @@ ParGrp.SetString("WorkBenchName", "Points Design")
|
|||
|
||||
# Append the open handler
|
||||
FreeCAD.EndingAdd("Point formats (*.asc)","Points")
|
||||
FreeCAD.EndingAdd("Ply points (*.ply)","Points")
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -32,8 +32,12 @@
|
|||
#include <Base/Console.h>
|
||||
|
||||
#include <Mod/Part/App/BSplineSurfacePy.h>
|
||||
#include <Mod/Mesh/App/Mesh.h>
|
||||
#include <Mod/Mesh/App/MeshPy.h>
|
||||
#include <Mod/Points/App/PointsPy.h>
|
||||
|
||||
#include "ApproxSurface.h"
|
||||
#include "SurfaceTriangulation.h"
|
||||
|
||||
using namespace Reen;
|
||||
|
||||
|
@ -75,8 +79,31 @@ static PyObject * approxSurface(PyObject *self, PyObject *args)
|
|||
} PY_CATCH;
|
||||
}
|
||||
|
||||
#if defined(PCL_FOUND)
|
||||
static PyObject *
|
||||
triangulate(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *pcObj;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(Points::PointsPy::Type), &pcObj))
|
||||
return NULL;
|
||||
|
||||
Points::PointsPy* pPoints = static_cast<Points::PointsPy*>(pcObj);
|
||||
Points::PointKernel* points = pPoints->getPointKernelPtr();
|
||||
|
||||
Mesh::MeshObject* mesh = new Mesh::MeshObject();
|
||||
SurfaceTriangulation tria(*points, *mesh);
|
||||
tria.perform();
|
||||
|
||||
return new Mesh::MeshPy(mesh);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* registration table */
|
||||
struct PyMethodDef ReverseEngineering_methods[] = {
|
||||
{"approxSurface" , approxSurface, 1},
|
||||
#if defined(PCL_FOUND)
|
||||
{"triangulate" , triangulate, 1},
|
||||
#endif
|
||||
{NULL, NULL} /* end of table marker */
|
||||
};
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@ else(MSVC)
|
|||
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
|
||||
endif(MSVC)
|
||||
|
||||
if (PCL_FOUND)
|
||||
add_definitions(-DPCL_FOUND)
|
||||
endif(PCL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${Boost_INCLUDE_DIRS}
|
||||
|
@ -11,6 +15,9 @@ include_directories(
|
|||
${PYTHON_INCLUDE_PATH}
|
||||
${XERCESC_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
${PCL_INCLUDE_DIRS}
|
||||
${FLANN_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
|
@ -18,7 +25,12 @@ link_directories(${OCC_LIBRARY_DIR})
|
|||
set(Reen_LIBS
|
||||
Part
|
||||
Mesh
|
||||
Points
|
||||
FreeCADApp
|
||||
${PCL_COMMON_LIBRARIES}
|
||||
${PCL_KDTREE_LIBRARIES}
|
||||
${PCL_FEATURES_LIBRARIES}
|
||||
${PCL_SURFACE_LIBRARIES}
|
||||
)
|
||||
|
||||
SET(Reen_SRCS
|
||||
|
@ -26,6 +38,8 @@ SET(Reen_SRCS
|
|||
AppReverseEngineeringPy.cpp
|
||||
ApproxSurface.cpp
|
||||
ApproxSurface.h
|
||||
SurfaceTriangulation.cpp
|
||||
SurfaceTriangulation.h
|
||||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
)
|
||||
|
|
|
@ -31,10 +31,12 @@
|
|||
# define ReenExport __declspec(dllexport)
|
||||
# define PartExport __declspec(dllimport)
|
||||
# define MeshExport __declspec(dllimport)
|
||||
# define PointsExport __declspec(dllimport)
|
||||
#else // for Linux
|
||||
# define ReenExport
|
||||
# define PartExport
|
||||
# define MeshExport
|
||||
# define PointsExport
|
||||
#endif
|
||||
|
||||
#ifdef _PreComp_
|
||||
|
|
159
src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp
Normal file
159
src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp
Normal file
|
@ -0,0 +1,159 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) 2012 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
* 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"
|
||||
|
||||
#include "SurfaceTriangulation.h"
|
||||
#include <Mod/Points/App/Points.h>
|
||||
#include <Mod/Mesh/App/Mesh.h>
|
||||
#include <Mod/Mesh/App/Core/Elements.h>
|
||||
#include <Mod/Mesh/App/Core/MeshKernel.h>
|
||||
|
||||
// http://svn.pointclouds.org/pcl/tags/pcl-1.5.1/test/
|
||||
#if defined(PCL_FOUND)
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl/features/normal_3d.h>
|
||||
#include <pcl/surface/mls.h>
|
||||
#include <pcl/point_traits.h>
|
||||
#include <pcl/surface/gp3.h>
|
||||
#include <pcl/surface/grid_projection.h>
|
||||
#include <pcl/surface/convex_hull.h>
|
||||
#include <pcl/surface/concave_hull.h>
|
||||
#include <pcl/surface/organized_fast_mesh.h>
|
||||
#include <pcl/surface/ear_clipping.h>
|
||||
#include <pcl/common/common.h>
|
||||
#include <boost/random.hpp>
|
||||
|
||||
using namespace pcl;
|
||||
using namespace pcl::io;
|
||||
using namespace std;
|
||||
using namespace Reen;
|
||||
|
||||
SurfaceTriangulation::SurfaceTriangulation(const Points::PointKernel& pts, Mesh::MeshObject& mesh)
|
||||
: myPoints(pts), myMesh(mesh)
|
||||
{
|
||||
}
|
||||
|
||||
void SurfaceTriangulation::perform()
|
||||
{
|
||||
PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ>);
|
||||
PointCloud<PointNormal>::Ptr cloud_with_normals (new PointCloud<PointNormal>);
|
||||
search::KdTree<PointXYZ>::Ptr tree;
|
||||
search::KdTree<PointNormal>::Ptr tree2;
|
||||
|
||||
for (Points::PointKernel::const_iterator it = myPoints.begin(); it != myPoints.end(); ++it) {
|
||||
cloud->push_back(PointXYZ(it->x, it->y, it->z));
|
||||
}
|
||||
|
||||
// Create search tree
|
||||
tree.reset (new search::KdTree<PointXYZ> (false));
|
||||
tree->setInputCloud (cloud);
|
||||
|
||||
// Normal estimation
|
||||
NormalEstimation<PointXYZ, Normal> n;
|
||||
PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ());
|
||||
n.setInputCloud (cloud);
|
||||
//n.setIndices (indices[B);
|
||||
n.setSearchMethod (tree);
|
||||
n.setKSearch (20);
|
||||
n.compute (*normals);
|
||||
|
||||
// Concatenate XYZ and normal information
|
||||
pcl::concatenateFields (*cloud, *normals, *cloud_with_normals);
|
||||
|
||||
// Create search tree
|
||||
tree2.reset (new search::KdTree<PointNormal>);
|
||||
tree2->setInputCloud (cloud_with_normals);
|
||||
|
||||
// Init objects
|
||||
GreedyProjectionTriangulation<PointNormal> gp3;
|
||||
|
||||
// Set parameters
|
||||
gp3.setInputCloud (cloud_with_normals);
|
||||
gp3.setSearchMethod (tree2);
|
||||
gp3.setSearchRadius (2.025);
|
||||
gp3.setMu (2.5);
|
||||
gp3.setMaximumNearestNeighbors (100);
|
||||
gp3.setMaximumSurfaceAngle(M_PI/4); // 45 degrees
|
||||
gp3.setMinimumAngle(M_PI/18); // 10 degrees
|
||||
gp3.setMaximumAngle(2*M_PI/3); // 120 degrees
|
||||
gp3.setNormalConsistency(false);
|
||||
|
||||
// Reconstruct
|
||||
PolygonMesh mesh;
|
||||
gp3.reconstruct (mesh);
|
||||
|
||||
// number of points
|
||||
int nr_points = mesh.cloud.width * mesh.cloud.height;
|
||||
int point_size = mesh.cloud.data.size () / nr_points;
|
||||
// number of faces for header
|
||||
int nr_faces = mesh.polygons.size ();
|
||||
|
||||
MeshCore::MeshPointArray points;
|
||||
points.reserve(nr_points);
|
||||
MeshCore::MeshFacetArray facets;
|
||||
facets.reserve(nr_faces);
|
||||
|
||||
// get vertices
|
||||
MeshCore::MeshPoint vertex;
|
||||
for (int i = 0; i < nr_points; ++i) {
|
||||
int xyz = 0;
|
||||
for (size_t d = 0; d < mesh.cloud.fields.size(); ++d) {
|
||||
int c = 0;
|
||||
// adding vertex
|
||||
if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
|
||||
mesh.cloud.fields[d].name == "x" ||
|
||||
mesh.cloud.fields[d].name == "y" ||
|
||||
mesh.cloud.fields[d].name == "z"))
|
||||
{
|
||||
float value;
|
||||
memcpy (&value, &mesh.cloud.data[i * point_size + mesh.cloud.fields[d].offset + c * sizeof (float)], sizeof (float));
|
||||
vertex[xyz] = value;
|
||||
if (++xyz == 3) {
|
||||
points.push_back(vertex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// get faces
|
||||
MeshCore::MeshFacet face;
|
||||
for(int i = 0; i < nr_faces; i++) {
|
||||
face._aulPoints[0] = mesh.polygons[i].vertices[0];
|
||||
face._aulPoints[1] = mesh.polygons[i].vertices[1];
|
||||
face._aulPoints[2] = mesh.polygons[i].vertices[2];
|
||||
facets.push_back(face);
|
||||
}
|
||||
|
||||
MeshCore::MeshKernel kernel;
|
||||
kernel.Adopt(points, facets, true);
|
||||
myMesh.swap(kernel);
|
||||
myMesh.harmonizeNormals();
|
||||
|
||||
// Additional vertex information
|
||||
//std::vector<int> parts = gp3.getPartIDs();
|
||||
//std::vector<int> states = gp3.getPointStates();
|
||||
}
|
||||
|
||||
#endif // PCL_FOUND
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2007 *
|
||||
* Copyright (c) 2012 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
@ -21,51 +21,26 @@
|
|||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef CaptureClassH
|
||||
#define CaptureClassH
|
||||
#ifndef REEN_SURFACETRIANGULATION_H
|
||||
#define REEN_SURFACETRIANGULATION_H
|
||||
|
||||
namespace Points {class PointKernel;}
|
||||
namespace Mesh {class MeshObject;}
|
||||
|
||||
#include <cv.h>
|
||||
#include <highgui.h>
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Reen {
|
||||
|
||||
class ImageAppExport Capturerer
|
||||
class SurfaceTriangulation
|
||||
{
|
||||
public:
|
||||
/// Constructor with an Capture number, 0 will ask for one
|
||||
Capturerer(int num = 0);
|
||||
/// Constructor with an File name. Object will capture from that Video file
|
||||
Capturerer(const char* fileName);
|
||||
|
||||
~Capturerer();
|
||||
|
||||
static int chooseCamNum(void);
|
||||
|
||||
void setCaptureWindows(bool On);
|
||||
|
||||
char getOneCapture(const char *text=0);
|
||||
SurfaceTriangulation(const Points::PointKernel&, Mesh::MeshObject&);
|
||||
void perform();
|
||||
|
||||
private:
|
||||
CvCapture* capture;
|
||||
IplImage *captureImage;
|
||||
bool _bIsWinOn;
|
||||
|
||||
CvSize size;
|
||||
|
||||
// font stuff
|
||||
CvFont font;
|
||||
double hScale;
|
||||
double vScale;
|
||||
int lineWidth;
|
||||
bool useLabel;
|
||||
char buff[100];
|
||||
|
||||
|
||||
const Points::PointKernel& myPoints;
|
||||
Mesh::MeshObject& myMesh;
|
||||
};
|
||||
|
||||
} // namespace Reen
|
||||
|
||||
#endif // REEN_SURFACETRIANGULATION_H
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1871,7 +1871,7 @@ int Sketch::setDatum(int constrId, double value)
|
|||
int Sketch::getPointId(int geoId, PointPos pos) const
|
||||
{
|
||||
// do a range check first
|
||||
if (geoId < 0 || geoId >= Geoms.size())
|
||||
if (geoId < 0 || geoId >= (int)Geoms.size())
|
||||
return -1;
|
||||
switch (pos) {
|
||||
case start:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
@ -11,7 +11,15 @@ INSTALL(
|
|||
SketcherExample.py
|
||||
TestSketcherApp.py
|
||||
TestSketcherGui.py
|
||||
Profiles.py
|
||||
DESTINATION
|
||||
Mod/Sketcher
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
ProfileLib/Hexagon.py
|
||||
ProfileLib/__init__.py
|
||||
DESTINATION
|
||||
Mod/Sketcher/ProfileLib
|
||||
)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
add_subdirectory(StartPage)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -28,6 +28,6 @@ INSTALL(
|
|||
Mod/Test
|
||||
)
|
||||
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
add_subdirectory(App)
|
||||
if(FREECAD_BUILD_GUI)
|
||||
if(BUILD_GUI)
|
||||
add_subdirectory(Gui)
|
||||
endif(FREECAD_BUILD_GUI)
|
||||
endif(BUILD_GUI)
|
||||
|
||||
install(
|
||||
FILES
|
||||
|
|
Loading…
Reference in New Issue
Block a user