From ee64f547652657983030bfb3cba4527b418bf340 Mon Sep 17 00:00:00 2001 From: jriegel Date: Sun, 17 Aug 2014 20:15:12 +0200 Subject: [PATCH] OCL tests --- cMake/UseLibPack10x.cmake | 59 +++++++++++------------------- src/Mod/Part/App/AppPart.cpp | 2 + src/Mod/Points/App/AppPointsPy.cpp | 24 ++++++++++++ src/Mod/Points/App/CMakeLists.txt | 4 ++ src/Mod/Points/Init.py | 1 + 5 files changed, 53 insertions(+), 37 deletions(-) diff --git a/cMake/UseLibPack10x.cmake b/cMake/UseLibPack10x.cmake index 92add10c6c..433839e0fe 100644 --- a/cMake/UseLibPack10x.cmake +++ b/cMake/UseLibPack10x.cmake @@ -32,7 +32,7 @@ set(Boost_LIBRARIES 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 + optimized boost_thread-vc110-mt-1_55.lib ) set(Boost_DEBUG_LIBRARIES debug boost_filesystem-vc110-mt-gd-1_55.lib @@ -41,7 +41,7 @@ set(Boost_DEBUG_LIBRARIES 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 + debug boost_thread-vc110-mt-gd-1_55.lib ) set(Boost_FOUND TRUE) @@ -311,41 +311,26 @@ set(NGLIB_DEBUG_LIBRARIES debug nglibd ) -# OCC -#set(OCC_INCLUDE_DIR C:/Projects/LibPack/oce-0.10.0/include/oce) -#set(OCC_LIBRARY_DIR C:/Projects/LibPack/oce-0.10.0/Win64/lib) -#set(OCC_LIBRARIES -# ${OCC_LIBRARY_DIR}/TKFillet.lib -# ${OCC_LIBRARY_DIR}/TKMesh.lib -# ${OCC_LIBRARY_DIR}/TKernel.lib -# ${OCC_LIBRARY_DIR}/TKG2d.lib -# ${OCC_LIBRARY_DIR}/TKG3d.lib -# ${OCC_LIBRARY_DIR}/TKMath.lib -# ${OCC_LIBRARY_DIR}/TKIGES.lib -# ${OCC_LIBRARY_DIR}/TKSTL.lib -# ${OCC_LIBRARY_DIR}/TKShHealing.lib -# ${OCC_LIBRARY_DIR}/TKXSBase.lib -# ${OCC_LIBRARY_DIR}/TKBool.lib -# ${OCC_LIBRARY_DIR}/TKBO.lib -# ${OCC_LIBRARY_DIR}/TKBRep.lib -# ${OCC_LIBRARY_DIR}/TKTopAlgo.lib -# ${OCC_LIBRARY_DIR}/TKGeomAlgo.lib -# ${OCC_LIBRARY_DIR}/TKGeomBase.lib -# ${OCC_LIBRARY_DIR}/TKOffset.lib -# ${OCC_LIBRARY_DIR}/TKPrim.lib -# ${OCC_LIBRARY_DIR}/TKSTEP.lib -# ${OCC_LIBRARY_DIR}/TKSTEPBase.lib -# ${OCC_LIBRARY_DIR}/TKSTEPAttr.lib -# ${OCC_LIBRARY_DIR}/TKHLR.lib -# ${OCC_LIBRARY_DIR}/TKFeat.lib -#) -#set(OCC_OCAF_LIBRARIES -# ${OCC_LIBRARY_DIR}/TKCAF.lib -# ${OCC_LIBRARY_DIR}/TKXCAF.lib -# ${OCC_LIBRARY_DIR}/TKLCAF.lib -# ${OCC_LIBRARY_DIR}/TKXDESTEP.lib -# ${OCC_LIBRARY_DIR}/TKXDEIGES.lib -#) + +# Pointscloud library +set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.7) +set(PCL_LIBRARIES + optimized pcl_common_release.lib + optimized pcl_kdtree_release.lib + optimized pcl_octree_release.lib + optimized pcl_io_release.lib + optimized pcl_io_ply_release.lib +) +set(PCL_DEBUG_LIBRARIES + debug pcl_common_debug.lib + debug pcl_kdtree_debug.lib + debug pcl_octree_debug.lib + debug pcl_io_debug.lib + debug pcl_io_ply_debug.lib +) +set(PCL_FOUND TRUE) + + set(OCC_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/oce-0.15) set(OCC_LIBRARY_DIR ${FREECAD_LIBPACK_DIR}/lib) set(OCC_LIBRARIES diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index c2bb5f8a83..814bcf0705 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -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 diff --git a/src/Mod/Points/App/AppPointsPy.cpp b/src/Mod/Points/App/AppPointsPy.cpp index 70e8677d8a..ce88cb258c 100644 --- a/src/Mod/Points/App/AppPointsPy.cpp +++ b/src/Mod/Points/App/AppPointsPy.cpp @@ -34,6 +34,13 @@ #include #include +// PCL test + +#include +#include +#include + + #include "Points.h" #include "PointsPy.h" #include "PointsAlgos.h" @@ -63,6 +70,23 @@ open(PyObject *self, PyObject *args) Points::Feature *pcFeature = (Points::Feature *)pcDoc->addObject("Points::Feature", file.fileNamePure().c_str()); Points::PointKernel pkTemp; pkTemp.load(Name); + pcFeature->Points.setValue( pkTemp ); + + } + 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 cloud_in; + pcl::io::loadPLYFile(Name,cloud_in); + + + + pcFeature->Points.setValue( pkTemp ); } diff --git a/src/Mod/Points/App/CMakeLists.txt b/src/Mod/Points/App/CMakeLists.txt index eee2f08ab7..e894afe9e6 100644 --- a/src/Mod/Points/App/CMakeLists.txt +++ b/src/Mod/Points/App/CMakeLists.txt @@ -6,6 +6,8 @@ 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 +15,8 @@ include_directories( set(Points_LIBS FreeCADApp + ${PCL_LIBRARIES} + ${PCL_DEBUG_LIBRARIES} ) generate_from_xml(PointsPy) diff --git a/src/Mod/Points/Init.py b/src/Mod/Points/Init.py index 9b11704d1e..b585e1d9b0 100644 --- a/src/Mod/Points/Init.py +++ b/src/Mod/Points/Init.py @@ -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")