Skip to content

Commit

Permalink
Renamed pypcl to pptk.
Browse files Browse the repository at this point in the history
  • Loading branch information
victoriousluser authored and Victor Lu committed Jul 13, 2018
1 parent 6b8e171 commit 87ffcaf
Show file tree
Hide file tree
Showing 75 changed files with 115 additions and 115 deletions.
2 changes: 1 addition & 1 deletion CMakeCache.linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ TBB_tbb_LIBRARY:FILEPATH=/home/victlu/Sources/tbb2018_20170919oss/lib/intel64/gc
TBB_tbb_RUNTIME:FILEPATH=/home/victlu/Sources/tbb2018_20170919oss/lib/intel64/gcc4.7/libtbb.so
TBB_tbbmalloc_LIBRARY:FILEPATH=/home/victlu/Sources/tbb2018_20170919oss/lib/intel64/gcc4.7/libtbbmalloc.so
TBB_tbbmalloc_RUNTIME:FILEPATH=/home/victlu/Sources/tbb2018_20170919oss/lib/intel64/gcc4.7/libtbbmalloc.so
PYPCL_PATCHELF:FILEPATH=/home/victlu/Sources/install/bin/patchelf
PPTK_PATCHELF:FILEPATH=/home/victlu/Sources/install/bin/patchelf
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1)
project(pypcl)
project(pptk)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_MODULE_PATH
Expand All @@ -20,23 +20,23 @@ get_filename_component(Qt5_DIR ${Qt5_DIR} DIRECTORY)
set(Qt5_PLUGINS_DIR ${Qt5_DIR}/plugins)

# localize all dependencies (.dll, .so, or .dylib) in the following folder
set(PYPCL_LIBS_DIR ${PROJECT_BINARY_DIR}/pypcl/libs)
set(PPTK_LIBS_DIR ${PROJECT_BINARY_DIR}/pptk/libs)

# use the following variable to store a list .dll paths required by targets
# built in pypcl; this is useful only for building on Windows platform
# use the following variable to store a list of .dll paths required by targets
# built in pptk; this is useful only for building on Windows platform
get_filename_component(TBB_RUNTIME_DIR ${TBB_tbb_RUNTIME} DIRECTORY)
set(PYPCL_DLL_DIRS
set(PPTK_DLL_DIRS
${TBB_RUNTIME_DIR}
${Qt5_DIR}/bin
CACHE INTERNAL "Additional folder paths for finding .dll's")

# use patchelf to modify binary RPATH when building pypcl on Linux
# use patchelf to modify binary RPATH when building pptk on Linux
if(UNIX AND NOT APPLE)
find_program(PYPCL_PATCHELF patchelf)
if (NOT PYPCL_PATCHELF)
find_program(PPTK_PATCHELF patchelf)
if (NOT PPTK_PATCHELF)
message(FATAL_ERROR
"patchelf needed for localizing library dependencies; \
please manually set the PYPCL_PATCHELF variable.")
please manually set the PPTK_PATCHELF variable.")
endif()
endif()

Expand All @@ -51,4 +51,4 @@ set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE) # requires cmake 3.1
include(InstallRequiredSystemLibraries)

copy_file(setup.py)
add_subdirectory(pypcl)
add_subdirectory(pptk)
6 changes: 3 additions & 3 deletions cmake/UsefulMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ function(copy_target_dependencies x)
COMMAND ${CMAKE_COMMAND} -P
${PROJECT_SOURCE_DIR}/cmake/CopyWindowsDependencies.cmake
${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name}
${PYPCL_LIBS_DIR} "${PYPCL_DLL_DIRS}")
${PPTK_LIBS_DIR} "${PPTK_DLL_DIRS}")
elseif(APPLE)
add_custom_command(TARGET ${x} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P
${PROJECT_SOURCE_DIR}/cmake/CopyAppleDependencies.cmake
${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name} ${PYPCL_LIBS_DIR})
${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name} ${PPTK_LIBS_DIR})
elseif(UNIX)
add_custom_command(TARGET ${x} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P
${PROJECT_SOURCE_DIR}/cmake/CopyLinuxDependencies.cmake
${_target_file}
${CMAKE_CURRENT_BINARY_DIR}/${_target_file_name}
${PYPCL_LIBS_DIR} ${PYPCL_PATCHELF})
${PPTK_LIBS_DIR} ${PPTK_PATCHELF})
endif()
endfunction()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions pptk/include/pptk_dll_export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef __PPTK_DLL_EXPORT_H__
#define __PPTK_DLL_EXPORT_H__

#if defined(_WIN32) || defined(_WIN64)
#ifdef __cplusplus
#define PPTK_DLL_EXPORT extern "C" __declspec(dllexport)
#else
#define PPTK_DLL_EXPORT __declspec(dllexport)
#endif
#else
#define PPTK_DLL_EXPORT
#endif

