From 215c89fc8fe818d44c5bd5b6f7ca9ec3dee38fa2 Mon Sep 17 00:00:00 2001 From: Tooru Oonuma Date: Fri, 2 Mar 2018 17:49:42 +0900 Subject: [PATCH] rc_patches (#167) * add obj load function. document modified. use UTF-8 BOM off set.(ps1 files UTF-8 BOM) Unnecessary folder reference([setup.py] - pcl/tests) * travis CI python test module changed(remove 3.4, add 3.6) --- .travis.yml | 26 +-- appveyor.yml | 11 ++ docs/source/reference/index.rst | 2 +- docs/source/reference/pcl.rst | 135 ++------------- docs/source/spelling_wordlist.txt | 3 +- docs/source/tutorial/pcl.rst | 125 ++++++++++++++ pcl/__init__.py | 17 +- pcl/_pcl.pxd | 2 +- pcl/pcl_io.pxd | 192 +++++++++++++++------- pcl/pcl_io_172.pxd | 188 ++++++++++++++------- pcl/pcl_io_180.pxd | 188 ++++++++++++++------- pcl/pxi/PointCloud_PCLPointCloud2.pxi | 12 +- pcl/pxi/PointCloud_PointWithViewpoint.pxi | 4 +- pcl/pxi/PointCloud_PointXYZ.pxi | 27 ++- pcl/pxi/PointCloud_PointXYZI.pxi | 29 ++-- pcl/pxi/PointCloud_PointXYZI_172.pxi | 26 ++- pcl/pxi/PointCloud_PointXYZI_180.pxi | 26 ++- pcl/pxi/PointCloud_PointXYZRGB.pxi | 23 ++- pcl/pxi/PointCloud_PointXYZRGBA.pxi | 23 ++- pcl/pxi/PointCloud_PointXYZRGBA_172.pxi | 22 ++- pcl/pxi/PointCloud_PointXYZRGBA_180.pxi | 24 ++- pcl/pxi/PointCloud_PointXYZRGB_172.pxi | 22 ++- pcl/pxi/PointCloud_PointXYZRGB_180.pxi | 22 ++- pcl/pxi/PointCloud_PointXYZ_172.pxi | 24 ++- pcl/pxi/PointCloud_PointXYZ_180.pxi | 27 +-- pkg-config/Install-GTKPlus.ps1 | 2 +- pkg-config/PS-Zip.psm1 | 2 +- setup.py | 41 +++-- 28 files changed, 793 insertions(+), 452 deletions(-) create mode 100644 docs/source/tutorial/pcl.rst diff --git a/.travis.yml b/.travis.yml index 091d30bce..13f37d959 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,12 +18,12 @@ matrix: # - PCL_VERSION="1.7" # - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" # - os: linux - # python: "3.4" + # python: "3.5" # env: # - PCL_VERSION="1.7" # - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" # - os: linux - # python: "3.5" + # python: "3.6" # env: # - PCL_VERSION="1.7" # - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" @@ -41,7 +41,7 @@ matrix: - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - os: linux - python: "3.4" + python: "3.5" addons: apt: sources: @@ -53,7 +53,7 @@ matrix: - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - os: linux - python: "3.5"# + python: "3.6" addons: apt: sources: @@ -84,7 +84,7 @@ matrix: # - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" # - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" # - os: linux - # python: "3.4" + # python: "3.5" # addons: # apt: # sources: @@ -97,7 +97,7 @@ matrix: # - NOSEATTR="not pcl_ver_0_4 and not pcl_over_18" # - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" # - os: linux - # python: "3.5" + # python: "3.6" # addons: # apt: # sources: @@ -116,11 +116,11 @@ matrix: # env: # - PCL_VERSION="1.8" # - os: linux - # python: "3.4" + # python: "3.5" # env: # - PCL_VERSION="1.8" # - os: linux - # python: "3.5" + # python: "3.6" # env: # - PCL_VERSION="1.8" @@ -138,7 +138,7 @@ matrix: language: generic compiler: gcc env: - - PYTHON_VERSION=3.4.3 + - PYTHON_VERSION=3.5.1 - PYENV_ROOT=~/.pyenv - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin - NOSEATTR="not pcl_ver_0_4" @@ -146,7 +146,7 @@ matrix: language: generic compiler: gcc env: - - PYTHON_VERSION=3.5.1 + - PYTHON_VERSION=3.6.0 - PYENV_ROOT=~/.pyenv - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin - NOSEATTR="not pcl_ver_0_4" @@ -164,7 +164,7 @@ matrix: # language: generic # compiler: clang # env: - # - PYTHON_VERSION=3.4.3 + # - PYTHON_VERSION=3.5.1 # - PYENV_ROOT=~/.pyenv # - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin # - NOSEATTR="not pcl_ver_0_4" @@ -172,7 +172,7 @@ matrix: # language: generic # compiler: clang # env: - # - PYTHON_VERSION=3.5.1 + # - PYTHON_VERSION=3.6.0 # - PYENV_ROOT=~/.pyenv # - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin # - NOSEATTR="not pcl_ver_0_4" @@ -180,6 +180,8 @@ matrix: # pcl 1.8.1 only(MacOSX/Ubuntu) # pcl_2d-1.8.pc copy /usr/local/lib/pkgconfig/pcl_2d-1.8.pc +# Check command +# pkg-config pcl_2d-1.8 --libs before_install: - if [ ${TRAVIS_OS_NAME} = "osx" ]; then brew update >/dev/null; diff --git a/appveyor.yml b/appveyor.yml index 6eb4331f1..6679549b0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,17 @@ environment: APPVEYOR_OPENNI_ROOT: ".\\AppVeyor\\OpenNI2\\x64\\Redist" NOSEATTR: "not pcl_ver_0_4" + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + PYTHON: "C:\\Miniconda36-x64" + PYTHON_VERSION: "3.6" + PYTHON_ARCH: "64" + PCL_ROOT: "C:\\Program Files\\PCL 1.8.1" + PCL_VERSION: "1.8" + OPENNI_VERSION: "2.2" + OPENNI_ROOT: "C:\\Program Files\\OpenNI2\\Redist\\" + APPVEYOR_OPENNI_ROOT: ".\\AppVeyor\\OpenNI2\\x64\\Redist" + NOSEATTR: "not pcl_ver_0_4" + install: # If there is a newer build queued for the same PR, cancel this one. # The AppVeyor 'rollout builds' option is supposed to serve the same diff --git a/docs/source/reference/index.rst b/docs/source/reference/index.rst index 4934a069e..658f28ee3 100644 --- a/docs/source/reference/index.rst +++ b/docs/source/reference/index.rst @@ -19,6 +19,6 @@ Reference .. module:: python-pcl .. toctree:: - :maxdepth: 10 + :maxdepth: 1 pcl diff --git a/docs/source/reference/pcl.rst b/docs/source/reference/pcl.rst index 03d49a745..94435042d 100644 --- a/docs/source/reference/pcl.rst +++ b/docs/source/reference/pcl.rst @@ -1,125 +1,22 @@ -pcl -=== +pcl package +=========== -.. automodule:: pcl +Submodules +---------- - - - .. rubric:: Functions +pcl\.\_pcl module(Base PCL1.8.0) +-------------------------------- - .. autosummary:: - - deg2rad - load - load2 - load_PointWithViewpoint - load_XYZI - load_XYZRGB - load_XYZRGBA - rad2deg - save - save2 - save_PointNormal - save_XYZRGBA - - +.. automodule:: pcl._pcl + :members: + :undoc-members: + :show-inheritance: - - - .. rubric:: Classes - .. autosummary:: - - ApproximateVoxelGrid - ApproximateVoxelGrid_PointXYZI - ApproximateVoxelGrid_PointXYZRGB - ApproximateVoxelGrid_PointXYZRGBA - ConcaveHull - ConcaveHull_PointXYZI - ConcaveHull_PointXYZRGB - ConcaveHull_PointXYZRGBA - ConditionAnd - ConditionalRemoval - CropBox - CropHull - EuclideanClusterExtraction - GeneralizedIterativeClosestPoint - HarrisKeypoint3D - IntegralImageNormalEstimation - IterativeClosestPoint - IterativeClosestPointNonLinear - KdTree - KdTreeFLANN - KdTreeFLANN_PointXYZI - KdTreeFLANN_PointXYZRGB - KdTreeFLANN_PointXYZRGBA - MomentOfInertiaEstimation - MovingLeastSquares - MovingLeastSquares_PointXYZRGB - MovingLeastSquares_PointXYZRGBA - NormalDistributionsTransform - NormalEstimation - OctreePointCloud - OctreePointCloud2Buf - OctreePointCloud2Buf_PointXYZI - OctreePointCloud2Buf_PointXYZRGB - OctreePointCloud2Buf_PointXYZRGBA - OctreePointCloudChangeDetector - OctreePointCloudChangeDetector_PointXYZI - OctreePointCloudChangeDetector_PointXYZRGB - OctreePointCloudChangeDetector_PointXYZRGBA - OctreePointCloudSearch - OctreePointCloudSearch_PointXYZI - OctreePointCloudSearch_PointXYZRGB - OctreePointCloudSearch_PointXYZRGBA - OctreePointCloud_PointXYZI - OctreePointCloud_PointXYZRGB - OctreePointCloud_PointXYZRGBA - PCLPointCloud2 - PassThroughFilter - PassThroughFilter_PointXYZI - PassThroughFilter_PointXYZRGB - PassThroughFilter_PointXYZRGBA - PointCloud - PointCloud_Histogram - PointCloud_Normal - PointCloud_PointNormal - PointCloud_PointWithViewpoint - PointCloud_PointXYZI - PointCloud_PointXYZRGB - PointCloud_PointXYZRGBA - PointIndices - ProjectInliers - ROPSEstimation - RadiusOutlierRemoval - RandomSampleConsensus - RangeImages - SampleConsensusModel - SampleConsensusModelCylinder - SampleConsensusModelLine - SampleConsensusModelPlane - SampleConsensusModelRegistration - SampleConsensusModelSphere - SampleConsensusModelStick - Segmentation - SegmentationNormal - Segmentation_PointXYZI - Segmentation_PointXYZI_Normal - Segmentation_PointXYZRGB - Segmentation_PointXYZRGBA - Segmentation_PointXYZRGBA_Normal - Segmentation_PointXYZRGB_Normal - Sequence - StatisticalOutlierRemovalFilter - StatisticalOutlierRemovalFilter_PointXYZI - StatisticalOutlierRemovalFilter_PointXYZRGB - StatisticalOutlierRemovalFilter_PointXYZRGBA - VFHEstimation - Vertices - VoxelGridFilter - - +Module contents +--------------- - - - \ No newline at end of file +.. automodule:: pcl + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/spelling_wordlist.txt b/docs/source/spelling_wordlist.txt index 368550b8b..312aea479 100644 --- a/docs/source/spelling_wordlist.txt +++ b/docs/source/spelling_wordlist.txt @@ -11,7 +11,6 @@ bool boolean broadcast broadcasted -Caffe Cifer channelwise compatibilities @@ -26,7 +25,6 @@ covariance CPU CTC CUDA -python-pcl customizable dataset datasets @@ -117,6 +115,7 @@ profiler profilers proto PRs +python-pcl quantization reimplement reinstall diff --git a/docs/source/tutorial/pcl.rst b/docs/source/tutorial/pcl.rst new file mode 100644 index 000000000..03d49a745 --- /dev/null +++ b/docs/source/tutorial/pcl.rst @@ -0,0 +1,125 @@ +pcl +=== + +.. automodule:: pcl + + + + .. rubric:: Functions + + .. autosummary:: + + deg2rad + load + load2 + load_PointWithViewpoint + load_XYZI + load_XYZRGB + load_XYZRGBA + rad2deg + save + save2 + save_PointNormal + save_XYZRGBA + + + + + + .. rubric:: Classes + + .. autosummary:: + + ApproximateVoxelGrid + ApproximateVoxelGrid_PointXYZI + ApproximateVoxelGrid_PointXYZRGB + ApproximateVoxelGrid_PointXYZRGBA + ConcaveHull + ConcaveHull_PointXYZI + ConcaveHull_PointXYZRGB + ConcaveHull_PointXYZRGBA + ConditionAnd + ConditionalRemoval + CropBox + CropHull + EuclideanClusterExtraction + GeneralizedIterativeClosestPoint + HarrisKeypoint3D + IntegralImageNormalEstimation + IterativeClosestPoint + IterativeClosestPointNonLinear + KdTree + KdTreeFLANN + KdTreeFLANN_PointXYZI + KdTreeFLANN_PointXYZRGB + KdTreeFLANN_PointXYZRGBA + MomentOfInertiaEstimation + MovingLeastSquares + MovingLeastSquares_PointXYZRGB + MovingLeastSquares_PointXYZRGBA + NormalDistributionsTransform + NormalEstimation + OctreePointCloud + OctreePointCloud2Buf + OctreePointCloud2Buf_PointXYZI + OctreePointCloud2Buf_PointXYZRGB + OctreePointCloud2Buf_PointXYZRGBA + OctreePointCloudChangeDetector + OctreePointCloudChangeDetector_PointXYZI + OctreePointCloudChangeDetector_PointXYZRGB + OctreePointCloudChangeDetector_PointXYZRGBA + OctreePointCloudSearch + OctreePointCloudSearch_PointXYZI + OctreePointCloudSearch_PointXYZRGB + OctreePointCloudSearch_PointXYZRGBA + OctreePointCloud_PointXYZI + OctreePointCloud_PointXYZRGB + OctreePointCloud_PointXYZRGBA + PCLPointCloud2 + PassThroughFilter + PassThroughFilter_PointXYZI + PassThroughFilter_PointXYZRGB + PassThroughFilter_PointXYZRGBA + PointCloud + PointCloud_Histogram + PointCloud_Normal + PointCloud_PointNormal + PointCloud_PointWithViewpoint + PointCloud_PointXYZI + PointCloud_PointXYZRGB + PointCloud_PointXYZRGBA + PointIndices + ProjectInliers + ROPSEstimation + RadiusOutlierRemoval + RandomSampleConsensus + RangeImages + SampleConsensusModel + SampleConsensusModelCylinder + SampleConsensusModelLine + SampleConsensusModelPlane + SampleConsensusModelRegistration + SampleConsensusModelSphere + SampleConsensusModelStick + Segmentation + SegmentationNormal + Segmentation_PointXYZI + Segmentation_PointXYZI_Normal + Segmentation_PointXYZRGB + Segmentation_PointXYZRGBA + Segmentation_PointXYZRGBA_Normal + Segmentation_PointXYZRGB_Normal + Sequence + StatisticalOutlierRemovalFilter + StatisticalOutlierRemovalFilter_PointXYZI + StatisticalOutlierRemovalFilter_PointXYZRGB + StatisticalOutlierRemovalFilter_PointXYZRGBA + VFHEstimation + Vertices + VoxelGridFilter + + + + + + \ No newline at end of file diff --git a/pcl/__init__.py b/pcl/__init__.py index 1e3edd3b3..f954a3705 100644 --- a/pcl/__init__.py +++ b/pcl/__init__.py @@ -12,8 +12,7 @@ def load(path, format=None): """Load pointcloud from path. Currently supports PCD and PLY files. - - Format should be "pcd", "ply", or None to infer from the pathname. + Format should be "pcd", "ply", "obj", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud() @@ -29,10 +28,8 @@ def load(path, format=None): def load_XYZI(path, format=None): """Load pointcloud from path. - Currently supports PCD and PLY files. - - Format should be "pcd", "ply", or None to infer from the pathname. + Format should be "pcd", "ply", "obj", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointXYZI() @@ -50,7 +47,7 @@ def load_XYZRGB(path, format=None): """ Load pointcloud from path. Currently supports PCD and PLY files. - Format should be "pcd", "ply", or None to infer from the pathname. + Format should be "pcd", "ply", "obj", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointXYZRGB() @@ -68,7 +65,7 @@ def load_XYZRGBA(path, format=None): """ Load pointcloud from path. Currently supports PCD and PLY files. - Format should be "pcd", "ply", or None to infer from the pathname. + Format should be "pcd", "ply", "obj", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointXYZRGBA() @@ -86,7 +83,7 @@ def load_PointWithViewpoint(path, format=None): """ Load pointcloud from path. Currently supports PCD and PLY files. - Format should be "pcd", "ply", or None to infer from the pathname. + Format should be "pcd", "ply", "obj", or None to infer from the pathname. """ format = _infer_format(path, format) p = PointCloud_PointWithViewpoint() @@ -102,7 +99,6 @@ def load_PointWithViewpoint(path, format=None): def save(cloud, path, format=None, binary=False): """Save pointcloud to file. - Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) @@ -117,7 +113,6 @@ def save(cloud, path, format=None, binary=False): def save_XYZRGBA(cloud, path, format=None, binary=False): """Save pointcloud to file. - Format should be "pcd", "ply", or None to infer from the pathname. """ format = _infer_format(path, format) @@ -157,7 +152,7 @@ def _infer_format(path, format): if format is not None: return format.lower() - for candidate in ["pcd", "ply"]: + for candidate in ["pcd", "ply", "obj"]: if path.endswith("." + candidate): return candidate diff --git a/pcl/_pcl.pxd b/pcl/_pcl.pxd index e052545f4..e9c46c1ea 100644 --- a/pcl/_pcl.pxd +++ b/pcl/_pcl.pxd @@ -207,4 +207,4 @@ cdef class SampleConsensusModelStick: cdef inline pcl_sac.SampleConsensusModelStick[cpp.PointXYZ] *thisptr(self) nogil: # Shortcut to get raw pointer to underlying pcl::SampleConsensusModelStick. - return self.thisptr_shared.get() + return self.thisptr_shared.get() \ No newline at end of file diff --git a/pcl/pcl_io.pxd b/pcl/pcl_io.pxd index 6266fe85d..474687aa5 100644 --- a/pcl/pcl_io.pxd +++ b/pcl/pcl_io.pxd @@ -10,78 +10,148 @@ cimport pcl_defs as cpp # from boost_shared_ptr cimport shared_ptr cdef extern from "pcl/io/pcd_io.h" namespace "pcl::io": - # XYZ - int load(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud, - bool binary_mode) nogil except + - int savePCDFileASCII (string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFileBinary (string &file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFile (string &file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud, + # Template + int load [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int loadPCDFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud, bool binary_mode) nogil except + + int savePCDFileASCII [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFileBinary [PointT](string &file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFile_Index "savePCDFile" [PointT](string &file_name, + cpp.PointCloud[PointT] &cloud, vector[int] &indices, bool binary_mode) nogil except + - # XYZI - int load(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud, - bool binary_mode) nogil except + - - # XYZRGB - int load(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud, - bool binary_mode) nogil except + - - # XYZRGBA - int load(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud, +cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": + # Template + int loadPLYFile [PointT](string file_name, + cpp.PointCloud[PointT] &cloud) nogil except + + int savePLYFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud, bool binary_mode) nogil except + - # PointWithViewpoint - int load(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud, - bool binary_mode) nogil except + -cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": - # XYZ - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud, - bool binary_mode) nogil except + +### - # XYZI - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud, - bool binary_mode) nogil except + +# namespace pcl +# { +# class PCL_EXPORTS MTLReader +# { +# public: +# /** \brief empty constructor */ +# MTLReader (); +# +# /** \brief empty destructor */ +# virtual ~MTLReader() {} +# +# /** \brief Read a MTL file given its full path. +# * \param[in] filename full path to MTL file +# * \return 0 on success < 0 else. +# */ +# int +# read (const std::string& filename); +# +# /** \brief Read a MTL file given an OBJ file full path and the MTL file name. +# * \param[in] obj_file_name full path to OBJ file +# * \param[in] mtl_file_name MTL file name +# * \return 0 on success < 0 else. +# */ +# int +# read (const std::string& obj_file_name, const std::string& mtl_file_name); +# +# std::vector::const_iterator +# getMaterial (const std::string& material_name) const; +# +# /// materials array +# std::vector materials_; +# +# private: +# /// converts CIE XYZ to RGB +# inline void +# cie2rgb (const Eigen::Vector3f& xyz, pcl::TexMaterial::RGB& rgb) const; +# /// fill a pcl::TexMaterial::RGB from a split line containing CIE x y z values +# int +# fillRGBfromXYZ (const std::vector& split_line, pcl::TexMaterial::RGB& rgb); +# /// fill a pcl::TexMaterial::RGB from a split line containing r g b values +# int +# fillRGBfromRGB (const std::vector& split_line, pcl::TexMaterial::RGB& rgb); +# /// matrix to convert CIE to RGB +# Eigen::Matrix3f xyz_to_rgb_matrix_; +# +# EIGEN_MAKE_ALIGNED_OPERATOR_NEW +# }; - # XYZRGB - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud, - bool binary_mode) nogil except + +# cdef extern from "pcl/io/obj_io.h" namespace "pcl::io": +# # Template +# # /** \brief Load any OBJ file into a templated PointCloud type +# # * \param[in] file_name the name of the file to load +# # * \param[out] cloud the resultant templated point cloud +# # * \ingroup io +# # */ +# # template inline int +# # loadOBJFile (const std::string &file_name, pcl::PointCloud &cloud) +# int loadOBJFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + +# +# # /** \brief Load any OBJ file into a templated PointCloud type. +# # * \param[in] file_name the name of the file to load +# # * \param[out] cloud the resultant templated point cloud +# # * \param[out] origin the sensor acquisition origin, null +# # * \param[out] orientation the sensor acquisition orientation, identity +# # * \ingroup io +# # */ +# # inline int loadOBJFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) +# +# # /** \brief Load an OBJ file into a PCLPointCloud2 blob type. +# # * \param[in] file_name the name of the file to load +# # * \param[out] cloud the resultant templated point cloud +# # * \return 0 on success < 0 on error +# # * \ingroup io +# # */ +# # inline int loadOBJFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud) +# +# # /** \brief Load any OBJ file into a PolygonMesh type. +# # * \param[in] file_name the name of the file to load +# # * \param[out] mesh the resultant mesh +# # * \return 0 on success < 0 on error +# # * +# # * \ingroup io +# # */ +# # inline int +# # loadOBJFile (const std::string &file_name, pcl::PolygonMesh &mesh) +# +# # /** \brief Load any OBJ file into a TextureMesh type. +# # * \param[in] file_name the name of the file to load +# # * \param[out] mesh the resultant mesh +# # * \return 0 on success < 0 on error +# # * +# # * \ingroup io +# # */ +# # inline int +# # loadOBJFile (const std::string &file_name, pcl::TextureMesh &mesh) +# +# # /** \brief Saves a TextureMesh in ascii OBJ format. +# # * \param[in] file_name the name of the file to write to disk +# # * \param[in] tex_mesh the texture mesh to save +# # * \param[in] precision the output ASCII precision +# # * \ingroup io +# # */ +# # PCL_EXPORTS int +# # saveOBJFile (const std::string &file_name, +# # const pcl::TextureMesh &tex_mesh, +# # unsigned precision = 5); +# +# # /** \brief Saves a PolygonMesh in ascii PLY format. +# # * \param[in] file_name the name of the file to write to disk +# # * \param[in] mesh the polygonal mesh to save +# # * \param[in] precision the output ASCII precision default 5 +# # * \ingroup io +# # */ +# # PCL_EXPORTS int +# # saveOBJFile (const std::string &file_name, +# # const pcl::PolygonMesh &mesh, +# # unsigned precision = 5); - # XYZRGBA - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud, - bool binary_mode) nogil except + - # PointWithViewpoint - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud, - bool binary_mode) nogil except + +### #http://dev.pointclouds.org/issues/624 #cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": diff --git a/pcl/pcl_io_172.pxd b/pcl/pcl_io_172.pxd index 6266fe85d..ed05c7a54 100644 --- a/pcl/pcl_io_172.pxd +++ b/pcl/pcl_io_172.pxd @@ -10,78 +10,148 @@ cimport pcl_defs as cpp # from boost_shared_ptr cimport shared_ptr cdef extern from "pcl/io/pcd_io.h" namespace "pcl::io": - # XYZ - int load(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud, - bool binary_mode) nogil except + - int savePCDFileASCII (string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFileBinary (string &file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFile (string &file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud, + # Template + int load [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int loadPCDFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud, bool binary_mode) nogil except + + int savePCDFileASCII [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFileBinary [PointT](string &file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFile_Index "savePCDFile" [PointT](string &file_name, + cpp.PointCloud[PointT] &cloud, vector[int] &indices, bool binary_mode) nogil except + - # XYZI - int load(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud, +cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": + # Template + int loadPLYFile [PointT](string file_name, + cpp.PointCloud[PointT] &cloud) nogil except + + int savePLYFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud, bool binary_mode) nogil except + - # XYZRGB - int load(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud, - bool binary_mode) nogil except + - # XYZRGBA - int load(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud, - bool binary_mode) nogil except + +### - # PointWithViewpoint - int load(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud, - bool binary_mode) nogil except + +# namespace pcl +# { +# class PCL_EXPORTS MTLReader +# { +# public: +# /** \brief empty constructor */ +# MTLReader (); +# +# /** \brief empty destructor */ +# virtual ~MTLReader() {} +# +# /** \brief Read a MTL file given its full path. +# * \param[in] filename full path to MTL file +# * \return 0 on success < 0 else. +# */ +# int +# read (const std::string& filename); +# +# /** \brief Read a MTL file given an OBJ file full path and the MTL file name. +# * \param[in] obj_file_name full path to OBJ file +# * \param[in] mtl_file_name MTL file name +# * \return 0 on success < 0 else. +# */ +# int +# read (const std::string& obj_file_name, const std::string& mtl_file_name); +# +# std::vector::const_iterator +# getMaterial (const std::string& material_name) const; +# +# /// materials array +# std::vector materials_; +# +# private: +# /// converts CIE XYZ to RGB +# inline void +# cie2rgb (const Eigen::Vector3f& xyz, pcl::TexMaterial::RGB& rgb) const; +# /// fill a pcl::TexMaterial::RGB from a split line containing CIE x y z values +# int +# fillRGBfromXYZ (const std::vector& split_line, pcl::TexMaterial::RGB& rgb); +# /// fill a pcl::TexMaterial::RGB from a split line containing r g b values +# int +# fillRGBfromRGB (const std::vector& split_line, pcl::TexMaterial::RGB& rgb); +# /// matrix to convert CIE to RGB +# Eigen::Matrix3f xyz_to_rgb_matrix_; +# +# EIGEN_MAKE_ALIGNED_OPERATOR_NEW +# }; -cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": - # XYZ - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud, - bool binary_mode) nogil except + +cdef extern from "pcl/io/obj_io.h" namespace "pcl::io": + # Template + # /** \brief Load any OBJ file into a templated PointCloud type + # * \param[in] file_name the name of the file to load + # * \param[out] cloud the resultant templated point cloud + # * \ingroup io + # */ + # template inline int + # loadOBJFile (const std::string &file_name, pcl::PointCloud &cloud) + int loadOBJFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + - # XYZI - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud, - bool binary_mode) nogil except + + # /** \brief Load any OBJ file into a templated PointCloud type. + # * \param[in] file_name the name of the file to load + # * \param[out] cloud the resultant templated point cloud + # * \param[out] origin the sensor acquisition origin, null + # * \param[out] orientation the sensor acquisition orientation, identity + # * \ingroup io + # */ + # inline int loadOBJFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) - # XYZRGB - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud, - bool binary_mode) nogil except + + # /** \brief Load an OBJ file into a PCLPointCloud2 blob type. + # * \param[in] file_name the name of the file to load + # * \param[out] cloud the resultant templated point cloud + # * \return 0 on success < 0 on error + # * \ingroup io + # */ + # inline int loadOBJFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud) - # XYZRGBA - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud, - bool binary_mode) nogil except + + # /** \brief Load any OBJ file into a PolygonMesh type. + # * \param[in] file_name the name of the file to load + # * \param[out] mesh the resultant mesh + # * \return 0 on success < 0 on error + # * + # * \ingroup io + # */ + # inline int + # loadOBJFile (const std::string &file_name, pcl::PolygonMesh &mesh) - # PointWithViewpoint - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud, - bool binary_mode) nogil except + + # /** \brief Load any OBJ file into a TextureMesh type. + # * \param[in] file_name the name of the file to load + # * \param[out] mesh the resultant mesh + # * \return 0 on success < 0 on error + # * + # * \ingroup io + # */ + # inline int + # loadOBJFile (const std::string &file_name, pcl::TextureMesh &mesh) + + # /** \brief Saves a TextureMesh in ascii OBJ format. + # * \param[in] file_name the name of the file to write to disk + # * \param[in] tex_mesh the texture mesh to save + # * \param[in] precision the output ASCII precision + # * \ingroup io + # */ + # PCL_EXPORTS int + # saveOBJFile (const std::string &file_name, + # const pcl::TextureMesh &tex_mesh, + # unsigned precision = 5); + + # /** \brief Saves a PolygonMesh in ascii PLY format. + # * \param[in] file_name the name of the file to write to disk + # * \param[in] mesh the polygonal mesh to save + # * \param[in] precision the output ASCII precision default 5 + # * \ingroup io + # */ + # PCL_EXPORTS int + # saveOBJFile (const std::string &file_name, + # const pcl::PolygonMesh &mesh, + # unsigned precision = 5); + + +### #http://dev.pointclouds.org/issues/624 #cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": diff --git a/pcl/pcl_io_180.pxd b/pcl/pcl_io_180.pxd index 6266fe85d..ed05c7a54 100644 --- a/pcl/pcl_io_180.pxd +++ b/pcl/pcl_io_180.pxd @@ -10,78 +10,148 @@ cimport pcl_defs as cpp # from boost_shared_ptr cimport shared_ptr cdef extern from "pcl/io/pcd_io.h" namespace "pcl::io": - # XYZ - int load(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud, - bool binary_mode) nogil except + - int savePCDFileASCII (string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFileBinary (string &file_name, cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePCDFile (string &file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud, + # Template + int load [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int loadPCDFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud, bool binary_mode) nogil except + + int savePCDFileASCII [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFileBinary [PointT](string &file_name, cpp.PointCloud[PointT] &cloud) nogil except + + int savePCDFile_Index "savePCDFile" [PointT](string &file_name, + cpp.PointCloud[PointT] &cloud, vector[int] &indices, bool binary_mode) nogil except + - # XYZI - int load(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud, +cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": + # Template + int loadPLYFile [PointT](string file_name, + cpp.PointCloud[PointT] &cloud) nogil except + + int savePLYFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud, bool binary_mode) nogil except + - # XYZRGB - int load(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud, - bool binary_mode) nogil except + - # XYZRGBA - int load(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud, - bool binary_mode) nogil except + +### - # PointWithViewpoint - int load(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int loadPCDFile(string file_name, - cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int savePCDFile(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud, - bool binary_mode) nogil except + +# namespace pcl +# { +# class PCL_EXPORTS MTLReader +# { +# public: +# /** \brief empty constructor */ +# MTLReader (); +# +# /** \brief empty destructor */ +# virtual ~MTLReader() {} +# +# /** \brief Read a MTL file given its full path. +# * \param[in] filename full path to MTL file +# * \return 0 on success < 0 else. +# */ +# int +# read (const std::string& filename); +# +# /** \brief Read a MTL file given an OBJ file full path and the MTL file name. +# * \param[in] obj_file_name full path to OBJ file +# * \param[in] mtl_file_name MTL file name +# * \return 0 on success < 0 else. +# */ +# int +# read (const std::string& obj_file_name, const std::string& mtl_file_name); +# +# std::vector::const_iterator +# getMaterial (const std::string& material_name) const; +# +# /// materials array +# std::vector materials_; +# +# private: +# /// converts CIE XYZ to RGB +# inline void +# cie2rgb (const Eigen::Vector3f& xyz, pcl::TexMaterial::RGB& rgb) const; +# /// fill a pcl::TexMaterial::RGB from a split line containing CIE x y z values +# int +# fillRGBfromXYZ (const std::vector& split_line, pcl::TexMaterial::RGB& rgb); +# /// fill a pcl::TexMaterial::RGB from a split line containing r g b values +# int +# fillRGBfromRGB (const std::vector& split_line, pcl::TexMaterial::RGB& rgb); +# /// matrix to convert CIE to RGB +# Eigen::Matrix3f xyz_to_rgb_matrix_; +# +# EIGEN_MAKE_ALIGNED_OPERATOR_NEW +# }; -cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": - # XYZ - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZ] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZ] &cloud, - bool binary_mode) nogil except + +cdef extern from "pcl/io/obj_io.h" namespace "pcl::io": + # Template + # /** \brief Load any OBJ file into a templated PointCloud type + # * \param[in] file_name the name of the file to load + # * \param[out] cloud the resultant templated point cloud + # * \ingroup io + # */ + # template inline int + # loadOBJFile (const std::string &file_name, pcl::PointCloud &cloud) + int loadOBJFile [PointT](string file_name, cpp.PointCloud[PointT] &cloud) nogil except + - # XYZI - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZI] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZI] &cloud, - bool binary_mode) nogil except + + # /** \brief Load any OBJ file into a templated PointCloud type. + # * \param[in] file_name the name of the file to load + # * \param[out] cloud the resultant templated point cloud + # * \param[out] origin the sensor acquisition origin, null + # * \param[out] orientation the sensor acquisition orientation, identity + # * \ingroup io + # */ + # inline int loadOBJFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) - # XYZRGB - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGB] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZRGB] &cloud, - bool binary_mode) nogil except + + # /** \brief Load an OBJ file into a PCLPointCloud2 blob type. + # * \param[in] file_name the name of the file to load + # * \param[out] cloud the resultant templated point cloud + # * \return 0 on success < 0 on error + # * \ingroup io + # */ + # inline int loadOBJFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud) - # XYZRGBA - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointXYZRGBA] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointXYZRGBA] &cloud, - bool binary_mode) nogil except + + # /** \brief Load any OBJ file into a PolygonMesh type. + # * \param[in] file_name the name of the file to load + # * \param[out] mesh the resultant mesh + # * \return 0 on success < 0 on error + # * + # * \ingroup io + # */ + # inline int + # loadOBJFile (const std::string &file_name, pcl::PolygonMesh &mesh) - # PointWithViewpoint - int loadPLYFile(string file_name, - cpp.PointCloud[cpp.PointWithViewpoint] &cloud) nogil except + - int savePLYFile(string file_name, cpp.PointCloud[cpp.PointWithViewpoint] &cloud, - bool binary_mode) nogil except + + # /** \brief Load any OBJ file into a TextureMesh type. + # * \param[in] file_name the name of the file to load + # * \param[out] mesh the resultant mesh + # * \return 0 on success < 0 on error + # * + # * \ingroup io + # */ + # inline int + # loadOBJFile (const std::string &file_name, pcl::TextureMesh &mesh) + + # /** \brief Saves a TextureMesh in ascii OBJ format. + # * \param[in] file_name the name of the file to write to disk + # * \param[in] tex_mesh the texture mesh to save + # * \param[in] precision the output ASCII precision + # * \ingroup io + # */ + # PCL_EXPORTS int + # saveOBJFile (const std::string &file_name, + # const pcl::TextureMesh &tex_mesh, + # unsigned precision = 5); + + # /** \brief Saves a PolygonMesh in ascii PLY format. + # * \param[in] file_name the name of the file to write to disk + # * \param[in] mesh the polygonal mesh to save + # * \param[in] precision the output ASCII precision default 5 + # * \ingroup io + # */ + # PCL_EXPORTS int + # saveOBJFile (const std::string &file_name, + # const pcl::PolygonMesh &mesh, + # unsigned precision = 5); + + +### #http://dev.pointclouds.org/issues/624 #cdef extern from "pcl/io/ply_io.h" namespace "pcl::io": diff --git a/pcl/pxi/PointCloud_PCLPointCloud2.pxi b/pcl/pxi/PointCloud_PCLPointCloud2.pxi index d1bb8d4d6..8a84d0933 100644 --- a/pcl/pxi/PointCloud_PCLPointCloud2.pxi +++ b/pcl/pxi/PointCloud_PCLPointCloud2.pxi @@ -278,8 +278,8 @@ cdef class PCLPointCloud2: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [pcl_pc2.PCLPointCloud2](string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [pcl_pc2.PCLPointCloud2](string(s), deref(self.thisptr())) pass return error @@ -288,8 +288,8 @@ cdef class PCLPointCloud2: cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [pcl_pc2.PCLPointCloud2](string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [pcl_pc2.PCLPointCloud2](string(s), deref(self.thisptr())) pass return ok @@ -306,7 +306,7 @@ cdef class PCLPointCloud2: cdef string s = string(f) with nogil: # OK - # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + # error = pclio.savePCDFile [pcl_pc2.PCLPointCloud2](s, deref(self.thisptr()), binary) pass return error @@ -315,7 +315,7 @@ cdef class PCLPointCloud2: cdef int error = 0 cdef string s = string(f) with nogil: - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [pcl_pc2.PCLPointCloud2](s, deref(self.thisptr()), binary) pass return error diff --git a/pcl/pxi/PointCloud_PointWithViewpoint.pxi b/pcl/pxi/PointCloud_PointWithViewpoint.pxi index 25f4ff3dc..b9e5dce30 100644 --- a/pcl/pxi/PointCloud_PointWithViewpoint.pxi +++ b/pcl/pxi/PointCloud_PointWithViewpoint.pxi @@ -153,13 +153,13 @@ cdef class PointCloud_PointWithViewpoint: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointWithViewpoint](string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointWithViewpoint](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): diff --git a/pcl/pxi/PointCloud_PointXYZ.pxi b/pcl/pxi/PointCloud_PointXYZ.pxi index a4693525e..e8042a3f3 100644 --- a/pcl/pxi/PointCloud_PointXYZ.pxi +++ b/pcl/pxi/PointCloud_PointXYZ.pxi @@ -249,16 +249,25 @@ cdef class PointCloud: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZ](string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + return ok + + # no use pcl1.6 + def _from_obj_file(self, const char *s): + cdef int ok = -1 + # with nogil: + # # NG + # # ok = pclio.loadOBJFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + # ok = pclio.loadOBJFile [cpp.PointXYZ](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -273,11 +282,11 @@ cdef class PointCloud: cdef string s = string(f) with nogil: # NG - # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + # error = pclio.savePCDFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) # OK - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) # pclio.PointCloud[cpp.PointXYZ] *p = self.thisptr() - # error = pclio.savePCDFile(s, p, binary) + # error = pclio.savePCDFile [cpp.PointXYZ](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): @@ -285,8 +294,8 @@ cdef class PointCloud: cdef string s = string(f) with nogil: # NG - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) return error # def copyPointCloud(self, vector[int] indices): diff --git a/pcl/pxi/PointCloud_PointXYZI.pxi b/pcl/pxi/PointCloud_PointXYZI.pxi index d11bb6b95..e19c829cc 100644 --- a/pcl/pxi/PointCloud_PointXYZI.pxi +++ b/pcl/pxi/PointCloud_PointXYZI.pxi @@ -169,7 +169,7 @@ cdef class PointCloud_PointXYZI: cdef cpp.PointXYZI *p for i in range(npts): p = idx.getptr(self.thisptr(), i) - p.x, p.y, p.z, p.intensity = arr[i, 0], arr[i, 1], arr[i, 2], arr[i, 3] + p.x, p.y, p.z, p.intensity = arr[i, 0], arr[i, 1], arr[i, 2], arr[i, 3] @cython.boundscheck(False) def to_array(self): @@ -243,16 +243,25 @@ cdef class PointCloud_PointXYZI: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZI](string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + return ok + + # no use pcl1.6 + def _from_obj_file(self, const char *s): + cdef int ok = -1 + # with nogil: + # # NG + # # ok = pclio.loadOBJFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + # ok = pclio.loadOBJFile [cpp.PointXYZI](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -267,11 +276,11 @@ cdef class PointCloud_PointXYZI: cdef string s = string(f) with nogil: # NG - # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + # error = pclio.savePCDFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) # OK - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) # pclio.PointCloud[cpp.PointXYZI] *p = self.thisptr() - # error = pclio.savePCDFile(s, p, binary) + # error = pclio.savePCDFile [cpp.PointXYZI](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): @@ -279,8 +288,8 @@ cdef class PointCloud_PointXYZI: cdef string s = string(f) with nogil: # NG - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZI_172.pxi b/pcl/pxi/PointCloud_PointXYZI_172.pxi index 42df10ea4..13482320c 100644 --- a/pcl/pxi/PointCloud_PointXYZI_172.pxi +++ b/pcl/pxi/PointCloud_PointXYZI_172.pxi @@ -239,16 +239,24 @@ cdef class PointCloud_PointXYZI: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZI](string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZI](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -263,11 +271,11 @@ cdef class PointCloud_PointXYZI: cdef string s = string(f) with nogil: # NG - # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + # error = pclio.savePCDFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) # OK - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) # pclio.PointCloud[cpp.PointXYZI] *p = self.thisptr() - # error = pclio.savePCDFile(s, p, binary) + # error = pclio.savePCDFile [cpp.PointXYZI](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): @@ -275,8 +283,8 @@ cdef class PointCloud_PointXYZI: cdef string s = string(f) with nogil: # NG - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZI_180.pxi b/pcl/pxi/PointCloud_PointXYZI_180.pxi index 2c15e20b4..b55c6a048 100644 --- a/pcl/pxi/PointCloud_PointXYZI_180.pxi +++ b/pcl/pxi/PointCloud_PointXYZI_180.pxi @@ -239,16 +239,24 @@ cdef class PointCloud_PointXYZI: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZI](string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [cpp.PointXYZI](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZI](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -263,11 +271,11 @@ cdef class PointCloud_PointXYZI: cdef string s = string(f) with nogil: # NG - # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + # error = pclio.savePCDFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) # OK - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) # pclio.PointCloud[cpp.PointXYZI] *p = self.thisptr() - # error = pclio.savePCDFile(s, p, binary) + # error = pclio.savePCDFile [cpp.PointXYZI](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): @@ -275,8 +283,8 @@ cdef class PointCloud_PointXYZI: cdef string s = string(f) with nogil: # NG - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZI](s, deref(self.thisptr()), binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZRGB.pxi b/pcl/pxi/PointCloud_PointXYZRGB.pxi index a236ced7c..675e16a91 100644 --- a/pcl/pxi/PointCloud_PointXYZRGB.pxi +++ b/pcl/pxi/PointCloud_PointXYZRGB.pxi @@ -233,7 +233,7 @@ cdef class PointCloud_PointXYZRGB: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() # error = cpp.loadPCDFile(string(s), p) return error @@ -241,9 +241,18 @@ cdef class PointCloud_PointXYZRGB: def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() - # ok = cpp.loadPLYFile(string(s), p) + # ok = cpp.loadPLYFile [cpp.PointXYZRGB](string(s), p) + return ok + + # no use pcl1.6 + def _from_obj_file(self, const char *s): + cdef int ok = -1 + # with nogil: + # # NG + # # ok = pclio.loadOBJFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) + # ok = pclio.loadOBJFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -257,18 +266,18 @@ cdef class PointCloud_PointXYZRGB: cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZRGB](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGB] * - # error = cpp.savePCDFile(s, p, binary) + # error = cpp.savePCDFile [cpp.PointXYZRGB](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZRGB](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() - # error = cpp.savePLYFile(s, p, binary) + # error = cpp.savePLYFile [cpp.PointXYZRGB](s, p, binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZRGBA.pxi b/pcl/pxi/PointCloud_PointXYZRGBA.pxi index 29c23a555..4ba797ec8 100644 --- a/pcl/pxi/PointCloud_PointXYZRGBA.pxi +++ b/pcl/pxi/PointCloud_PointXYZRGBA.pxi @@ -233,7 +233,7 @@ cdef class PointCloud_PointXYZRGBA: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() # error = cpp.loadPCDFile(string(s), p) return error @@ -241,9 +241,18 @@ cdef class PointCloud_PointXYZRGBA: def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() - # ok = cpp.loadPLYFile(string(s), p) + # ok = cpp.loadPLYFile [cpp.PointXYZRGBA](string(s), p) + return ok + + # no use pcl1.6 + def _from_obj_file(self, const char *s): + cdef int ok = -1 + # with nogil: + # # NG + # # ok = pclio.loadOBJFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) + # ok = pclio.loadOBJFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -257,18 +266,18 @@ cdef class PointCloud_PointXYZRGBA: cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZRGBA](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGBA] * - # error = cpp.savePCDFile(s, p, binary) + # error = cpp.savePCDFile [cpp.PointXYZRGBA](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZRGBA](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() - # error = cpp.savePLYFile(s, p, binary) + # error = cpp.savePLYFile [cpp.PointXYZRGBA](s, p, binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZRGBA_172.pxi b/pcl/pxi/PointCloud_PointXYZRGBA_172.pxi index 66c97b3b4..3247bd47e 100644 --- a/pcl/pxi/PointCloud_PointXYZRGBA_172.pxi +++ b/pcl/pxi/PointCloud_PointXYZRGBA_172.pxi @@ -235,7 +235,7 @@ cdef class PointCloud_PointXYZRGBA: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() # error = cpp.loadPCDFile(string(s), p) return error @@ -243,9 +243,17 @@ cdef class PointCloud_PointXYZRGBA: def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() - # ok = cpp.loadPLYFile(string(s), p) + # ok = cpp.loadPLYFile [cpp.PointXYZRGBA](string(s), p) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -259,18 +267,18 @@ cdef class PointCloud_PointXYZRGBA: cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZRGBA](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGBA] * - # error = cpp.savePCDFile(s, p, binary) + # error = cpp.savePCDFile [cpp.PointXYZRGBA](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZRGBA](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() - # error = cpp.savePLYFile(s, p, binary) + # error = cpp.savePLYFile [cpp.PointXYZRGBA](s, p, binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZRGBA_180.pxi b/pcl/pxi/PointCloud_PointXYZRGBA_180.pxi index d37328595..eaae12c0b 100644 --- a/pcl/pxi/PointCloud_PointXYZRGBA_180.pxi +++ b/pcl/pxi/PointCloud_PointXYZRGBA_180.pxi @@ -235,7 +235,7 @@ cdef class PointCloud_PointXYZRGBA: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() # error = cpp.loadPCDFile(string(s), p) return error @@ -243,9 +243,17 @@ cdef class PointCloud_PointXYZRGBA: def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() - # ok = cpp.loadPLYFile(string(s), p) + # NG + # ok = pclio.loadPLYFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZRGBA](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -259,18 +267,18 @@ cdef class PointCloud_PointXYZRGBA: cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZRGBA](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGBA] * - # error = cpp.savePCDFile(s, p, binary) + # error = cpp.savePCDFile [cpp.PointXYZRGBA](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZRGBA](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGBA] *p = self.thisptr() - # error = cpp.savePLYFile(s, p, binary) + # error = cpp.savePLYFile [cpp.PointXYZRGBA](s, p, binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZRGB_172.pxi b/pcl/pxi/PointCloud_PointXYZRGB_172.pxi index e187773e9..947b934d7 100644 --- a/pcl/pxi/PointCloud_PointXYZRGB_172.pxi +++ b/pcl/pxi/PointCloud_PointXYZRGB_172.pxi @@ -235,7 +235,7 @@ cdef class PointCloud_PointXYZRGB: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() # error = cpp.loadPCDFile(string(s), p) return error @@ -243,9 +243,17 @@ cdef class PointCloud_PointXYZRGB: def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() - # ok = cpp.loadPLYFile(string(s), p) + # ok = cpp.loadPLYFile [cpp.PointXYZRGB](string(s), p) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -259,18 +267,18 @@ cdef class PointCloud_PointXYZRGB: cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZRGB](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGB] * - # error = cpp.savePCDFile(s, p, binary) + # error = cpp.savePCDFile [cpp.PointXYZRGB](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZRGB](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() - # error = cpp.savePLYFile(s, p, binary) + # error = cpp.savePLYFile [cpp.PointXYZRGB](s, p, binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZRGB_180.pxi b/pcl/pxi/PointCloud_PointXYZRGB_180.pxi index 8de220cfd..20408a769 100644 --- a/pcl/pxi/PointCloud_PointXYZRGB_180.pxi +++ b/pcl/pxi/PointCloud_PointXYZRGB_180.pxi @@ -235,7 +235,7 @@ cdef class PointCloud_PointXYZRGB: def _from_pcd_file(self, const char *s): cdef int error = 0 with nogil: - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() # error = cpp.loadPCDFile(string(s), p) return error @@ -243,9 +243,15 @@ cdef class PointCloud_PointXYZRGB: def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() - # ok = cpp.loadPLYFile(string(s), p) + ok = pclio.loadPLYFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZRGB](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -259,18 +265,18 @@ cdef class PointCloud_PointXYZRGB: cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZRGB](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGB] * - # error = cpp.savePCDFile(s, p, binary) + # error = cpp.savePCDFile [cpp.PointXYZRGB](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): cdef int error = 0 cdef string s = string(f) with nogil: - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZRGB](s, deref(self.thisptr()), binary) # cpp.PointCloud[cpp.PointXYZRGB] *p = self.thisptr() - # error = cpp.savePLYFile(s, p, binary) + # error = cpp.savePLYFile [cpp.PointXYZRGB](s, p, binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZ_172.pxi b/pcl/pxi/PointCloud_PointXYZ_172.pxi index 12abd7509..fdf4da511 100644 --- a/pcl/pxi/PointCloud_PointXYZ_172.pxi +++ b/pcl/pxi/PointCloud_PointXYZ_172.pxi @@ -234,16 +234,24 @@ cdef class PointCloud: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZ](string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZ](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -260,9 +268,9 @@ cdef class PointCloud: # NG # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) # OK - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) # pclio.PointCloud[cpp.PointXYZ] *p = self.thisptr() - # error = pclio.savePCDFile(s, p, binary) + # error = pclio.savePCDFile [cpp.PointXYZ](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): @@ -270,8 +278,8 @@ cdef class PointCloud: cdef string s = string(f) with nogil: # NG - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) return error def make_segmenter(self): diff --git a/pcl/pxi/PointCloud_PointXYZ_180.pxi b/pcl/pxi/PointCloud_PointXYZ_180.pxi index 37d092388..79f31f7d7 100644 --- a/pcl/pxi/PointCloud_PointXYZ_180.pxi +++ b/pcl/pxi/PointCloud_PointXYZ_180.pxi @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -# main cimport pcl_defs as cpp import numpy as np cimport numpy as cnp @@ -249,16 +248,24 @@ cdef class PointCloud: cdef int error = 0 with nogil: # NG - # error = pclio.loadPCDFile(string(s), deref(self.thisptr())) - error = pclio.loadPCDFile(string(s), deref(self.thisptr())) + # error = pclio.loadPCDFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + error = pclio.loadPCDFile [cpp.PointXYZ] (string(s), deref(self.thisptr())) return error def _from_ply_file(self, const char *s): cdef int ok = 0 with nogil: # NG - # ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) - ok = pclio.loadPLYFile(string(s), deref(self.thisptr())) + # ok = pclio.loadPLYFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + ok = pclio.loadPLYFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + return ok + + def _from_obj_file(self, const char *s): + cdef int ok = 0 + with nogil: + # NG + # ok = pclio.loadOBJFile [cpp.PointXYZ](string(s), deref(self.thisptr())) + ok = pclio.loadOBJFile [cpp.PointXYZ](string(s), deref(self.thisptr())) return ok def to_file(self, const char *fname, bool ascii=True): @@ -273,11 +280,11 @@ cdef class PointCloud: cdef string s = string(f) with nogil: # NG - # error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + # error = pclio.savePCDFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) # OK - error = pclio.savePCDFile(s, deref(self.thisptr()), binary) + error = pclio.savePCDFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) # pclio.PointCloud[cpp.PointXYZ] *p = self.thisptr() - # error = pclio.savePCDFile(s, p, binary) + # error = pclio.savePCDFile [cpp.PointXYZ](s, p, binary) return error def _to_ply_file(self, const char *f, bool binary=False): @@ -285,8 +292,8 @@ cdef class PointCloud: cdef string s = string(f) with nogil: # NG - # error = pclio.savePLYFile(s, deref(self.thisptr()), binary) - error = pclio.savePLYFile(s, deref(self.thisptr()), binary) + # error = pclio.savePLYFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) + error = pclio.savePLYFile [cpp.PointXYZ](s, deref(self.thisptr()), binary) return error def make_segmenter(self): diff --git a/pkg-config/Install-GTKPlus.ps1 b/pkg-config/Install-GTKPlus.ps1 index bf6bf9db6..8e4091a7d 100644 --- a/pkg-config/Install-GTKPlus.ps1 +++ b/pkg-config/Install-GTKPlus.ps1 @@ -1,4 +1,4 @@ -<# +<# .SYNOPSIS Retrieves and extracts the GTK lirary from the "http://win32builder.gnome.org/" page. .EXAMPLE diff --git a/pkg-config/PS-Zip.psm1 b/pkg-config/PS-Zip.psm1 index 28c168e10..b70f8e74f 100644 --- a/pkg-config/PS-Zip.psm1 +++ b/pkg-config/PS-Zip.psm1 @@ -1,4 +1,4 @@ -#Requires -Version 2.0 +#Requires -Version 2.0 function New-ZipCompress{ diff --git a/setup.py b/setup.py index 879677071..bb349639c 100644 --- a/setup.py +++ b/setup.py @@ -14,9 +14,6 @@ import os import time -sys.path.append('./pcl') -sys.path.append('./tests') - setup_requires = [] install_requires = [ 'filelock', @@ -341,23 +338,23 @@ def pkgconfig_win(flag, cut): # release + vtk7.0 libreleases = ['pcl_common_release', 'pcl_features_release', 'pcl_filters_release', 'pcl_io_release', 'pcl_io_ply_release', 'pcl_kdtree_release', 'pcl_keypoints_release', 'pcl_ml_release', 'pcl_octree_release', 'pcl_outofcore_release', 'pcl_people_release', 'pcl_recognition_release', 'pcl_registration_release', 'pcl_sample_consensus_release', 'pcl_search_release', 'pcl_segmentation_release', 'pcl_stereo_release', 'pcl_surface_release', 'pcl_tracking_release', 'pcl_visualization_release', 'flann', 'flann_s', 'vtkalglib-' + vtk_version, 'vtkChartsCore-' + vtk_version, 'vtkCommonColor-' + vtk_version, 'vtkCommonComputationalGeometry-' + vtk_version, 'vtkCommonCore-' + vtk_version, 'vtkCommonDataModel-' + vtk_version, 'vtkCommonExecutionModel-' + vtk_version, 'vtkCommonMath-' + vtk_version, 'vtkCommonMisc-' + vtk_version, 'vtkCommonSystem-' + vtk_version, 'vtkCommonTransforms-' + vtk_version, 'vtkDICOMParser-' + vtk_version, 'vtkDomainsChemistry-' + vtk_version, 'vtkexoIIc-' + vtk_version, 'vtkexpat-' + vtk_version, 'vtkFiltersAMR-' + vtk_version, 'vtkFiltersCore-' + vtk_version, 'vtkFiltersExtraction-' + vtk_version, 'vtkFiltersFlowPaths-' + vtk_version, 'vtkFiltersGeneral-' + vtk_version, 'vtkFiltersGeneric-' + vtk_version, 'vtkFiltersGeometry-' + vtk_version, 'vtkFiltersHybrid-' + vtk_version, 'vtkFiltersHyperTree-' + vtk_version, 'vtkFiltersImaging-' + vtk_version, 'vtkFiltersModeling-' + vtk_version, 'vtkFiltersParallel-' + vtk_version, 'vtkFiltersParallelImaging-' + vtk_version, 'vtkFiltersProgrammable-' + vtk_version, 'vtkFiltersSelection-' + vtk_version, 'vtkFiltersSMP-' + vtk_version, 'vtkFiltersSources-' + vtk_version, 'vtkFiltersStatistics-' + vtk_version, 'vtkFiltersTexture-' + vtk_version, 'vtkFiltersVerdict-' + vtk_version, 'vtkfreetype-' + vtk_version, 'vtkGeovisCore-' + vtk_version, 'vtkgl2ps-' + vtk_version, 'vtkhdf5-' + vtk_version, 'vtkhdf5_hl-' + vtk_version, 'vtkImagingColor-' + vtk_version, 'vtkImagingCore-' + vtk_version, 'vtkImagingFourier-' + vtk_version, 'vtkImagingGeneral-' + vtk_version, 'vtkImagingHybrid-' + vtk_version, 'vtkImagingMath-' + vtk_version, 'vtkImagingMorphological-' + vtk_version, 'vtkImagingSources-' + vtk_version, 'vtkImagingStatistics-' + vtk_version, 'vtkImagingStencil-' + vtk_version, 'vtkInfovisCore-' + vtk_version, 'vtkInfovisLayout-' + vtk_version, 'vtkInteractionImage-' + vtk_version, 'vtkInteractionStyle-' + vtk_version, 'vtkInteractionWidgets-' + vtk_version, 'vtkIOAMR-' + vtk_version, 'vtkIOCore-' + vtk_version, 'vtkIOEnSight-' + vtk_version, 'vtkIOExodus-' + vtk_version, 'vtkIOExport-' + vtk_version, 'vtkIOGeometry-' + vtk_version, 'vtkIOImage-' + vtk_version, 'vtkIOImport-' + vtk_version, 'vtkIOInfovis-' + vtk_version, 'vtkIOLegacy-' + vtk_version, 'vtkIOLSDyna-' + vtk_version, 'vtkIOMINC-' + vtk_version, 'vtkIOMovie-' + vtk_version, 'vtkIONetCDF-' + vtk_version, 'vtkIOParallel-' + vtk_version, 'vtkIOParallelXML-' + vtk_version, 'vtkIOPLY-' + vtk_version, 'vtkIOSQL-' + vtk_version, 'vtkIOVideo-' + vtk_version, 'vtkIOXML-' + vtk_version, 'vtkIOXMLParser-' + vtk_version, 'vtkjpeg-' + vtk_version, 'vtkjsoncpp-' + vtk_version, 'vtklibxml2-' + vtk_version, 'vtkmetaio-' + vtk_version, 'vtkNetCDF-' + vtk_version, 'vtkoggtheora-' + vtk_version, 'vtkParallelCore-' + vtk_version, 'vtkpng-' + vtk_version, 'vtkproj4-' + vtk_version, 'vtkRenderingAnnotation-' + vtk_version, 'vtkRenderingContext2D-' + vtk_version, 'vtkRenderingContextOpenGL-' + vtk_version, 'vtkRenderingCore-' + vtk_version, 'vtkRenderingFreeType-' + vtk_version, 'vtkRenderingGL2PS-' + vtk_version, 'vtkRenderingImage-' + vtk_version, 'vtkRenderingLabel-' + vtk_version, 'vtkRenderingLIC-' + vtk_version, 'vtkRenderingLOD-' + vtk_version, 'vtkRenderingOpenGL-' + vtk_version, 'vtkRenderingVolume-' + vtk_version, 'vtkRenderingVolumeOpenGL-' + vtk_version, 'vtksqlite-' + vtk_version, 'vtksys-' + vtk_version, 'vtktiff-' + vtk_version, 'vtkverdict-' + vtk_version, 'vtkViewsContext2D-' + vtk_version, 'vtkViewsCore-' + vtk_version, 'vtkViewsInfovis-' + vtk_version, 'vtkzlib-' + vtk_version] - + else: libreleases = [] - + for librelease in libreleases: ext_args['libraries'].append(librelease) - + # Note : # vtk Version setting - + # use vtk need library(Windows base library) # http://public.kitware.com/pipermail/vtkusers/2008-July/047291.html win_libreleases = ['kernel32', 'user32', 'gdi32', 'winspool', 'comdlg32', 'advapi32', 'shell32', 'ole32', 'oleaut32', 'uuid', 'odbc32', 'odbccp32'] for win_librelease in win_libreleases: ext_args['libraries'].append(win_librelease) - + # http://www.pcl-users.org/error-in-use-PCLVisualizer-td3719235.html # Download MSSDKs # http://msdn.microsoft.com/en-us/windows/bb980924.aspx @@ -467,14 +464,14 @@ def pkgconfig_win(flag, cut): # use OpenMP # https://stackoverflow.com/questions/7844830/cython-openmp-compiler-flag # ext_args['extra_compile_args'].append('/openmp') - + # include_dirs=[pcl_root + '\\include\\pcl' + pcl_version, pcl_root + '\\3rdParty\\Eigen\\include', pcl_root + '\\3rdParty\\Boost\\include', pcl_root + '\\3rdParty\\FLANN\include', 'C:\\Anaconda2\\envs\\my_env\\Lib\\site-packages\\numpy\\core\\include'], # library_dirs=[pcl_root + '\\lib', pcl_root + '\\3rdParty\\Boost\\lib', pcl_root + '\\3rdParty\\FLANN\\lib'], # libraries=["pcl_apps_debug", "pcl_common_debug", "pcl_features_debug", "pcl_filters_debug", "pcl_io_debug", "pcl_io_ply_debug", "pcl_kdtree_debug", "pcl_keypoints_debug", "pcl_octree_debug", "pcl_registration_debug", "pcl_sample_consensus_debug", "pcl_segmentation_debug", "pcl_search_debug", "pcl_surface_debug", "pcl_tracking_debug", "pcl_visualization_debug", "flann-gd", "flann_s-gd", "boost_chrono-vc100-mt-1_49", "boost_date_time-vc100-mt-1_49", "boost_filesystem-vc100-mt-1_49", "boost_graph-vc100-mt-1_49", "boost_graph_parallel-vc100-mt-1_49", "boost_iostreams-vc100-mt-1_49", "boost_locale-vc100-mt-1_49", "boost_math_c99-vc100-mt-1_49", "boost_math_c99f-vc100-mt-1_49", "boost_math_tr1-vc100-mt-1_49", "boost_math_tr1f-vc100-mt-1_49", "boost_mpi-vc100-mt-1_49", "boost_prg_exec_monitor-vc100-mt-1_49", "boost_program_options-vc100-mt-1_49", "boost_random-vc100-mt-1_49", "boost_regex-vc100-mt-1_49", "boost_serialization-vc100-mt-1_49", "boost_signals-vc100-mt-1_49", "boost_system-vc100-mt-1_49", "boost_thread-vc100-mt-1_49", "boost_timer-vc100-mt-1_49", "boost_unit_test_framework-vc100-mt-1_49", "boost_wave-vc100-mt-1_49", "boost_wserialization-vc100-mt-1_49", "libboost_chrono-vc100-mt-1_49", "libboost_date_time-vc100-mt-1_49", "libboost_filesystem-vc100-mt-1_49", "libboost_graph_parallel-vc100-mt-1_49", "libboost_iostreams-vc100-mt-1_49", "libboost_locale-vc100-mt-1_49", "libboost_math_c99-vc100-mt-1_49", "libboost_math_c99f-vc100-mt-1_49", "libboost_math_tr1-vc100-mt-1_49", "libboost_math_tr1f-vc100-mt-1_49", "libboost_mpi-vc100-mt-1_49", "libboost_prg_exec_monitor-vc100-mt-1_49", "libboost_program_options-vc100-mt-1_49", "libboost_random-vc100-mt-1_49", "libboost_regex-vc100-mt-1_49", "libboost_serialization-vc100-mt-1_49", "libboost_signals-vc100-mt-1_49", "libboost_system-vc100-mt-1_49", "libboost_test_exec_monitor-vc100-mt-1_49", "libboost_thread-vc100-mt-1_49", "libboost_timer-vc100-mt-1_49", "libboost_unit_test_framework-vc100-mt-1_49", "libboost_wave-vc100-mt-1_49", "libboost_wserialization-vc100-mt-1_49"], ## define_macros=[('BOOST_NO_EXCEPTIONS', 'None')], # define_macros=[('EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET', '1')], # extra_compile_args=["/EHsc"], - + print(ext_args) if pcl_version == '-1.6': @@ -546,14 +543,14 @@ def pkgconfig_win(flag, cut): # ext_args['include_dirs'].append('/usr/include/vtk') # ext_args['include_dirs'].append('/usr/local/include/vtk') # pcl 1.7(Ubuntu) - ext_args['include_dirs'].append('/usr/include/vtk-5.8') - ext_args['library_dirs'].append('/usr/lib') + # ext_args['include_dirs'].append('/usr/include/vtk-5.8') + # ext_args['library_dirs'].append('/usr/lib') # ext_args['libraries'].append('libvtk*.so') # pcl 1.8.1(MacOSX) - ext_args['include_dirs'].append('/usr/local/include/vtk-8.0') - ext_args['library_dirs'].append('/usr/local/lib') - ext_args['include_dirs'].append('/usr/local/Cellar/vtk/8.0.1/include') - ext_args['library_dirs'].append('/usr/local/Cellar/vtk/8.0.1/lib') + # ext_args['include_dirs'].append('/usr/local/include/vtk-8.0') + # ext_args['library_dirs'].append('/usr/local/lib') + # ext_args['include_dirs'].append('/usr/local/Cellar/vtk/8.0.1/include') + # ext_args['library_dirs'].append('/usr/local/Cellar/vtk/8.0.1/lib') # ext_args['libraries'].append('libvtk*.dylib') for flag in pkgconfig('--cflags-only-other'): @@ -566,10 +563,18 @@ def pkgconfig_win(flag, cut): # clang? # https://github.com/strawlab/python-pcl/issues/129 # gcc base libc++, clang base libstdc++ - # gcc5 # ext_args['extra_compile_args'].append("-stdlib=libstdc++") - # gcc4? # ext_args['extra_compile_args'].append("-stdlib=libc++") + if platform.system() == "Darwin": + # or gcc5? + # ext_args['extra_compile_args'].append("-stdlib=libstdc++") + # ext_args['extra_compile_args'].append("-mmacosx-version-min=10.6") + # ext_args['extra_compile_args'].append('-openmp') + pass + else: + # gcc4? + # ext_args['extra_compile_args'].append("-stdlib=libc++") + pass for flag in pkgconfig('--libs-only-l'): if flag == "-lflann_cpp-gd":