Commit e571c028 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Python][Doc] Generate args.

parent b706cdab
...@@ -16,25 +16,81 @@ namespace visitor ...@@ -16,25 +16,81 @@ namespace visitor
template <typename function_type> template <typename function_type>
struct member_func_impl : boost::python::def_visitor<member_func_impl<function_type> > struct member_func_impl : boost::python::def_visitor<member_func_impl<function_type> >
{ {
member_func_impl(const char* n, function_type f) : name(n), function(f) {} member_func_impl(const char* n, const function_type& f) : name(n), function(f) {}
template <class classT> template <class classT>
inline void visit(classT& c) const inline void visit(classT& c) const
{ {
c.def(name, function, doxygen::member_func_doc(function)); // Either a boost::python::keyword<N> object or a void_ object
call (c, member_func_args(function));
}
template <class classT, std::size_t nkeywords>
inline void call(classT& c, const boost::python::detail::keywords<nkeywords>& args) const
{
c.def(name, function, member_func_doc(function), args);
}
template <class classT>
inline void call(classT& c, const void_&) const
{
c.def(name, function, member_func_doc(function));
} }
const char* name; const char* name;
function_type function; const function_type& function;
}; };
// TODO surprisingly, this does not work when defined here but it works when // TODO surprisingly, this does not work when defined here but it works when
// defined after the generated files are included. // defined after the generated files are included.
template <typename function_type> template <typename function_type>
inline member_func_impl<function_type> member_func (const char* name, function_type function) inline member_func_impl<function_type> member_func (const char* name, const function_type& function)
{ {
return member_func_impl<function_type>(name, function); return member_func_impl<function_type>(name, function);
} }
#define DOXYGEN_DOC_DECLARE_INIT_VISITOR(z,nargs,unused) \
template < \
typename Class \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \
struct init_##nargs##_impl : boost::python::def_visitor<init_##nargs##_impl< \
Class \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, Arg)> > { \
typedef constructor_##nargs##_impl<Class BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, Arg)> constructor; \
typedef boost::python::init<BOOST_PP_ENUM_PARAMS(nargs, Arg)> init_base; \
\
template <class classT> \
inline void visit(classT& c) const { call (c, constructor::args()); } \
\
template <class classT> \
void call(classT& c, const boost::python::detail::keywords<nargs+1>& args) \
const \
{ \
c.def(init_base(constructor::doc(), args)); \
} \
\
template <class classT> \
void call(classT& c, const void_&) const \
{ \
c.def(init_base(constructor::doc())); \
} \
}; \
\
template <typename Class BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \
inline init_##nargs##_impl<Class BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, Arg)> init () \
{ \
return init_##nargs##_impl<Class BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, Arg)>(); \
}
BOOST_PP_REPEAT(DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR, DOXYGEN_DOC_DECLARE_INIT_VISITOR, ~)
#undef DOXYGEN_DOC_DECLARE_INIT_VISITOR
} // namespace visitor } // namespace visitor
template<typename Func> template<typename Func>
......
...@@ -4,12 +4,16 @@ ...@@ -4,12 +4,16 @@
#include <boost/preprocessor/repetition.hpp> #include <boost/preprocessor/repetition.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp> #include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/mpl/void.hpp>
#ifndef DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR #ifndef DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR
#define DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR 10 #define DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR 10
#endif #endif
namespace doxygen namespace doxygen
{ {
typedef boost::mpl::void_ void_;
template <typename _class> template <typename _class>
struct class_doc_impl struct class_doc_impl
{ {
...@@ -41,16 +45,26 @@ inline const char* member_func_doc (FuncPtr) ...@@ -41,16 +45,26 @@ inline const char* member_func_doc (FuncPtr)
return ""; return "";
} }
template <typename FuncPtr>
inline void_ member_func_args (FuncPtr)
{
return void_();
}
#define DOXYGEN_DOC_DECLARE_CONSTRUCTOR(z,nargs,unused) \ #define DOXYGEN_DOC_DECLARE_CONSTRUCTOR(z,nargs,unused) \
template < \ template < \
typename Class \ typename Class \
BOOST_PP_COMMA_IF(nargs) \ BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \ BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \
struct constructor_doc_##nargs##_impl { \ struct constructor_##nargs##_impl { \
static inline const char* run () \ static inline const char* doc () \
{ \ { \
return ""; \ return ""; \
} \ } \
static inline void_ args () \
{ \
return void_(); \
} \
}; \ }; \
\ \
template < \ template < \
...@@ -59,14 +73,14 @@ template < \ ...@@ -59,14 +73,14 @@ template < \
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \ BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \
inline const char* constructor_doc () \ inline const char* constructor_doc () \
{ \ { \
return constructor_doc_##nargs##_impl< \ return constructor_##nargs##_impl< \
Class \ Class \
BOOST_PP_COMMA_IF(nargs) \ BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, Arg)>::run(); \ BOOST_PP_ENUM_PARAMS(nargs, Arg)>::doc(); \
} }
BOOST_PP_REPEAT(DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR, DOXYGEN_DOC_DECLARE_CONSTRUCTOR, ~) BOOST_PP_REPEAT(DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR, DOXYGEN_DOC_DECLARE_CONSTRUCTOR, ~)
#undef DOXYGEN_DOC_DECLARE_CONSTRUCTOR
/* /*
template <typename Class> template <typename Class>
inline const char* constructor_doc () inline const char* constructor_doc ()
......
...@@ -39,12 +39,16 @@ template_class_attribute_body = \ ...@@ -39,12 +39,16 @@ template_class_attribute_body = \
template_constructor_doc = \ template_constructor_doc = \
""" """
template <{tplargs}> template <{tplargs}>
struct constructor_doc_{nargs}_impl< {classname_prefix}{comma}{argsstring} > struct constructor_{nargs}_impl< {classname_prefix}{comma}{argsstring} >
{{ {{
static inline const char* run () static inline const char* doc ()
{{ {{
return "{docstring}"; return "{docstring}";
}} }}
static inline boost::python::detail::keywords<{nargs}+1> args ()
{{
return ({argnamesstring});
}}
}};""" }};"""
template_destructor_doc = \ template_destructor_doc = \
""" """
...@@ -66,6 +70,16 @@ template_member_func_doc_body = \ ...@@ -66,6 +70,16 @@ template_member_func_doc_body = \
""" """
if (function_ptr == static_cast<{rettype} ({classname_prefix}*) {argsstring}>(&{classname_prefix}{membername})) if (function_ptr == static_cast<{rettype} ({classname_prefix}*) {argsstring}>(&{classname_prefix}{membername}))
return "{docstring}";""" return "{docstring}";"""
template_member_func_args = \
"""
{template}inline boost::python::detail::keywords<{n}> member_func_args ({rettype} ({classname_prefix}*function_ptr) {argsstring})
{{{body}
return ({default_args});
}}"""
template_member_func_args_body = \
"""
if (function_ptr == static_cast<{rettype} ({classname_prefix}*) {argsstring}>(&{classname_prefix}{membername}))
return ({args});"""
template_static_func_doc = \ template_static_func_doc = \
""" """
{template}inline const char* member_func_doc ({rettype} (*function_ptr) {argsstring}) {template}inline const char* member_func_doc ({rettype} (*function_ptr) {argsstring})
...@@ -177,7 +191,7 @@ class MemberDef(Reference): ...@@ -177,7 +191,7 @@ class MemberDef(Reference):
self.const = (memberdefxml.attrib['const']=="yes") self.const = (memberdefxml.attrib['const']=="yes")
self.static = (memberdefxml.attrib['static']=="yes") self.static = (memberdefxml.attrib['static']=="yes")
self.rettype = memberdefxml.find('type') self.rettype = memberdefxml.find('type')
self.params = tuple( [ (param.find('type'), param.find('array')) for param in self.xml.findall("param") ] ) self.params = tuple( [ (param.find('type'), param.find('declname'), param.find('array')) for param in self.xml.findall("param") ] )
self.special = self.rettype.text is None and len(self.rettype.getchildren())==0 self.special = self.rettype.text is None and len(self.rettype.getchildren())==0
#assert self.special or len(self.rettype.text) > 0 #assert self.special or len(self.rettype.text) > 0
...@@ -208,9 +222,9 @@ class MemberDef(Reference): ...@@ -208,9 +222,9 @@ class MemberDef(Reference):
if len(self.parent.template_params) > 0: if len(self.parent.template_params) > 0:
tplargs = " <" + ", ".join([ d['name'] for d in self.parent.template_params ]) + " > " tplargs = " <" + ", ".join([ d['name'] for d in self.parent.template_params ]) + " > "
args = ", ".join( args = ", ".join(
[ self.xmlToType(type, array, parentClass=self.parent, tplargs=tplargs) for type,array in self.params]) [ self.xmlToType(type, array, parentClass=self.parent, tplargs=tplargs) for type,declname,array in self.params])
else: else:
args = ", ".join([ self.xmlToType(type, array) for type, array in self.params]) args = ", ".join([ self.xmlToType(type, array) for type,declname,array in self.params])
return args return args
def s_tpldecl (self): def s_tpldecl (self):
...@@ -230,6 +244,18 @@ class MemberDef(Reference): ...@@ -230,6 +244,18 @@ class MemberDef(Reference):
self.xml.find('detaileddescription'), self.xml.find('detaileddescription'),
self.index.output) self.index.output)
def n_args (self):
return len(self.params)
def s_argnamesstring (self):
def getdeclname(i,declname):
if declname is None or declname.text is None or declname.text.strip() == "":
return "arg{}".format(i)
return declname.text.strip()
arg = """boost::python::arg("{}")"""
argnames = ["self", ] + [ getdeclname(i, declname) for i,(_,declname,_) in enumerate(self.params)]
return ", ".join([ arg.format(n) for n in argnames ])
def include (self): def include (self):
import os.path import os.path
loc = self.xml.find('location') loc = self.xml.find('location')
...@@ -411,7 +437,8 @@ class ClassCompound (CompoundBase): ...@@ -411,7 +437,8 @@ class ClassCompound (CompoundBase):
for member in self.special_funcs: for member in self.special_funcs:
docstring = member.s_docstring() docstring = member.s_docstring()
if len(docstring) == 0: continue argnamesstring = member.s_argnamesstring()
if len(docstring) == 0 and len(argnamesstring) == 0: continue
if member.s_name()[0] == '~': if member.s_name()[0] == '~':
output.out (template_destructor_doc.format ( output.out (template_destructor_doc.format (
tplargs = self._templateDecl(), tplargs = self._templateDecl(),
...@@ -426,19 +453,24 @@ class ClassCompound (CompoundBase): ...@@ -426,19 +453,24 @@ class ClassCompound (CompoundBase):
classname_prefix = self._className(), classname_prefix = self._className(),
argsstring = member.s_args(), argsstring = member.s_args(),
docstring = docstring, docstring = docstring,
argnamesstring = argnamesstring,
)) ))
for prototype, members in member_funcs.items(): for prototype, members in member_funcs.items():
# remove undocumented members # remove undocumented members
documented_members = [] documented_members = []
docstrings = [] docstrings = []
argnamesstrings = []
for member in members: for member in members:
docstring = member.s_docstring() docstring = member.s_docstring()
if len(docstring) == 0: continue argnamesstring = member.s_argnamesstring()
if len(docstring) == 0 and len(argnamesstring) == 0: continue
documented_members.append (member) documented_members.append (member)
docstrings.append (docstring) docstrings.append (docstring)
argnamesstrings.append (argnamesstring)
if len(documented_members) == 0: continue if len(documented_members) == 0: continue
# Write docstrings
body = "".join([ body = "".join([
template_member_func_doc_body.format ( template_member_func_doc_body.format (
classname_prefix = classname_prefix, classname_prefix = classname_prefix,
...@@ -459,6 +491,32 @@ class ClassCompound (CompoundBase): ...@@ -459,6 +491,32 @@ class ClassCompound (CompoundBase):
body = body body = body
)) ))
# Write argnamesstrings
body = "".join([
template_member_func_args_body.format (
classname_prefix = classname_prefix,
membername = member.s_name(),
args = argnamesstring,
rettype = member.s_rettype(),
argsstring = member.s_prototypeArgs(),
)
for member, argnamesstring in zip(documented_members,argnamesstrings) ])
n_args = member.n_args()
default_args = ", ".join(["""boost::python::arg("self")""", ] +
[ """boost::python::arg("arg{}")""".format(i) for i in range(n_args) ]
)
output.out (template_member_func_args.format (
template = "template <{}>\n".format (tplargs) if len(tplargs) > 0 else "",
rettype = member.s_rettype(),
n = n_args+1,
default_args = default_args,
classname_prefix = classname_prefix,
argsstring = member.s_prototypeArgs(),
body = body
))
output.out (template_close_namespace.format (namespace="doxygen")) output.out (template_close_namespace.format (namespace="doxygen"))
output.close() output.close()
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#endif #endif
#include "../doc/python/doxygen.hh" #include "../doc/python/doxygen.hh"
#include "../doc/python/doxygen-boost.hh"
#define DEF_RW_CLASS_ATTRIB(CLASS, ATTRIB) \ #define DEF_RW_CLASS_ATTRIB(CLASS, ATTRIB) \
def_readwrite (#ATTRIB, &CLASS::ATTRIB, \ def_readwrite (#ATTRIB, &CLASS::ATTRIB, \
...@@ -57,13 +58,14 @@ ...@@ -57,13 +58,14 @@
def_readonly (#ATTRIB, &CLASS::ATTRIB, \ def_readonly (#ATTRIB, &CLASS::ATTRIB, \
doxygen::class_attrib_doc<CLASS>(#ATTRIB)) doxygen::class_attrib_doc<CLASS>(#ATTRIB))
#define DEF_CLASS_FUNC(CLASS, ATTRIB) \ #define DEF_CLASS_FUNC(CLASS, ATTRIB) \
def (#ATTRIB, &CLASS::ATTRIB, doxygen::member_func_doc(&CLASS::ATTRIB)) def (dv::member_func(#ATTRIB, &CLASS::ATTRIB))
#define DEF_CLASS_FUNC2(CLASS, ATTRIB,policy) \ #define DEF_CLASS_FUNC2(CLASS, ATTRIB,policy) \
def (#ATTRIB, &CLASS::ATTRIB, doxygen::member_func_doc(&CLASS::ATTRIB),policy) def (#ATTRIB, &CLASS::ATTRIB, doxygen::member_func_doc(&CLASS::ATTRIB),policy)
using namespace boost::python; using namespace boost::python;
using namespace hpp::fcl; using namespace hpp::fcl;
namespace dv = doxygen::visitor;
using boost::shared_ptr; using boost::shared_ptr;
using boost::noncopyable; using boost::noncopyable;
...@@ -89,7 +91,8 @@ void exposeBVHModel (const std::string& bvname) ...@@ -89,7 +91,8 @@ void exposeBVHModel (const std::string& bvname)
std::string type = "BVHModel" + bvname; std::string type = "BVHModel" + bvname;
class_ <BVHModel_t, bases<BVHModelBase>, shared_ptr<BVHModel_t> > class_ <BVHModel_t, bases<BVHModelBase>, shared_ptr<BVHModel_t> >
(type.c_str(), doxygen::class_doc<BVHModel_t>(), init<>(doxygen::constructor_doc<BVHModel_t>())) (type.c_str(), doxygen::class_doc<BVHModel_t>(), no_init)
.def (dv::init<BVHModel_t>())
; ;
} }
...@@ -131,9 +134,10 @@ void exposeShapes () ...@@ -131,9 +134,10 @@ void exposeShapes ()
; ;
class_ <Box, bases<ShapeBase>, shared_ptr<Box> > class_ <Box, bases<ShapeBase>, shared_ptr<Box> >
("Box", doxygen::class_doc<ShapeBase>(), init<>()) ("Box", doxygen::class_doc<ShapeBase>(), no_init)
.def (init<FCL_REAL,FCL_REAL,FCL_REAL>()) .def (dv::init<Box>())
.def (init<Vec3f>()) .def (dv::init<Box, FCL_REAL,FCL_REAL,FCL_REAL>())
.def (dv::init<Box, const Vec3f&>())
.add_property("halfSide", .add_property("halfSide",
make_getter(&Box::halfSide, return_value_policy<return_by_value>()), make_getter(&Box::halfSide, return_value_policy<return_by_value>()),
make_setter(&Box::halfSide, return_value_policy<return_by_value>()), make_setter(&Box::halfSide, return_value_policy<return_by_value>()),
...@@ -141,13 +145,15 @@ void exposeShapes () ...@@ -141,13 +145,15 @@ void exposeShapes ()
; ;
class_ <Capsule, bases<ShapeBase>, shared_ptr<Capsule> > class_ <Capsule, bases<ShapeBase>, shared_ptr<Capsule> >
("Capsule", doxygen::class_doc<Capsule>(), init<FCL_REAL, FCL_REAL>()) ("Capsule", doxygen::class_doc<Capsule>(), no_init)
.def (dv::init<Capsule, FCL_REAL, FCL_REAL>())
.DEF_RW_CLASS_ATTRIB (Capsule, radius) .DEF_RW_CLASS_ATTRIB (Capsule, radius)
.DEF_RW_CLASS_ATTRIB (Capsule, halfLength) .DEF_RW_CLASS_ATTRIB (Capsule, halfLength)
; ;
class_ <Cone, bases<ShapeBase>, shared_ptr<Cone> > class_ <Cone, bases<ShapeBase>, shared_ptr<Cone> >
("Cone", doxygen::class_doc<Cone>(), init<FCL_REAL, FCL_REAL>()) ("Cone", doxygen::class_doc<Cone>(), no_init)
.def (dv::init<Cone, FCL_REAL, FCL_REAL>())
.DEF_RW_CLASS_ATTRIB (Cone, radius) .DEF_RW_CLASS_ATTRIB (Cone, radius)
.DEF_RW_CLASS_ATTRIB (Cone, halfLength) .DEF_RW_CLASS_ATTRIB (Cone, halfLength)
; ;
...@@ -167,34 +173,39 @@ void exposeShapes () ...@@ -167,34 +173,39 @@ void exposeShapes ()
; ;
class_ <Cylinder, bases<ShapeBase>, shared_ptr<Cylinder> > class_ <Cylinder, bases<ShapeBase>, shared_ptr<Cylinder> >
("Cylinder", doxygen::class_doc<Cylinder>(), init<FCL_REAL, FCL_REAL>()) ("Cylinder", doxygen::class_doc<Cylinder>(), no_init)
.def (dv::init<Cylinder, FCL_REAL, FCL_REAL>())
.DEF_RW_CLASS_ATTRIB (Cylinder, radius) .DEF_RW_CLASS_ATTRIB (Cylinder, radius)
.DEF_RW_CLASS_ATTRIB (Cylinder, halfLength) .DEF_RW_CLASS_ATTRIB (Cylinder, halfLength)
; ;
class_ <Halfspace, bases<ShapeBase>, shared_ptr<Halfspace> > class_ <Halfspace, bases<ShapeBase>, shared_ptr<Halfspace> >
("Halfspace", doxygen::class_doc<Halfspace>(), init<const Vec3f&, FCL_REAL>()) ("Halfspace", doxygen::class_doc<Halfspace>(), no_init)
.def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>()) .def (dv::init<Halfspace, const Vec3f&, FCL_REAL>())
.def (init<>()) .def (dv::init<Halfspace, FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>())
.def (dv::init<Halfspace>())
.DEF_RW_CLASS_ATTRIB (Halfspace, n) .DEF_RW_CLASS_ATTRIB (Halfspace, n)
.DEF_RW_CLASS_ATTRIB (Halfspace, d) .DEF_RW_CLASS_ATTRIB (Halfspace, d)
; ;
class_ <Plane, bases<ShapeBase>, shared_ptr<Plane> > class_ <Plane, bases<ShapeBase>, shared_ptr<Plane> >
("Plane", doxygen::class_doc<Plane>(), init<const Vec3f&, FCL_REAL>()) ("Plane", doxygen::class_doc<Plane>(), no_init)
.def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>()) .def (dv::init<Plane, const Vec3f&, FCL_REAL>())
.def (init<>()) .def (dv::init<Plane, FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>())
.def (dv::init<Plane>())
.DEF_RW_CLASS_ATTRIB (Plane, n) .DEF_RW_CLASS_ATTRIB (Plane, n)
.DEF_RW_CLASS_ATTRIB (Plane, d) .DEF_RW_CLASS_ATTRIB (Plane, d)
; ;
class_ <Sphere, bases<ShapeBase>, shared_ptr<Sphere> > class_ <Sphere, bases<ShapeBase>, shared_ptr<Sphere> >
("Sphere", doxygen::class_doc<Sphere>(), init<FCL_REAL>(doxygen::constructor_doc<Sphere>())) ("Sphere", doxygen::class_doc<Sphere>(), no_init)
.def (dv::init<Sphere, FCL_REAL>())
.DEF_RW_CLASS_ATTRIB (Sphere, radius) .DEF_RW_CLASS_ATTRIB (Sphere, radius)
; ;
class_ <TriangleP, bases<ShapeBase>, shared_ptr<TriangleP> > class_ <TriangleP, bases<ShapeBase>, shared_ptr<TriangleP> >
("TriangleP", doxygen::class_doc<TriangleP>(), init<const Vec3f&, const Vec3f&, const Vec3f&>()) ("TriangleP", doxygen::class_doc<TriangleP>(), no_init)
.def (dv::init<TriangleP, const Vec3f&, const Vec3f&, const Vec3f&>())
.DEF_RW_CLASS_ATTRIB (TriangleP, a) .DEF_RW_CLASS_ATTRIB (TriangleP, a)
.DEF_RW_CLASS_ATTRIB (TriangleP, b) .DEF_RW_CLASS_ATTRIB (TriangleP, b)
.DEF_RW_CLASS_ATTRIB (TriangleP, c) .DEF_RW_CLASS_ATTRIB (TriangleP, c)
......
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
#include <eigenpy/registration.hpp> #include <eigenpy/registration.hpp>
#include "fcl.hh"
#include <hpp/fcl/fwd.hh> #include <hpp/fcl/fwd.hh>
#include <hpp/fcl/collision.h> #include <hpp/fcl/collision.h>
#include "fcl.hh"
#ifdef HPP_FCL_HAS_DOXYGEN_AUTODOC #ifdef HPP_FCL_HAS_DOXYGEN_AUTODOC
#include "doxygen_autodoc/functions.h" #include "doxygen_autodoc/functions.h"
#include "doxygen_autodoc/hpp/fcl/collision_data.h" #include "doxygen_autodoc/hpp/fcl/collision_data.h"
...@@ -57,14 +57,15 @@ ...@@ -57,14 +57,15 @@
def_readonly (#ATTRIB, &CLASS::ATTRIB, \ def_readonly (#ATTRIB, &CLASS::ATTRIB, \
doxygen::class_attrib_doc<CLASS>(#ATTRIB)) doxygen::class_attrib_doc<CLASS>(#ATTRIB))
#define DEF_CLASS_FUNC(CLASS, ATTRIB) \ #define DEF_CLASS_FUNC(CLASS, ATTRIB) \
def (#ATTRIB, &CLASS::ATTRIB, doxygen::member_func_doc(&CLASS::ATTRIB)) def (dv::member_func(#ATTRIB, &CLASS::ATTRIB))
#define DEF_CLASS_FUNC2(CLASS, ATTRIB,policy) \ #define DEF_CLASS_FUNC2(CLASS, ATTRIB,policy) \
def (#ATTRIB, &CLASS::ATTRIB, doxygen::member_func_doc(&CLASS::ATTRIB),policy) def (#ATTRIB, &CLASS::ATTRIB, doxygen::member_func_doc(&CLASS::ATTRIB),policy)
using namespace boost::python; using namespace boost::python;
using namespace hpp::fcl; using namespace hpp::fcl;
namespace dv = doxygen::visitor;
void exposeCollisionAPI () void exposeCollisionAPI ()
{ {
if(!eigenpy::register_symbolic_link_to_registered_type<CollisionRequestFlag>()) if(!eigenpy::register_symbolic_link_to_registered_type<CollisionRequestFlag>())
...@@ -79,8 +80,9 @@ void exposeCollisionAPI () ...@@ -79,8 +80,9 @@ void exposeCollisionAPI ()
if(!eigenpy::register_symbolic_link_to_registered_type<CollisionRequest>()) if(!eigenpy::register_symbolic_link_to_registered_type<CollisionRequest>())
{ {
class_ <CollisionRequest> ("CollisionRequest", class_ <CollisionRequest> ("CollisionRequest",
doxygen::class_doc<CollisionRequest>(), init<>()) doxygen::class_doc<CollisionRequest>(), no_init)
.def (init<CollisionRequestFlag, size_t>())