Commit 3c87e651 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Doc] document usage of pretty printers.

parent 222b8fe1
Pipeline #5985 passed with stage
in 19 minutes and 2 seconds
......@@ -6,3 +6,5 @@ INPUT = @CMAKE_SOURCE_DIR@/include \
@CMAKE_SOURCE_DIR@/doc
PREDEFINED = HPP_PINOCCHIO_PARSED_BY_DOXYGEN
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@
......@@ -27,6 +27,40 @@
namespace hpp {
/// \addtogroup to_output_stream Printing to output stream
///
/// Some tools to ease pretty printing of objects in HPP.
/// To print vectors, you have the following options:
/// \snippet tests/print.cc Example usage
/// which should output something like
/// \code
/// R = 1, 0, 0
/// 0, 1, 0
/// 0, 0, 1
/// p = 0, 0, 0
/// q = 0, 0, 0, 1
/// p = 0, 0, 0
/// q = 0, 0, 0, 1, p = 0, 0, 0
///
/// R = ( (1, 0, 0,)
/// (0, 1, 0,)
/// (0, 0, 1,) )
/// p = (0, 0, 0,)
/// q = (0, 0, 0, 1,)
/// p = (0, 0, 0,)
/// q = (0, 0, 0, 1,), p = (0, 0, 0,)
///
/// 1, 1
/// 1, 1
/// 1, 1
/// 1, 1
/// 1, 1
///
/// ( (1, 0, 0,),
/// (0, 1, 0,),
/// (0, 0, 1,), )
/// ( (1, 0, 0,), (0, 1, 0,), (0, 0, 1,), )
/// ( (1, 0,), (0, 1,), )
/// \endcode
/// \{
/// This function must be specialized for the type you want to print.
......
......@@ -28,6 +28,7 @@ using hpp::pinocchio::vectorIn_t;
int main ()
{
//! [Example usage]
std::cout << incindent
<< iendl << pretty_print (SE3::Identity())
<< iendl << condensed (SE3::Identity())
......@@ -56,6 +57,7 @@ int main ()
<< iendl << condensed (m)
<< iendl << one_line (m.block(1,1,2,2))
<< iendl;
//! [Example usage]
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment