Skip to content
Snippets Groups Projects
Unverified Commit f30184d4 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #483 from jcarpent/hppfcl2x

Import #482 and fix Python stubs testing on Windows
parents 28dfce00 469334e5
No related branches found
No related tags found
No related merge requests found
Pipeline #33326 passed
......@@ -52,7 +52,7 @@ jobs:
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=Release ^
-DGENERATE_PYTHON_STUBS=OFF ^
-DGENERATE_PYTHON_STUBS=ON ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DHPP_FCL_HAS_QHULL=ON ^
......@@ -64,11 +64,6 @@ jobs:
cmake --build . --config Release --target install
if errorlevel 1 exit 1
:: Build stubs
git clone https://github.com/jcarpent/pybind11-stubgen.git
python "%CD%\pybind11-stubgen\pybind11_stubgen\__init__.py" -o %CONDA_PREFIX%\Lib\site-packages hppfcl --boost-python --ignore-invalid signature --no-setup-py --root-module-suffix ""
if errorlevel 1 exit 1
:: Testing
ctest --output-on-failure -C Release -V
if errorlevel 1 exit 1
......
......@@ -51,7 +51,7 @@ jobs:
-G "Visual Studio 16 2019" -T "v142" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=Release ^
-DGENERATE_PYTHON_STUBS=OFF ^
-DGENERATE_PYTHON_STUBS=ON ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DHPP_FCL_HAS_QHULL=ON ^
......@@ -63,11 +63,6 @@ jobs:
cmake --build . --config Release --target install
if errorlevel 1 exit 1
:: Build stubs
git clone https://github.com/jcarpent/pybind11-stubgen.git
python "%CD%\pybind11-stubgen\pybind11_stubgen\__init__.py" -o %CONDA_PREFIX%\Lib\site-packages hppfcl --boost-python --ignore-invalid signature --no-setup-py --root-module-suffix ""
if errorlevel 1 exit 1
:: Testing
ctest --output-on-failure -C Release -V
if errorlevel 1 exit 1
......
Subproject commit 1f6b9ebae6c0e16c6eedd869d459ef6a0da41151
Subproject commit 02719f3288d3f79d2269fe784bd071657ba59f6d
......@@ -300,14 +300,20 @@ class HPP_FCL_DLLAPI CollisionObject {
/// @brief set the object in local coordinate
void setIdentityTransform() { t.setIdentity(); }
/// @brief get geometry from the object instance
/// @brief get shared pointer to collision geometry of the object instance
const shared_ptr<const CollisionGeometry> collisionGeometry() const {
return cgeom;
}
/// @brief get geometry from the object instance
/// @brief get shared pointer to collision geometry of the object instance
const shared_ptr<CollisionGeometry>& collisionGeometry() { return cgeom; }
/// @brief get raw pointer to collision geometry of the object instance
const CollisionGeometry* collisionGeometryPtr() const { return cgeom.get(); }
/// @brief get raw pointer to collision geometry of the object instance
CollisionGeometry* collisionGeometryPtr() { return cgeom.get(); }
/// @brief Associate a new CollisionGeometry
///
/// @param[in] collision_geometry The new CollisionGeometry
......
......@@ -114,7 +114,7 @@ IF(HPP_FCL_HAS_OCTOMAP)
LIST(APPEND ${LIBRARY_NAME}_SOURCES octree.cc)
ENDIF(HPP_FCL_HAS_OCTOMAP)
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
ADD_LIBRARY(${LIBRARY_NAME} MODULE ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} SYSTEM PRIVATE ${PYTHON_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}")
IF(WIN32)
......@@ -159,7 +159,7 @@ INSTALL(TARGETS ${LIBRARY_NAME}
# --- GENERATE STUBS
IF(GENERATE_PYTHON_STUBS)
LOAD_STUBGEN()
GENERATE_STUBS(${CMAKE_CURRENT_BINARY_DIR} ${LIBRARY_NAME} ${ABSOLUTE_PYTHON_SITELIB} ${LIBRARY_NAME})
GENERATE_STUBS(${CMAKE_CURRENT_BINARY_DIR} ${LIBRARY_NAME} ${ABSOLUTE_PYTHON_SITELIB} ${LIBRARY_NAME} ${PROJECT_NAME})
ENDIF(GENERATE_PYTHON_STUBS)
# --- INSTALL SCRIPTS
......
......@@ -574,7 +574,7 @@ void DynamicAABBTreeCollisionManager::collide(
case GEOM_OCTREE: {
if (!octree_as_geometry_collide) {
const OcTree* octree =
static_cast<const OcTree*>(obj->collisionGeometry().get());
static_cast<const OcTree*>(obj->collisionGeometryPtr());
detail::dynamic_AABB_tree::collisionRecurse(
dtree.getRoot(), octree, octree->getRoot(), octree->getRootBV(),
obj->getTransform(), callback);
......@@ -600,7 +600,7 @@ void DynamicAABBTreeCollisionManager::distance(
case GEOM_OCTREE: {
if (!octree_as_geometry_distance) {
const OcTree* octree =
static_cast<const OcTree*>(obj->collisionGeometry().get());
static_cast<const OcTree*>(obj->collisionGeometryPtr());
detail::dynamic_AABB_tree::distanceRecurse(
dtree.getRoot(), octree, octree->getRoot(), octree->getRootBV(),
obj->getTransform(), callback, min_dist);
......
......@@ -622,7 +622,7 @@ void DynamicAABBTreeArrayCollisionManager::collide(
case GEOM_OCTREE: {
if (!octree_as_geometry_collide) {
const OcTree* octree =
static_cast<const OcTree*>(obj->collisionGeometry().get());
static_cast<const OcTree*>(obj->collisionGeometryPtr());
detail::dynamic_AABB_tree_array::collisionRecurse(
dtree.getNodes(), dtree.getRoot(), octree, octree->getRoot(),
octree->getRootBV(), obj->getTransform(), callback);
......@@ -648,7 +648,7 @@ void DynamicAABBTreeArrayCollisionManager::distance(
case GEOM_OCTREE: {
if (!octree_as_geometry_distance) {
const OcTree* octree =
static_cast<const OcTree*>(obj->collisionGeometry().get());
static_cast<const OcTree*>(obj->collisionGeometryPtr());
detail::dynamic_AABB_tree_array::distanceRecurse(
dtree.getNodes(), dtree.getRoot(), octree, octree->getRoot(),
octree->getRootBV(), obj->getTransform(), callback, min_dist);
......
......@@ -62,8 +62,8 @@ void CollisionResult::swapObjects() {
std::size_t collide(const CollisionObject* o1, const CollisionObject* o2,
const CollisionRequest& request, CollisionResult& result) {
return collide(o1->collisionGeometry().get(), o1->getTransform(),
o2->collisionGeometry().get(), o2->getTransform(), request,
return collide(o1->collisionGeometryPtr(), o1->getTransform(),
o2->collisionGeometryPtr(), o2->getTransform(), request,
result);
}
......
......@@ -52,8 +52,8 @@ DistanceFunctionMatrix& getDistanceFunctionLookTable() {
FCL_REAL distance(const CollisionObject* o1, const CollisionObject* o2,
const DistanceRequest& request, DistanceResult& result) {
return distance(o1->collisionGeometry().get(), o1->getTransform(),
o2->collisionGeometry().get(), o2->getTransform(), request,
return distance(o1->collisionGeometryPtr(), o1->getTransform(),
o2->collisionGeometryPtr(), o2->getTransform(), request,
result);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment