Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Humanoid Path Planner
hpp-fcl
Commits
b85128ec
Unverified
Commit
b85128ec
authored
Sep 15, 2021
by
Justin Carpentier
Committed by
GitHub
Sep 15, 2021
Browse files
Merge pull request #243 from jcarpent/devel
Fix exposition of vertices
parents
b3490b3b
f2a8cf8d
Pipeline
#16071
passed with stage
in 37 minutes and 48 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cmake
@
ee7a773c
Compare
9078d521
...
ee7a773c
Subproject commit
9078d521dc23fabae72e3fe8d7c0068c68364eef
Subproject commit
ee7a773c5c23f83dd21eb0ccfa96277e068b0456
python/CMakeLists.txt
View file @
b85128ec
...
...
@@ -42,6 +42,7 @@ SET(LIBRARY_NAME hppfcl)
SET
(
${
LIBRARY_NAME
}
_HEADERS
fcl.hh
deprecation.hh
)
SET
(
ENABLE_PYTHON_DOXYGEN_AUTODOC TRUE CACHE BOOL
"Enable automatic documentation of Python bindings from Doxygen documentation"
)
...
...
python/collision-geometries.cc
View file @
b85128ec
...
...
@@ -36,6 +36,7 @@
#include
<eigenpy/eigen-to-python.hpp>
#include
"fcl.hh"
#include
"deprecation.hh"
#include
<hpp/fcl/fwd.hh>
#include
<hpp/fcl/shape/geometric_shapes.h>
...
...
@@ -82,7 +83,7 @@ struct BVHModelBaseWrapper
typedef
Eigen
::
Map
<
RowMatrixX3
>
MapRowMatrixX3
;
typedef
Eigen
::
Ref
<
RowMatrixX3
>
RefRowMatrixX3
;
static
Vec3f
&
vert
ic
e
(
BVHModelBase
&
bvh
,
int
i
)
static
Vec3f
&
verte
x
(
BVHModelBase
&
bvh
,
int
i
)
{
if
(
i
>=
bvh
.
num_vertices
)
throw
std
::
out_of_range
(
"index is out of range"
);
return
bvh
.
vertices
[
i
];
...
...
@@ -471,12 +472,18 @@ void exposeCollisionGeometries ()
class_
<
BVHModelBase
,
bases
<
CollisionGeometry
>
,
BVHModelPtr_t
,
noncopyable
>
(
"BVHModelBase"
,
no_init
)
.
def
(
"vert
ic
e"
,
&
BVHModelBaseWrapper
::
vert
ic
e
,
.
def
(
"verte
x
"
,
&
BVHModelBaseWrapper
::
verte
x
,
bp
::
args
(
"self"
,
"index"
),
"Retrieve the vertex given by its index."
,
bp
::
return_internal_reference
<>
())
.
def
(
"vertices"
,
&
BVHModelBaseWrapper
::
vertex
,
bp
::
args
(
"self"
,
"index"
),
"Retrieve the vertex given by its index."
,
::
hpp
::
fcl
::
python
::
deprecated_member
<
bp
::
return_internal_reference
<>
>
())
.
def
(
"vertices"
,
&
BVHModelBaseWrapper
::
vertices
,
bp
::
args
(
"self"
),
"Retrieve the vert
ex given by its index
."
,
bp
::
args
(
"self"
),
"Retrieve
all
the vert
ices
."
,
bp
::
with_custodian_and_ward_postcall
<
0
,
1
>
())
// .add_property ("vertices",
// bp::make_function(&BVHModelBaseWrapper::vertices,bp::with_custodian_and_ward_postcall<0,1>()),
// "Vertices of the BVH.")
.
def
(
"tri_indices"
,
&
BVHModelBaseWrapper
::
tri_indices
,
bp
::
args
(
"self"
,
"index"
),
"Retrieve the triangle given by its index."
)
.
def_readonly
(
"num_vertices"
,
&
BVHModelBase
::
num_vertices
)
...
...
python/deprecation.hh
0 → 100644
View file @
b85128ec
//
// Copyright (c) 2020-2021 INRIA
//
#ifndef HPP_FCL_PYTHON_UTILS_DEPRECATION_H
#define HPP_FCL_PYTHON_UTILS_DEPRECATION_H
#include
<Python.h>
#include
<boost/python.hpp>
#include
<string>
namespace
hpp
{
namespace
fcl
{
namespace
python
{
template
<
class
Policy
=
boost
::
python
::
default_call_policies
>
struct
deprecated_warning_policy
:
Policy
{
deprecated_warning_policy
(
const
std
::
string
&
warning_message
=
""
)
:
Policy
()
,
m_warning_message
(
warning_message
)
{}
template
<
class
ArgumentPackage
>
bool
precall
(
ArgumentPackage
const
&
args
)
const
{
PyErr_WarnEx
(
PyExc_UserWarning
,
m_warning_message
.
c_str
(),
1
);
return
static_cast
<
const
Policy
*>
(
this
)
->
precall
(
args
);
}
typedef
typename
Policy
::
result_converter
result_converter
;
typedef
typename
Policy
::
argument_package
argument_package
;
protected:
const
std
::
string
m_warning_message
;
};
template
<
class
Policy
=
boost
::
python
::
default_call_policies
>
struct
deprecated_member
:
deprecated_warning_policy
<
Policy
>
{
deprecated_member
(
const
std
::
string
&
warning_message
=
"This class member has been marked as deprecated and will be removed in a future release."
)
:
deprecated_warning_policy
<
Policy
>
(
warning_message
)
{}
};
template
<
class
Policy
=
boost
::
python
::
default_call_policies
>
struct
deprecated_function
:
deprecated_warning_policy
<
Policy
>
{
deprecated_function
(
const
std
::
string
&
warning_message
=
"This function has been marked as deprecated and will be removed in a future release."
)
:
deprecated_warning_policy
<
Policy
>
(
warning_message
)
{}
};
}
}
}
#endif // ifndef HPP_FCL_PYTHON_UTILS_DEPRECATION_H
python/fcl.cc
View file @
b85128ec
...
...
@@ -89,6 +89,7 @@ void exposeMeshLoader ()
BOOST_PYTHON_MODULE
(
hppfcl
)
{
boost
::
python
::
import
(
"warnings"
);
exposeVersion
();
exposeMaths
();
exposeCollisionGeometries
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment