diff --git a/include/hpp/fcl/mesh_loader/loader.h b/include/hpp/fcl/mesh_loader/loader.h index 5039bc05fa6e97625313b6f39b34158e227a37d8..616e5368aed2c098ffdbf55ea61a7a62c6dc6d04 100644 --- a/include/hpp/fcl/mesh_loader/loader.h +++ b/include/hpp/fcl/mesh_loader/loader.h @@ -4,6 +4,7 @@ * Copyright (c) 2011-2014, Willow Garage, Inc. * Copyright (c) 2014-2015, Open Source Robotics Foundation * Copyright (c) 2016, CNRS - LAAS + * Copyright (c) 2020, INRIA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,7 +65,7 @@ namespace fcl { } virtual BVHModelPtr_t load (const std::string& filename, - const Vec3f& scale); + const Vec3f& scale = Vec3f::Ones()); MeshLoader (const NODE_TYPE& bvType = BV_OBBRSS) : bvType_ (bvType) {} diff --git a/python/fcl.cc b/python/fcl.cc index 2396bec52f79f4c4d2d6af96bcaa725c46ce2d6a..39d0aa5d47160a53a72e8d1dd6a5e2cc91ecac5f 100644 --- a/python/fcl.cc +++ b/python/fcl.cc @@ -1,7 +1,7 @@ // // Software License Agreement (BSD License) // -// Copyright (c) 2019 CNRS-LAAS INRIA +// Copyright (c) 2019-2020 CNRS-LAAS INRIA // Author: Joseph Mirabel // All rights reserved. // @@ -46,16 +46,21 @@ #include <hpp/fcl/collision.h> -using namespace boost::python; - using namespace hpp::fcl; +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(load_overloads,MeshLoader::load,1,2) + void exposeMeshLoader () { + using namespace boost::python; + if(!eigenpy::register_symbolic_link_to_registered_type<MeshLoader>()) { - class_ <MeshLoader> ("MeshLoader", init< optional< NODE_TYPE> >()) - .def ("load", static_cast <BVHModelPtr_t (MeshLoader::*) (const std::string&, const Vec3f&)> (&MeshLoader::load)) + class_ <MeshLoader> ("MeshLoader", no_init) + .def(init< optional< NODE_TYPE> >(arg("node_type"),"Default constructor")) + .def ("load",(BVHModelPtr_t(MeshLoader::*)(const std::string&,const Vec3f&))&MeshLoader::load, + load_overloads(args("filename","scale"), + "Load a mesh given by its filename")) ; }