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
Guilhem Saurel
hpp-fcl
Commits
ee5c1607
Commit
ee5c1607
authored
Nov 06, 2019
by
Gabriele Buondonno
Browse files
[python] Expose version support
parent
796c3d75
Changes
4
Hide whitespace changes
Inline
Side-by-side
python/CMakeLists.txt
View file @
ee5c1607
...
...
@@ -39,6 +39,7 @@ SET(LIBRARY_NAME hppfcl)
INCLUDE_DIRECTORIES
(
"
${
Boost_INCLUDE_DIRS
}
"
${
PYTHON_INCLUDE_DIRS
}
)
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED
version.cc
math.cc
collision-geometries.cc
collision.cc
...
...
python/fcl.cc
View file @
ee5c1607
...
...
@@ -62,6 +62,7 @@ void exposeMeshLoader ()
BOOST_PYTHON_MODULE
(
hppfcl
)
{
exposeVersion
();
exposeMaths
();
exposeCollisionGeometries
();
exposeMeshLoader
();
...
...
python/fcl.hh
View file @
ee5c1607
void
expose
Maths
();
void
expose
Version
();
void
expose
CollisionGeometries
();
void
expose
Maths
();
void
expose
MeshLoader
();
void
expose
CollisionGeometries
();
void
expose
CollisionAPI
();
void
expose
MeshLoader
();
void
exposeDistanceAPI
();
void
exposeCollisionAPI
();
void
exposeDistanceAPI
();
python/version.cc
0 → 100644
View file @
ee5c1607
//
// Copyright (c) 2019 CNRS
//
#include
"hpp/fcl/config.hh"
#include
<boost/python.hpp>
namespace
bp
=
boost
::
python
;
inline
bool
checkVersionAtLeast
(
unsigned
int
major
,
unsigned
int
minor
,
unsigned
int
patch
)
{
return
HPP_FCL_VERSION_AT_LEAST
(
major
,
minor
,
patch
);
}
inline
bool
checkVersionAtMost
(
unsigned
int
major
,
unsigned
int
minor
,
unsigned
int
patch
)
{
return
HPP_FCL_VERSION_AT_MOST
(
major
,
minor
,
patch
);
}
void
exposeVersion
()
{
// Define release numbers of the current hpp-fcl version.
bp
::
scope
().
attr
(
"__version__"
)
=
HPP_FCL_VERSION
;
bp
::
scope
().
attr
(
"HPP_FCL_MAJOR_VERSION"
)
=
HPP_FCL_MAJOR_VERSION
;
bp
::
scope
().
attr
(
"HPP_FCL_MINOR_VERSION"
)
=
HPP_FCL_MINOR_VERSION
;
bp
::
scope
().
attr
(
"HPP_FCL_PATCH_VERSION"
)
=
HPP_FCL_PATCH_VERSION
;
bp
::
def
(
"checkVersionAtLeast"
,
&
checkVersionAtLeast
,
bp
::
args
(
"major"
,
"minor"
,
"patch"
),
"Checks if the current version of hpp-fcl is at least"
" the version provided by the input arguments."
);
bp
::
def
(
"checkVersionAtMost"
,
&
checkVersionAtMost
,
bp
::
args
(
"major"
,
"minor"
,
"patch"
),
"Checks if the current version of hpp-fcl is at most"
" the version provided by the input arguments."
);
}
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