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
28fcee4d
Commit
28fcee4d
authored
Feb 05, 2020
by
Joseph Mirabel
Browse files
[Python][Doc] Handle class attributes.
parent
1536e0f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/python/doxygen.hh
View file @
28fcee4d
...
...
@@ -17,6 +17,10 @@ static inline const char* run ()
{
return
""
;
}
static
inline
const
char
*
attribute
(
const
char
*
)
{
return
""
;
}
};
template
<
typename
_class
>
...
...
@@ -25,6 +29,12 @@ 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
)
{
...
...
doc/python/doxygen_xml_parser.py
View file @
28fcee4d
...
...
@@ -26,7 +26,16 @@ static inline const char* run ()
{{
return "{docstring}";
}}
static inline const char* attribute (const char* attrib)
{{{attributes}
(void)attrib; // turn off unused parameter warning.
return "";
}}
}};"""
template_class_attribute_body
=
\
"""
if (strcmp(attrib, "{attribute}") == 0)
return "{docstring}";"""
template_constructor_doc
=
\
"""
template <{tplargs}>
...
...
@@ -352,11 +361,23 @@ class ClassCompound (CompoundBase):
self
.
definition
.
find
(
'briefdescription'
),
self
.
definition
.
find
(
'detaileddescription'
),
self
.
index
.
output
)
if
len
(
docstring
)
==
0
:
return
attribute_docstrings
=
""
for
member
in
self
.
attributes
:
_dc
=
self
.
index
.
xml_docstring
.
getDocString
(
member
.
find
(
'briefdescription'
),
member
.
find
(
'detaileddescription'
),
self
.
index
.
output
)
if
len
(
_dc
)
==
0
:
continue
attribute_docstrings
+=
template_class_attribute_body
.
format
(
attribute
=
member
.
find
(
'name'
).
text
,
docstring
=
_dc
,
)
if
len
(
docstring
)
==
0
and
len
(
attribute_docstrings
)
==
0
:
return
output
.
out
(
template_class_doc
.
format
(
tplargs
=
self
.
_templateDecl
(),
classname
=
self
.
_className
(),
docstring
=
docstring
,
attributes
=
attribute_docstrings
,
))
def
write
(
self
,
output
):
...
...
python/collision-geometries.cc
View file @
28fcee4d
...
...
@@ -173,8 +173,8 @@ void exposeShapes ()
;
class_
<
Sphere
,
bases
<
ShapeBase
>
,
shared_ptr
<
Sphere
>
>
(
"Sphere"
,
doxygen
::
class_doc
<
Sphere
>
(),
init
<
FCL_REAL
>
())
.
def_readwrite
(
"radius"
,
&
Sphere
::
radius
)
(
"Sphere"
,
doxygen
::
class_doc
<
Sphere
>
(),
init
<
FCL_REAL
>
(
doxygen
::
constructor_doc
<
Sphere
>
()
))
.
def_readwrite
(
"radius"
,
&
Sphere
::
radius
,
doxygen
::
class_attrib_doc
<
Sphere
>
(
"radius"
)
)
;
class_
<
TriangleP
,
bases
<
ShapeBase
>
,
shared_ptr
<
TriangleP
>
>
...
...
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