draw_skeleton_vector_graphics.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_DRAW_SKELETON_VECTOR_GRAPHICS_H
  9. #define IGL_DRAW_SKELETON_VECTOR_GRAPHICS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Draw a skeleton with a 2D vector graphcis style à la BBW, STBS, Monotonic,
  15. // FAST papers.
  16. //
  17. // Inputs:
  18. // C #C by dim list of joint positions
  19. // BE #BE by 2 list of bone edge indices into C
  20. // point_color color of points
  21. // line_color color of lines
  22. IGL_INLINE void draw_skeleton_vector_graphics(
  23. const Eigen::MatrixXd & C,
  24. const Eigen::MatrixXi & BE,
  25. const float * point_color,
  26. const float * line_color);
  27. // Use default colors (originally from BBW paper)
  28. IGL_INLINE void draw_skeleton_vector_graphics(
  29. const Eigen::MatrixXd & C,
  30. const Eigen::MatrixXi & BE);
  31. // T #BE*(dim+1) by dim matrix of stacked transposed bone transformations
  32. template <typename DerivedC, typename DerivedBE, typename DerivedT>
  33. IGL_INLINE void draw_skeleton_vector_graphics(
  34. const Eigen::PlainObjectBase<DerivedC> & C,
  35. const Eigen::PlainObjectBase<DerivedBE> & BE,
  36. const Eigen::PlainObjectBase<DerivedT> & T,
  37. const float * point_color,
  38. const float * line_color);
  39. template <typename DerivedC, typename DerivedBE, typename DerivedT>
  40. IGL_INLINE void draw_skeleton_vector_graphics(
  41. const Eigen::PlainObjectBase<DerivedC> & C,
  42. const Eigen::PlainObjectBase<DerivedBE> & BE,
  43. const Eigen::PlainObjectBase<DerivedT> & T);
  44. }
  45. #ifndef IGL_STATIC_LIBRARY
  46. # include "draw_skeleton_vector_graphics.cpp"
  47. #endif
  48. #endif