#endif // __PPTK_DLL_EXPORT_H__
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pypcl/libs/CMakeLists.txt → pptk/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function(copy_system_file x)
copy_file(${temp} _target)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${_target} POST_BUILD COMMAND
${PYPCL_PATCHELF} --set-rpath \\\$\$ORIGIN
${PPTK_PATCHELF} --set-rpath \\\$\$ORIGIN
${CMAKE_CURRENT_BINARY_DIR}/${x})
endif()
unset(temp CACHE)
Expand All @@ -20,7 +20,7 @@ function(copy_import_target x)
copy_file(${_file_path} _target)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${_target} POST_BUILD COMMAND
${PYPCL_PATCHELF} --set-rpath \\\$\$ORIGIN
${PPTK_PATCHELF} --set-rpath \\\$\$ORIGIN
${CMAKE_CURRENT_BINARY_DIR}/${_file_name})
endif()
endfunction()
Expand All @@ -33,7 +33,7 @@ if (WIN32)
endforeach()
elseif (APPLE)
elseif (UNIX)
# create local copies of system libraries that are required by pypcl targets
# create local copies of system libraries that are required by pptk targets
# but not provided by a bare bone manylinux1 platform, as specified in PEP 513
if (CMAKE_LIBRARY_ARCHITECTURE)
set(_paths
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 23 additions & 23 deletions pypcl/viewer/viewer.py → pptk/viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ def __init__(self, *args, **kwargs):
Examples:
Create 100 random points
>>> xyz = pypcl.rand(100, 3)
>>> xyz = pptk.rand(100, 3)
Visualize the points
>>> pypcl.viewer(xyz)
>>> pptk.viewer(xyz)
Visualize points shaded by height
>>> pypcl.viewer(xyz, xyz[:, 2])
>>> pptk.viewer(xyz, xyz[:, 2])
Visualize points shaded by random RGB color
>>> rgb = pypcl.rand(100, 3)
>>> pypcl.viewer(xyz, rgb)
>>> rgb = pptk.rand(100, 3)
>>> pptk.viewer(xyz, rgb)
"""
# ensure positions is 3-column array of float32s
Expand Down Expand Up @@ -129,7 +129,7 @@ def set(self, **kwargs):
Examples:
>>> v = pypcl.viewer(xyz)
>>> v = pptk.viewer(xyz)
>>> v.set(point_size = 0.01)
"""
Expand Down Expand Up @@ -159,7 +159,7 @@ def get(self, prop_name):
Examples:
>>> v = pypcl.viewer(xyz)
>>> v = pptk.viewer(xyz)
>>> v.get('selected')
"""
Expand Down Expand Up @@ -190,14 +190,14 @@ def attributes(self, *attr):
Examples:
>>> xyz = pypcl.rand(100, 3)
>>> v = pypcl.viewer(xyz)
>>> attr1 = pypcl.rand(100) # 100 random scalars
>>> attr2 = pypcl.rand(100, 3) # 100 random RGB colors
>>> attr3 = pypcl.rand(100, 4) # 100 random RGBA colors
>>> attr4 = pypcl.rand(1, 1) # 1 random scalar
>>> attr5 = pypcl.rand(1, 3) # 1 random RGB color
>>> attr6 = pypcl.rand(1, 4) # 1 random RGBA color
>>> xyz = pptk.rand(100, 3)
>>> v = pptk.viewer(xyz)
>>> attr1 = pptk.rand(100) # 100 random scalars
>>> attr2 = pptk.rand(100, 3) # 100 random RGB colors
>>> attr3 = pptk.rand(100, 4) # 100 random RGBA colors
>>> attr4 = pptk.rand(1, 1) # 1 random scalar
>>> attr5 = pptk.rand(1, 3) # 1 random RGB color
>>> attr6 = pptk.rand(1, 4) # 1 random RGBA color
>>> v.attributes(attr1, attr2, attr3, attr4, attr6)
"""
Expand Down Expand Up @@ -257,7 +257,7 @@ def color_map(self, c, scale=None):
Examples:
>>> xyz = np.c_[np.arange(10), np.zeros(10), np.zeros(10)]
>>> scalars = np.arange(10)
>>> v = pypcl.viewer(xyz, scalars)
>>> v = pptk.viewer(xyz, scalars)
>>> v.color_map('cool', scale=[0, 5])
>>> v.color_map([[0, 0, 0], [1, 1, 1]])
Expand All @@ -284,7 +284,7 @@ def capture(self, filename):
Examples:
>>> v = pypcl.viewer(xyz)
>>> v = pptk.viewer(xyz)
>>> v.capture('screenshot.png')
"""
Expand Down Expand Up @@ -344,17 +344,17 @@ def record(self, folder, poses, ts=[], tlim=[-numpy.inf, numpy.inf],
Args:
folder: Folder to which images are saved
poses: Same as in :meth:`pypcl.viewer.play`
ts: Same as in :meth:`pypcl.viewer.play`
tlim: Same as in :meth:`pypcl.viewer.play`
interp: Same as in :meth:`pypcl.viewer.play`
poses: Same as in :meth:`pptk.viewer.play`
ts: Same as in :meth:`pptk.viewer.play`
tlim: Same as in :meth:`pptk.viewer.play`
interp: Same as in :meth:`pptk.viewer.play`
fps: Frames per second
prefix: Resulting image file names are prefixed with this string
ext: Image format
Examples:
Assuming poses defined as in the example for :meth:pypcl.viewer.play
Assuming poses defined as in the example for :meth:pptk.viewer.play
>>> mkdir 'recording'
>>> v.record('recording', poses)
Expand Down Expand Up @@ -406,7 +406,7 @@ def wait(self):
Examples:
>>> v = pypcl.viewer(xyz)
>>> v = pptk.viewer(xyz)
>>> v.wait()
Press enter in viewer to return control to python terminal.
Expand Down
14 changes: 0 additions & 14 deletions pypcl/include/pypcl_dll_export.h

This file was deleted.

14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,31 @@ def make_exe(x):


def list_libs():
libs_dir = os.path.join('pypcl', 'libs')
libs_dir = os.path.join('pptk', 'libs')
exclude_list = ['Makefile', 'cmake_install.cmake']
return [f for f in os.listdir(libs_dir)
if os.path.isfile(os.path.join(libs_dir, f))
and f not in exclude_list]


setup(
name='pypcl',
name='pptk',
version='0.1.0',
description='A Python package for facilitating point cloud processing.',
author='Victor Lu',
packages=find_packages(),
package_data={
'pypcl': [
'pptk': [
os.path.join('libs', f) for f in list_libs()] + [
os.path.join('libs',
'qt_plugins', 'platforms', make_lib('*', '*')),
os.path.join('libs',
'qt_plugins', 'xcbglintegrations', make_lib('*', '*'))
],
'pypcl.kdtree': [make_mod('kdtree')],
'pypcl.processing.estimate_normals': [make_mod('estimate_normals')],
'pypcl.vfuncs': [make_mod('vfuncs')],
'pypcl.viewer': [make_exe('viewer'), 'qt.conf']},
'pptk.kdtree': [make_mod('kdtree')],
'pptk.processing.estimate_normals': [make_mod('estimate_normals')],
'pptk.vfuncs': [make_mod('vfuncs')],
'pptk.viewer': [make_exe('viewer'), 'qt.conf']},
options={'bdist_wheel': {
'python_tag': wheel_tags[0],
'plat_name': wheel_tags[2]}})
20 changes: 10 additions & 10 deletions tests/test_estimate_normals.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import unittest
import pypcl
import pptk
import numpy as np


class TestEstimateNormals(unittest.TestCase):
def test_rand100(self):
np.random.seed(0)
x = pypcl.rand(100,3)
pypcl.estimate_normals(x, 5, 0.2)
pypcl.estimate_normals(x, 5, 0.2, output_eigenvalues=True)
pypcl.estimate_normals(x, 5, 0.2, output_all_eigenvectors=True)
pypcl.estimate_normals(x, 5, 0.2, output_eigenvalues=True,
x = pptk.rand(100,3)
pptk.estimate_normals(x, 5, 0.2)
pptk.estimate_normals(x, 5, 0.2, output_eigenvalues=True)
pptk.estimate_normals(x, 5, 0.2, output_all_eigenvectors=True)
pptk.estimate_normals(x, 5, 0.2, output_eigenvalues=True,
output_all_eigenvectors=True)

x = np.float32(x)
pypcl.estimate_normals(x, 5, 0.2)
pypcl.estimate_normals(x, 5, 0.2, output_eigenvalues=True)
pypcl.estimate_normals(x, 5, 0.2, output_all_eigenvectors=True)
pypcl.estimate_normals(x, 5, 0.2, output_eigenvalues=True,
pptk.estimate_normals(x, 5, 0.2)
pptk.estimate_normals(x, 5, 0.2, output_eigenvalues=True)
pptk.estimate_normals(x, 5, 0.2, output_all_eigenvectors=True)
pptk.estimate_normals(x, 5, 0.2, output_eigenvalues=True,
output_all_eigenvectors=True)


Expand Down
6 changes: 3 additions & 3 deletions tests/test_expr.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import unittest
import pypcl
import pptk
import numpy as np


class TestCentroids(unittest.TestCase):
def test_centroids(self):
np.random.seed(0)
x = np.float32(pypcl.rand(100, 3))
x = np.float32(pptk.rand(100, 3))
n = x.NBHDS(k=3)
y = np.vstack(pypcl.MEAN(x[n], axis=0).evaluate())
y = np.vstack(pptk.MEAN(x[n], axis=0).evaluate())
self.assertTrue(y.shape == (100, 3))


Expand Down
Loading

0 comments on commit 87ffcaf

Please sign in to comment.