Commit 1658cc0f authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Python] Add python bindings.

parent 2aafd003
......@@ -37,6 +37,7 @@ set(CXX_DISABLE_WERROR TRUE)
include(cmake/base.cmake)
include(cmake/eigen.cmake)
include(cmake/boost.cmake)
include(cmake/python.cmake)
include(cmake/hpp.cmake)
set(PROJECT_NAME hpp-fcl)
......@@ -57,6 +58,8 @@ IF(APPLE)
endif("${isSystemDir}" STREQUAL "-1")
ENDIF(APPLE)
OPTION(BUILD_PYTHON_INTERFACE OFF)
setup_hpp_project()
add_required_dependency("eigen3 >= 3.0.0")
......@@ -66,10 +69,13 @@ include_directories(SYSTEM ${EIGEN3_INCLUDE_DIRS})
set (RUN_TESTS TRUE CACHE BOOL "compile and run unit tests")
# Required dependencies
set(BOOST_COMPONENTS thread date_time system)
if (RUN_TESTS)
set(BOOST_COMPONENTS thread date_time filesystem system unit_test_framework)
else ()
set(BOOST_COMPONENTS thread date_time system)
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} filesystem unit_test_framework)
endif ()
if (BUILD_PYTHON_INTERFACE)
FINDPYTHON()
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
endif ()
search_for_boost()
......@@ -153,6 +159,9 @@ SET(${PROJECT_NAME}_HEADERS
)
add_subdirectory(src)
if (BUILD_PYTHON_INTERFACE)
add_subdirectory(python)
endif ()
if (RUN_TESTS)
add_subdirectory(test)
endif ()
......
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2019 CNRS-LAAS
# Author: Joseph Mirabel
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of CNRS-LAAS. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
ADD_REQUIRED_DEPENDENCY("eigenpy >= 1.2")
SET(LIBRARY_NAME hppfcl)
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" ${PYTHON_INCLUDE_DIRS})
ADD_LIBRARY(${LIBRARY_NAME} SHARED
math.cc
collision-geometries.cc
collision.cc
distance.cc
fcl.cc)
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} eigenpy)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_NAME ${LIBRARY_NAME})
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION ${PYTHON_SITELIB})
//
// Software License Agreement (BSD License)
//
// Copyright (c) 2019 CNRS-LAAS
// Author: Joseph Mirabel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of CNRS-LAAS. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <boost/python.hpp>
#include "fcl.hh"
#include <hpp/fcl/fwd.hh>
#include <hpp/fcl/shape/geometric_shapes.h>
#include <hpp/fcl/shape/convex.h>
#include <hpp/fcl/BVH/BVH_model.h>
using namespace boost::python;
using namespace hpp::fcl;
using boost::shared_ptr;
using boost::noncopyable;
template <typename BV>
struct BVHModelWrapper
{
typedef BVHModel<BV> BVHModel_t;
static Vec3f vertices (const BVHModel_t& bvh, int i)
{
if (i >= bvh.num_vertices) throw std::out_of_range("index is out of range");
return bvh.vertices[i];
}
static Triangle tri_indices (const BVHModel_t& bvh, int i)
{
if (i >= bvh.num_tris) throw std::out_of_range("index is out of range");
return bvh.tri_indices[i];
}
};
template <typename BV>
void exposeBVHModel (const std::string& bvname)
{
typedef BVHModel<BV> BVHModel_t;
typedef BVHModelWrapper<BV> Wrapper_t;
std::string type = "BVHModel" + bvname;
class_ <BVHModel_t, bases<CollisionGeometry>, shared_ptr<BVHModel_t> >
(type.c_str(), init<>())
.def ("vertices", &Wrapper_t::vertices)
.def ("tri_indices", &Wrapper_t::tri_indices)
.def_readonly ("num_vertices", &BVHModel_t::num_vertices)
.def_readonly ("num_tris", &BVHModel_t::num_tris)
.def_readonly ("convex", &BVHModel_t::convex)
.def ("buildConvexRepresentation", &BVHModel_t::buildConvexRepresentation)
;
}
struct ConvexBaseWrapper
{
static Vec3f points (const ConvexBase& convex, int i)
{
if (i >= convex.num_points) throw std::out_of_range("index is out of range");
return convex.points[i];
}
static list neighbors (const ConvexBase& convex, int i)
{
if (i >= convex.num_points) throw std::out_of_range("index is out of range");
list n;
for (unsigned char j = 0; j < convex.neighbors[i].count(); ++j)
n.append (convex.neighbors[i][j]);
return n;
}
};
template <typename PolygonT>
struct ConvexWrapper
{
typedef Convex<PolygonT> Convex_t;
static PolygonT polygons (const Convex_t& convex, int i)
{
if (i >= convex.num_polygons) throw std::out_of_range("index is out of range");
return convex.polygons[i];
}
};
void exposeShapes ()
{
class_ <ShapeBase, bases<CollisionGeometry>, shared_ptr<ShapeBase>, noncopyable>
("ShapeBase", no_init)
//.def ("getObjectType", &CollisionGeometry::getObjectType)
;
class_ <Box, bases<ShapeBase>, shared_ptr<Box> >
("Box", init<>())
.def (init<FCL_REAL,FCL_REAL,FCL_REAL>())
.def (init<Vec3f>())
.def_readwrite ("halfSide", &Box::halfSide)
;
class_ <Capsule, bases<ShapeBase>, shared_ptr<Capsule> >
("Capsule", init<FCL_REAL, FCL_REAL>())
.def_readwrite ("radius", &Capsule::radius)
.def_readwrite ("lz", &Capsule::lz)
;
class_ <Cone, bases<ShapeBase>, shared_ptr<Cone> >
("Cone", init<FCL_REAL, FCL_REAL>())
.def_readwrite ("radius", &Cone::radius)
.def_readwrite ("lz", &Cone::lz)
;
class_ <ConvexBase, bases<ShapeBase>, shared_ptr<ConvexBase >, noncopyable>
("ConvexBase", no_init)
.def_readonly ("center", &ConvexBase::center)
.def_readonly ("num_points", &ConvexBase::num_points)
.def ("points", &ConvexBaseWrapper::points)
.def ("neighbors", &ConvexBaseWrapper::neighbors)
;
class_ <Convex<Triangle>, bases<ConvexBase>, shared_ptr<Convex<Triangle> >, noncopyable>
("Convex", no_init)
.def_readonly ("num_polygons", &Convex<Triangle>::num_polygons)
.def ("polygons", &ConvexWrapper<Triangle>::polygons)
;
class_ <Cylinder, bases<ShapeBase>, shared_ptr<Cylinder> >
("Cylinder", init<FCL_REAL, FCL_REAL>())
.def_readwrite ("radius", &Cylinder::radius)
.def_readwrite ("lz", &Cylinder::lz)
;
class_ <Halfspace, bases<ShapeBase>, shared_ptr<Halfspace> >
("Halfspace", "The half-space is defined by {x | n * x < d}.", init<const Vec3f&, FCL_REAL>())
.def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>())
.def (init<>())
.def_readwrite ("n", &Halfspace::n)
.def_readwrite ("d", &Halfspace::d)
;
class_ <Plane, bases<ShapeBase>, shared_ptr<Plane> >
("Plane", "The plane is defined by {x | n * x = d}.", init<const Vec3f&, FCL_REAL>())
.def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>())
.def (init<>())
.def_readwrite ("n", &Plane::n)
.def_readwrite ("d", &Plane::d)
;
class_ <Sphere, bases<ShapeBase>, shared_ptr<Sphere> >
("Sphere", init<FCL_REAL>())
.def_readwrite ("radius", &Sphere::radius)
;
class_ <TriangleP, bases<ShapeBase>, shared_ptr<TriangleP> >
("TriangleP", init<const Vec3f&, const Vec3f&, const Vec3f&>())
.def_readwrite ("a", &TriangleP::a)
.def_readwrite ("b", &TriangleP::b)
.def_readwrite ("c", &TriangleP::c)
;
}
void exposeCollisionGeometries ()
{
enum_<OBJECT_TYPE>("OBJECT_TYPE")
.value ("OT_UNKNOWN", OT_UNKNOWN)
.value ("OT_BVH" , OT_BVH)
.value ("OT_GEOM" , OT_GEOM)
.value ("OT_OCTREE" , OT_OCTREE)
;
enum_<NODE_TYPE>("NODE_TYPE")
.value ("BV_UNKNOWN", BV_UNKNOWN)
.value ("BV_AABB" , BV_AABB)
.value ("BV_OBB" , BV_OBB)
.value ("BV_RSS" , BV_RSS)
.value ("BV_kIOS" , BV_kIOS)
.value ("BV_OBBRSS", BV_OBBRSS)
.value ("BV_KDOP16", BV_KDOP16)
.value ("BV_KDOP18", BV_KDOP18)
.value ("BV_KDOP24", BV_KDOP24)
.value ("GEOM_BOX" , GEOM_BOX)
.value ("GEOM_SPHERE" , GEOM_SPHERE)
.value ("GEOM_CAPSULE" , GEOM_CAPSULE)
.value ("GEOM_CONE" , GEOM_CONE)
.value ("GEOM_CYLINDER" , GEOM_CYLINDER)
.value ("GEOM_CONVEX" , GEOM_CONVEX)
.value ("GEOM_PLANE" , GEOM_PLANE)
.value ("GEOM_HALFSPACE", GEOM_HALFSPACE)
.value ("GEOM_TRIANGLE" , GEOM_TRIANGLE)
.value ("GEOM_OCTREE" , GEOM_OCTREE)
;
class_ <CollisionGeometry, CollisionGeometryPtr_t, noncopyable>
("CollisionGeometry", no_init)
.def ("getObjectType", &CollisionGeometry::getObjectType)
.def ("getNodeType", &CollisionGeometry::getNodeType)
.def ("computeLocalAABB", &CollisionGeometry::computeLocalAABB)
.def ("computeCOM", &CollisionGeometry::computeCOM)
.def ("computeMomentofInertia", &CollisionGeometry::computeMomentofInertia)
.def ("computeVolume", &CollisionGeometry::computeVolume)
.def ("computeMomentofInertiaRelatedToCOM", &CollisionGeometry::computeMomentofInertiaRelatedToCOM)
;
exposeShapes();
exposeBVHModel<OBB >("OBB" );
exposeBVHModel<OBBRSS >("OBBRSS" );
}
//
// Software License Agreement (BSD License)
//
// Copyright (c) 2019 CNRS-LAAS
// Author: Joseph Mirabel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of CNRS-LAAS. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <boost/python.hpp>
#include "fcl.hh"
#include <hpp/fcl/fwd.hh>
#include <hpp/fcl/collision.h>
using namespace boost::python;
using namespace hpp::fcl;
using boost::shared_ptr;
using boost::noncopyable;
void exposeCollisionAPI ()
{
enum_ <CollisionRequestFlag> ("CollisionRequestFlag")
.value ("CONTACT", CONTACT)
.value ("DISTANCE_LOWER_BOUND", DISTANCE_LOWER_BOUND)
.value ("NO_REQUEST", NO_REQUEST)
;
class_ <CollisionRequest> ("CollisionRequest", init<>())
.def (init<CollisionRequestFlag, size_t>())
.def_readwrite ("num_max_contacts" , &CollisionRequest::num_max_contacts)
.def_readwrite ("enable_contact" , &CollisionRequest::enable_contact)
.def_readwrite ("enable_distance_lower_bound", &CollisionRequest::enable_distance_lower_bound)
.def_readwrite ("enable_cached_gjk_guess" , &CollisionRequest::enable_cached_gjk_guess)
.def_readwrite ("cached_gjk_guess" , &CollisionRequest::cached_gjk_guess)
.def_readwrite ("security_margin" , &CollisionRequest::security_margin)
.def_readwrite ("break_distance" , &CollisionRequest::break_distance)
;
class_ <Contact> ("Contact", no_init)
.def_readonly ("o1", &Contact::o1)
.def_readonly ("o2", &Contact::o2)
.def_readwrite ("b1", &Contact::b1)
.def_readwrite ("b2", &Contact::b2)
.def_readwrite ("normal", &Contact::normal)
.def_readwrite ("pos", &Contact::pos)
.def_readwrite ("penetration_depth", &Contact::penetration_depth)
.def (self == self)
;
class_ <CollisionResult> ("CollisionResult", init<>())
.def ("isCollision", &CollisionResult::isCollision)
.def ("numContacts", &CollisionResult::numContacts)
.def ("clear", &CollisionResult::clear)
;
def ("collide", static_cast< std::size_t (*)(const CollisionObject*, const CollisionObject*,
const CollisionRequest&, CollisionResult&) > (&collide));
def ("collide", static_cast< std::size_t (*)(
const CollisionGeometry*, const Transform3f&,
const CollisionGeometry*, const Transform3f&,
const CollisionRequest&, CollisionResult&) > (&collide));
}
//
// Software License Agreement (BSD License)
//
// Copyright (c) 2019 CNRS-LAAS
// Author: Joseph Mirabel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of CNRS-LAAS. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <boost/python.hpp>
#include "fcl.hh"
#include <hpp/fcl/fwd.hh>
#include <hpp/fcl/distance.h>
using namespace boost::python;
using namespace hpp::fcl;
using boost::shared_ptr;
using boost::noncopyable;
void exposeDistanceAPI ()
{
class_ <DistanceRequest> ("DistanceRequest", init<optional<bool,FCL_REAL,FCL_REAL> >())
.def_readwrite ("enable_nearest_points", &DistanceRequest::enable_nearest_points)
.def_readwrite ("rel_err" , &DistanceRequest::rel_err)
.def_readwrite ("abs_err" , &DistanceRequest::abs_err)
;
class_ <DistanceResult> ("DistanceResult", init<>())
.def_readwrite ("min_distance", &DistanceResult::min_distance)
.def_readwrite ("normal", &DistanceResult::normal)
//.def_readwrite ("nearest_points", &DistanceResult::nearest_points)
.def_readonly ("o1", &DistanceResult::o1)
.def_readonly ("o2", &DistanceResult::o2)
.def_readwrite ("b1", &DistanceResult::b1)
.def_readwrite ("b2", &DistanceResult::b2)
.def ("clear", &DistanceResult::clear)
;
def ("distance", static_cast< FCL_REAL (*)(const CollisionObject*, const CollisionObject*,
const DistanceRequest&, DistanceResult&) > (&distance));
def ("distance", static_cast< FCL_REAL (*)(
const CollisionGeometry*, const Transform3f&,
const CollisionGeometry*, const Transform3f&,
const DistanceRequest&, DistanceResult&) > (&distance));
}
//
// Software License Agreement (BSD License)
//
// Copyright (c) 2019 CNRS-LAAS
// Author: Joseph Mirabel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of CNRS-LAAS. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <boost/python.hpp>
#include "fcl.hh"
#include <hpp/fcl/fwd.hh>
#include <hpp/fcl/shape/geometric_shapes.h>
#include <hpp/fcl/BVH/BVH_model.h>
#include <hpp/fcl/mesh_loader/loader.h>
#include <hpp/fcl/collision.h>
using namespace boost::python;
using namespace hpp::fcl;
using boost::shared_ptr;
using boost::noncopyable;
void exposeMeshLoader ()
{
class_ <MeshLoader> ("MeshLoader", init< optional< NODE_TYPE> >())
.def ("load", static_cast <CollisionGeometryPtr_t (MeshLoader::*) (const std::string&, const Vec3f&)> (&MeshLoader::load))
;
class_ <CachedMeshLoader, bases<MeshLoader> > ("CachedMeshLoader", init< optional< NODE_TYPE> >())
;
}
BOOST_PYTHON_MODULE(hppfcl)
{
exposeMaths();
exposeCollisionGeometries();
exposeMeshLoader();
exposeCollisionAPI();
exposeDistanceAPI();
}
void exposeMaths ();
void exposeCollisionGeometries ();
void exposeMeshLoader ();
void exposeCollisionAPI ();
void exposeDistanceAPI ();
//
// Software License Agreement (BSD License)
//
// Copyright (c) 2019 CNRS-LAAS
// Author: Joseph Mirabel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of CNRS-LAAS. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,