Skip to content
Snippets Groups Projects
Unverified Commit 2720bbe2 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by GitHub
Browse files

Merge pull request #129 from jmirabel/python_doc

Generate Python documentation from doxygen documentation.
parents f2e2eb50 13529fa2
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,8 @@ matrix: ...@@ -23,6 +23,8 @@ matrix:
- libboost-all-dev - libboost-all-dev
- libassimp-dev - libassimp-dev
- libeigen3-dev - libeigen3-dev
- python-lxml
- python3-lxml
- name: "Xenial - Release - g++" - name: "Xenial - Release - g++"
env: BUILD_TYPE=Release env: BUILD_TYPE=Release
...@@ -36,6 +38,8 @@ matrix: ...@@ -36,6 +38,8 @@ matrix:
- libassimp-dev - libassimp-dev
- libeigen3-dev - libeigen3-dev
- liboctomap-dev - liboctomap-dev
- python-lxml
- python3-lxml
- name: "Bionic - Release - g++" - name: "Bionic - Release - g++"
env: BUILD_TYPE=Release env: BUILD_TYPE=Release
...@@ -49,6 +53,8 @@ matrix: ...@@ -49,6 +53,8 @@ matrix:
- libassimp-dev - libassimp-dev
- libeigen3-dev - libeigen3-dev
- liboctomap-dev - liboctomap-dev
- python-lxml
- python3-lxml
- name: "Bionic - Debug - g++" - name: "Bionic - Debug - g++"
env: BUILD_TYPE=Debug env: BUILD_TYPE=Debug
...@@ -62,6 +68,8 @@ matrix: ...@@ -62,6 +68,8 @@ matrix:
- libassimp-dev - libassimp-dev
- libeigen3-dev - libeigen3-dev
- liboctomap-dev - liboctomap-dev
- python-lxml
- python3-lxml
- name: "OSX - Release - clang" - name: "OSX - Release - clang"
env: BUILD_TYPE=Release env: BUILD_TYPE=Release
...@@ -79,12 +87,11 @@ before_install: ...@@ -79,12 +87,11 @@ before_install:
script: script:
# Create build directory # Create build directory
- which python - which python
- which python2
- mkdir build - mkdir build
- cd build - cd build
# Configure # Configure
- cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS=-w -DCMAKE_CXX_FLAGS_DEBUG=${CXX_FLAGS_DEBUG} -DPYTHON_EXECUTABLE=$(which python2) .. - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS=-w -DCMAKE_CXX_FLAGS_DEBUG=${CXX_FLAGS_DEBUG} -DPYTHON_EXECUTABLE=$(which python) ..
# Build # Build
- make - make
......
...@@ -41,8 +41,9 @@ set(PROJECT_DESCRIPTION ...@@ -41,8 +41,9 @@ set(PROJECT_DESCRIPTION
) )
SET(PROJECT_USE_CMAKE_EXPORT TRUE) SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CMAKE_C_STANDARD 99) IF(NOT DEFINED CMAKE_CXX_STANDARD)
SET(CMAKE_CXX_STANDARD 98) SET(CMAKE_CXX_STANDARD 98)
ENDIF()
# Do not support CMake older than 2.8.12 # Do not support CMake older than 2.8.12
CMAKE_POLICY(SET CMP0022 NEW) CMAKE_POLICY(SET CMP0022 NEW)
......
FILE_PATTERNS = *.h *.hh *.hxx FILE_PATTERNS = *.h *.hh *.hxx
GENERATE_XML = YES
#ifndef DOXYGEN_BOOST_DOC_HH
#define DOXYGEN_BOOST_DOC_HH
#ifndef DOXYGEN_DOC_HH
# error "You should have included doxygen.hh first."
#endif // DOXYGEN_DOC_HH
#include <boost/python.hpp>
namespace doxygen
{
namespace visitor
{
template <typename 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) {}
template <class classT>
inline void visit(classT& c) const
{
c.def(name, function, doxygen::member_func_doc(function));
}
const char* name;
function_type function;
};
// TODO surprisingly, this does not work when defined here but it works when
// defined after the generated files are included.
template <typename function_type>
inline member_func_impl<function_type> member_func (const char* name, function_type function)
{
return member_func_impl<function_type>(name, function);
}
} // namespace visitor
} // namespace doxygen
#endif // DOXYGEN_BOOST_DOC_HH
#ifndef DOXYGEN_DOC_HH
#define DOXYGEN_DOC_HH
#include <boost/preprocessor/repetition.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#ifndef DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR
#define DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR 10
#endif
namespace doxygen
{
template <typename _class>
struct class_doc_impl
{
static inline const char* run ()
{
return "";
}
static inline const char* attribute (const char*)
{
return "";
}
};
template <typename _class>
inline const char* class_doc ()
{
return class_doc_impl<_class>::run();
}
template <typename _class>
inline const char* class_attrib_doc (const char* name)
{
return class_doc_impl<_class>::attribute(name);
}
template <typename FuncPtr>
inline const char* member_func_doc (FuncPtr)
{
return "";
}
#define DOXYGEN_DOC_DECLARE_CONSTRUCTOR(z,nargs,unused) \
template < \
typename Class \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \
struct constructor_doc_##nargs##_impl { \
static inline const char* run () \
{ \
return ""; \
} \
}; \
\
template < \
typename Class \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, class Arg)> \
inline const char* constructor_doc () \
{ \
return constructor_doc_##nargs##_impl< \
Class \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM_PARAMS(nargs, Arg)>::run(); \
}
BOOST_PP_REPEAT(DOXYGEN_DOC_MAX_NUMBER_OF_ARGUMENTS_IN_CONSTRUCTOR, DOXYGEN_DOC_DECLARE_CONSTRUCTOR, ~)
/*
template <typename Class>
inline const char* constructor_doc ()
{
return "";
}
*/
template <typename Class>
struct destructor_doc_impl
{
static inline const char* run ()
{
return "";
}
};
template <typename Class>
inline const char* destructor_doc ()
{
return destructor_doc_impl<Class>::run();
}
/* TODO class attribute can be handled by
template <typename Class, typename AttributeType>
const char* attribute_doc (AttributeType Class::* ptr)
{
// Body looks like
// if (ptr == &Class::attributeName)
// return "attrib documentation";
return "undocumented";
}
*/
} // namespace doxygen
#endif // DOXYGEN_DOC_HH
This diff is collapsed.
class XmlDocString (object):
def __init__ (self, index):
self.index = index
self.tags = {
"para": self.para,
"ref": self.ref,
"briefdescription": self.otherTags,
"detaileddescription": self.otherTags,
"parameterlist": self.parameterlist,
"parameterdescription": self.otherTags,
"emphasis": self.emphasis,
"simplesect": self.simplesect,
}
self.unkwownTags = set()
self.unkwownReferences = dict()
self._linesep = "\\n\"\n\""
def clear (self):
self.lines = []
self.unkwownTags.clear()
self.unkwownReferences.clear()
def writeErrors (self, output):
ret = False
for t in self.unkwownTags:
output.warn ("Unknown tag: ", t)
ret = True
for ref,node in self.unkwownReferences.items():
output.warn ("Unknown reference: ", ref, node.text)
ret = True
return ret
def _write (self, str):
nlines=str.split(sep="\n")
if len(self.lines)==0:
self.lines += nlines
else:
self.lines[-1] += nlines[0]
self.lines += nlines[1:]
#self.lines += nlines[1:]
def _newline (self,n=1):
self.lines.extend (["",] * n)
def _clean(self):
s = 0
for l in self.lines:
if len(l.strip())==0: s+=1
else: break
e = len(self.lines)
for l in reversed(self.lines):
if len(l.strip())==0: e-=1
else: break
self.lines = self.lines[s:e]
def getDocString (self, brief, detailled, output):
self.clear()
if brief is not None:
self.visit (brief)
if detailled is not None and len(detailled.getchildren()) > 0:
if brief is not None: self._newline ()
self.visit (detailled)
from sys import stdout, stderr
self.writeErrors(output)
self._clean()
return self._linesep.join(self.lines)
def visit (self, node):
assert isinstance(node.tag, str)
tag = node.tag
if tag not in self.tags:
self.unknownTag (node)
else:
self.tags[tag](node)
def unknownTag (self, node):
self.unkwownTags.add (node.tag)
self.otherTags (node)
def otherTags (self, node):
if node.text:
self._write (node.text.strip())
for c in node.iterchildren():
self.visit (c)
if c.tail: self._write (c.tail.strip())
def emphasis (self, node):
self._write ("*")
self.otherTags(node)
self._write ("*")
def simplesect (self, node):
self._write (node.attrib["kind"].title()+": ")
self.otherTags (node)
def para (self, node):
if node.text: self._write (node.text)
for c in node.iterchildren():
self.visit (c)
if c.tail: self._write (c.tail)
self._newline()
def ref (self, node):
refid = node.attrib["refid"]
if self.index.hasref(refid):
self._write (self.index.getref(refid).name)
else:
self.unkwownReferences[refid] = node
self._write (node.text)
assert len(node.getchildren()) == 0
def parameterlist (self, node):
self._newline()
self._write (node.attrib["kind"].title())
self._newline()
for item in node.iterchildren("parameteritem"):
self.parameteritem (item)
def parameteritem (self, node):
indent = " "
self._write (indent + "- ")
# should contain two children
assert len(node.getchildren()) == 2
namelist = node.find ("parameternamelist")
desc = node.find ("parameterdescription")
sep = ""
for name in namelist.iterchildren("parametername"):
self._write (sep + name.text)
sep = ", "
self._write (" ")
self.visit (desc)
...@@ -40,9 +40,37 @@ SET(LIBRARY_NAME hppfcl) ...@@ -40,9 +40,37 @@ SET(LIBRARY_NAME hppfcl)
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" ${PYTHON_INCLUDE_DIRS}) INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" ${PYTHON_INCLUDE_DIRS})
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
SET(${LIBRARY_NAME}_HEADERS SET(${LIBRARY_NAME}_HEADERS
fcl.hh fcl.hh
) )
IF(NOT DOXYGEN_FOUND OR (APPLE AND PYTHON_VERSION_MAJOR LESS 3))
SET(ENABLE_DOXYGEN_AUTODOC FALSE)
ELSE()
SET(ENABLE_DOXYGEN_AUTODOC TRUE)
IF(APPLE)
SET(PY_PREFIX ${PYTHON_EXECUTABLE})
ENDIF()
ENDIF()
IF(ENABLE_DOXYGEN_AUTODOC)
ADD_CUSTOM_TARGET(generate_doxygen_cpp_doc
COMMAND ${PY_PREFIX} ${CMAKE_SOURCE_DIR}/doc/python/doxygen_xml_parser.py
${CMAKE_BINARY_DIR}/doc/doxygen-xml/index.xml
${CMAKE_CURRENT_BINARY_DIR}/doxygen_autodoc > ${CMAKE_CURRENT_BINARY_DIR}/doxygen_autodoc.log
BYPRODUCTS
${CMAKE_CURRENT_BINARY_DIR}/doxygen_autodoc/doxygen_xml_parser_for_cmake.hh
${CMAKE_CURRENT_BINARY_DIR}/doxygen_autodoc.log
COMMENT "Generating Doxygen C++ documentation"
)
ADD_DEPENDENCIES(generate_doxygen_cpp_doc doc)
LIST(APPEND ${LIBRARY_NAME}_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/doxygen_autodoc/doxygen_xml_parser_for_cmake.hh
)
ENDIF()
SET(${LIBRARY_NAME}_SOURCES SET(${LIBRARY_NAME}_SOURCES
version.cc version.cc
...@@ -57,6 +85,10 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_ ...@@ -57,6 +85,10 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_
ADD_DEPENDENCIES(python ${LIBRARY_NAME}) ADD_DEPENDENCIES(python ${LIBRARY_NAME})
ADD_HEADER_GROUP(${LIBRARY_NAME}_HEADER) ADD_HEADER_GROUP(${LIBRARY_NAME}_HEADER)
ADD_SOURCE_GROUP(${LIBRARY_NAME}_SOURCES) ADD_SOURCE_GROUP(${LIBRARY_NAME}_SOURCES)
IF(ENABLE_DOXYGEN_AUTODOC)
ADD_DEPENDENCIES(${LIBRARY_NAME} generate_doxygen_cpp_doc)
TARGET_COMPILE_DEFINITIONS(${LIBRARY_NAME} PRIVATE -DHAS_DOXYGEN_AUTODOC)
ENDIF()
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME} PUBLIC) TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME} PUBLIC)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME} ${BOOST_system_LIBRARY}) TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME} ${BOOST_system_LIBRARY})
......
...@@ -43,6 +43,13 @@ ...@@ -43,6 +43,13 @@
#include <hpp/fcl/shape/convex.h> #include <hpp/fcl/shape/convex.h>
#include <hpp/fcl/BVH/BVH_model.h> #include <hpp/fcl/BVH/BVH_model.h>
#ifdef HAS_DOXYGEN_AUTODOC
#include "doxygen_autodoc/hpp/fcl/BVH/BVH_model.h"
#include "doxygen_autodoc/hpp/fcl/shape/geometric_shapes.h"
#endif
#include "../doc/python/doxygen.hh"
using namespace boost::python; using namespace boost::python;
using namespace hpp::fcl; using namespace hpp::fcl;
...@@ -71,7 +78,7 @@ void exposeBVHModel (const std::string& bvname) ...@@ -71,7 +78,7 @@ 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(), init<>()) (type.c_str(), doxygen::class_doc<BVHModel_t>(), init<>(doxygen::constructor_doc<BVHModel_t>()))
; ;
} }
...@@ -108,12 +115,12 @@ struct ConvexWrapper ...@@ -108,12 +115,12 @@ struct ConvexWrapper
void exposeShapes () void exposeShapes ()
{ {
class_ <ShapeBase, bases<CollisionGeometry>, shared_ptr<ShapeBase>, noncopyable> class_ <ShapeBase, bases<CollisionGeometry>, shared_ptr<ShapeBase>, noncopyable>
("ShapeBase", no_init) ("ShapeBase", doxygen::class_doc<ShapeBase>(), no_init)
//.def ("getObjectType", &CollisionGeometry::getObjectType) //.def ("getObjectType", &CollisionGeometry::getObjectType)
; ;
class_ <Box, bases<ShapeBase>, shared_ptr<Box> > class_ <Box, bases<ShapeBase>, shared_ptr<Box> >
("Box", init<>()) ("Box", doxygen::class_doc<ShapeBase>(), init<>())
.def (init<FCL_REAL,FCL_REAL,FCL_REAL>()) .def (init<FCL_REAL,FCL_REAL,FCL_REAL>())
.def (init<Vec3f>()) .def (init<Vec3f>())
.add_property("halfSide", .add_property("halfSide",
...@@ -122,19 +129,19 @@ void exposeShapes () ...@@ -122,19 +129,19 @@ void exposeShapes ()
; ;
class_ <Capsule, bases<ShapeBase>, shared_ptr<Capsule> > class_ <Capsule, bases<ShapeBase>, shared_ptr<Capsule> >
("Capsule", init<FCL_REAL, FCL_REAL>()) ("Capsule", doxygen::class_doc<Capsule>(), init<FCL_REAL, FCL_REAL>())
.def_readwrite ("radius", &Capsule::radius) .def_readwrite ("radius", &Capsule::radius)
.def_readwrite ("halfLength", &Capsule::halfLength) .def_readwrite ("halfLength", &Capsule::halfLength)
; ;
class_ <Cone, bases<ShapeBase>, shared_ptr<Cone> > class_ <Cone, bases<ShapeBase>, shared_ptr<Cone> >
("Cone", init<FCL_REAL, FCL_REAL>()) ("Cone", doxygen::class_doc<Cone>(), init<FCL_REAL, FCL_REAL>())
.def_readwrite ("radius", &Cone::radius) .def_readwrite ("radius", &Cone::radius)
.def_readwrite ("halfLength", &Cone::halfLength) .def_readwrite ("halfLength", &Cone::halfLength)
; ;
class_ <ConvexBase, bases<ShapeBase>, shared_ptr<ConvexBase >, noncopyable> class_ <ConvexBase, bases<ShapeBase>, shared_ptr<ConvexBase >, noncopyable>
("ConvexBase", no_init) ("ConvexBase", doxygen::class_doc<ConvexBase>(), no_init)
.def_readonly ("center", &ConvexBase::center) .def_readonly ("center", &ConvexBase::center)
.def_readonly ("num_points", &ConvexBase::num_points) .def_readonly ("num_points", &ConvexBase::num_points)
.def ("points", &ConvexBaseWrapper::points) .def ("points", &ConvexBaseWrapper::points)
...@@ -142,19 +149,19 @@ void exposeShapes () ...@@ -142,19 +149,19 @@ void exposeShapes ()
; ;
class_ <Convex<Triangle>, bases<ConvexBase>, shared_ptr<Convex<Triangle> >, noncopyable> class_ <Convex<Triangle>, bases<ConvexBase>, shared_ptr<Convex<Triangle> >, noncopyable>
("Convex", no_init) ("Convex", doxygen::class_doc< Convex<Triangle> >(), no_init)
.def_readonly ("num_polygons", &Convex<Triangle>::num_polygons) .def_readonly ("num_polygons", &Convex<Triangle>::num_polygons)
.def ("polygons", &ConvexWrapper<Triangle>::polygons) .def ("polygons", &ConvexWrapper<Triangle>::polygons)
; ;
class_ <Cylinder, bases<ShapeBase>, shared_ptr<Cylinder> > class_ <Cylinder, bases<ShapeBase>, shared_ptr<Cylinder> >
("Cylinder", init<FCL_REAL, FCL_REAL>()) ("Cylinder", doxygen::class_doc<Cylinder>(), init<FCL_REAL, FCL_REAL>())
.def_readwrite ("radius", &Cylinder::radius) .def_readwrite ("radius", &Cylinder::radius)
.def_readwrite ("halfLength", &Cylinder::halfLength) .def_readwrite ("halfLength", &Cylinder::halfLength)
; ;
class_ <Halfspace, bases<ShapeBase>, shared_ptr<Halfspace> > class_ <Halfspace, bases<ShapeBase>, shared_ptr<Halfspace> >
("Halfspace", "The half-space is defined by {x | n * x < d}.", init<const Vec3f&, FCL_REAL>()) ("Halfspace", doxygen::class_doc<Halfspace>(), init<const Vec3f&, FCL_REAL>())
.def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>()) .def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>())
.def (init<>()) .def (init<>())
.def_readwrite ("n", &Halfspace::n) .def_readwrite ("n", &Halfspace::n)
...@@ -162,7 +169,7 @@ void exposeShapes () ...@@ -162,7 +169,7 @@ void exposeShapes ()
; ;
class_ <Plane, bases<ShapeBase>, shared_ptr<Plane> > class_ <Plane, bases<ShapeBase>, shared_ptr<Plane> >
("Plane", "The plane is defined by {x | n * x = d}.", init<const Vec3f&, FCL_REAL>()) ("Plane", doxygen::class_doc<Plane>(), init<const Vec3f&, FCL_REAL>())
.def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>()) .def (init<FCL_REAL,FCL_REAL,FCL_REAL,FCL_REAL>())
.def (init<>()) .def (init<>())
.def_readwrite ("n", &Plane::n) .def_readwrite ("n", &Plane::n)
...@@ -170,12 +177,12 @@ void exposeShapes () ...@@ -170,12 +177,12 @@ void exposeShapes ()
; ;
class_ <Sphere, bases<ShapeBase>, shared_ptr<Sphere> > class_ <Sphere, bases<ShapeBase>, shared_ptr<Sphere> >
("Sphere", init<FCL_REAL>()) ("Sphere", doxygen::class_doc<Sphere>(), init<FCL_REAL>(doxygen::constructor_doc<Sphere>()))
.def_readwrite ("radius", &Sphere::radius) .def_readwrite ("radius", &Sphere::radius, doxygen::class_attrib_doc<Sphere>("radius"))
; ;
class_ <TriangleP, bases<ShapeBase>, shared_ptr<TriangleP> > class_ <TriangleP, bases<ShapeBase>, shared_ptr<TriangleP> >
("TriangleP", init<const Vec3f&, const Vec3f&, const Vec3f&>()) ("TriangleP", doxygen::class_doc<TriangleP>(), init<const Vec3f&, const Vec3f&, const Vec3f&>())
.def_readwrite ("a", &TriangleP::a) .def_readwrite ("a", &TriangleP::a)
.def_readwrite ("b", &TriangleP::b) .def_readwrite ("b", &TriangleP::b)
.def_readwrite ("c", &TriangleP::c) .def_readwrite ("c", &TriangleP::c)
...@@ -187,7 +194,7 @@ boost::python::tuple AABB_distance_proxy(const AABB & self, const AABB & other) ...@@ -187,7 +194,7 @@ boost::python::tuple AABB_distance_proxy(const AABB & self, const AABB & other)
{ {
Vec3f P,Q; Vec3f P,Q;
FCL_REAL distance = self.distance(other,&P,&Q); FCL_REAL distance = self.distance(other,&P,&Q);
return boost::python::tuple((distance,P,Q)); return boost::python::make_tuple(distance,P,Q);
} }
void exposeCollisionGeometries () void exposeCollisionGeometries ()
......
...@@ -42,8 +42,14 @@ ...@@ -42,8 +42,14 @@
#include "fcl.hh" #include "fcl.hh"
using namespace boost::python; #ifdef HAS_DOXYGEN_AUTODOC
#include "doxygen_autodoc/hpp/fcl/math/transform.h"
#endif
#include "../doc/python/doxygen.hh"
#include "../doc/python/doxygen-boost.hh"
using namespace boost::python;
using namespace hpp::fcl; using namespace hpp::fcl;
struct TriangleWrapper struct TriangleWrapper
...@@ -69,30 +75,32 @@ void exposeMaths () ...@@ -69,30 +75,32 @@ void exposeMaths ()
if(!eigenpy::register_symbolic_link_to_registered_type<Eigen::AngleAxisd>()) if(!eigenpy::register_symbolic_link_to_registered_type<Eigen::AngleAxisd>())
eigenpy::exposeAngleAxis(); eigenpy::exposeAngleAxis();
class_ <Transform3f> ("Transform3f", init<>("Default constructor.")) eigenpy::enableEigenPySpecific<Matrix3f>();
.def (init<Matrix3f, Vec3f>()) eigenpy::enableEigenPySpecific<Vec3f >();
.def (init<Quaternion3f, Vec3f>())
.def (init<Matrix3f>())
.def (init<Quaternion3f>())
.def (init<Vec3f>())
.def (init<Transform3f>(args("self","other"),"Copy constructor."))
.def ("getQuatRotation", &Transform3f::getQuatRotation) class_ <Transform3f> ("Transform3f", doxygen::class_doc<Transform3f>(), init<>(doxygen::constructor_doc<Transform3f>()))
.def ("getTranslation", &Transform3f::getTranslation, return_value_policy<copy_const_reference>()) .def (init<Matrix3f, Vec3f> (doxygen::constructor_doc<Transform3f, const Matrix3f::MatrixBase&, const Vec3f::MatrixBase&>()))
.def (init<Quaternion3f, Vec3f>(doxygen::constructor_doc<Transform3f, const Quaternion3f& , const Vec3f::MatrixBase&>()))
.def (init<Matrix3f> (doxygen::constructor_doc<Transform3f, const Matrix3f& >()))
.def (init<Quaternion3f> (doxygen::constructor_doc<Transform3f, const Quaternion3f& >()))
.def (init<Vec3f> (doxygen::constructor_doc<Transform3f, const Vec3f& >()))
.def ("getQuatRotation", &Transform3f::getQuatRotation, doxygen::member_func_doc(&Transform3f::getQuatRotation))
.def ("getTranslation", &Transform3f::getTranslation, doxygen::member_func_doc(&Transform3f::getTranslation), return_value_policy<copy_const_reference>())
.def ("getRotation", &Transform3f::getRotation, return_value_policy<copy_const_reference>()) .def ("getRotation", &Transform3f::getRotation, return_value_policy<copy_const_reference>())
.def ("isIdentity", &Transform3f::setIdentity) .def ("isIdentity", &Transform3f::setIdentity)
.def ("setQuatRotation", &Transform3f::setQuatRotation) .def (doxygen::visitor::member_func("setQuatRotation", &Transform3f::setQuatRotation))
.def ("setTranslation", &Transform3f::setTranslation<Vec3f>) .def ("setTranslation", &Transform3f::setTranslation<Vec3f>)
.def ("setRotation", &Transform3f::setRotation<Matrix3f>) .def ("setRotation", &Transform3f::setRotation<Matrix3f>)
.def ("setTransform", &Transform3f::setTransform<Matrix3f,Vec3f>) .def (doxygen::visitor::member_func("setTransform", &Transform3f::setTransform<Matrix3f,Vec3f>))
.def ("setTransform", static_cast<void (Transform3f::*)(const Quaternion3f&, const Vec3f&)>(&Transform3f::setTransform)) .def (doxygen::visitor::member_func("setTransform", static_cast<void (Transform3f::*)(const Quaternion3f&, const Vec3f&)>(&Transform3f::setTransform)))
.def ("setIdentity", &Transform3f::setIdentity) .def (doxygen::visitor::member_func("setIdentity", &Transform3f::setIdentity))
.def ("transform", &Transform3f::transform<Vec3f>) .def (doxygen::visitor::member_func("transform", &Transform3f::transform<Vec3f>))
.def ("inverseInPlace", &Transform3f::inverseInPlace, return_internal_reference<>()) .def ("inverseInPlace", &Transform3f::inverseInPlace, return_internal_reference<>(), doxygen::member_func_doc(&Transform3f::inverseInPlace))
.def ("inverse", &Transform3f::inverse) .def (doxygen::visitor::member_func("inverse", &Transform3f::inverse))
.def ("inverseTimes", &Transform3f::inverseTimes) .def (doxygen::visitor::member_func("inverseTimes", &Transform3f::inverseTimes))
.def (self * self) .def (self * self)
.def (self *= self) .def (self *= self)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment