draw_skeleton_vector_graphics.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_OPENGL2_DRAW_SKELETON_VECTOR_GRAPHICS_H
  9. #define IGL_OPENGL2_DRAW_SKELETON_VECTOR_GRAPHICS_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace opengl2
  15. {
  16. // Draw a skeleton with a 2D vector graphcis style à la BBW, STBS, Monotonic,
  17. // FAST papers.
  18. //
  19. // Inputs:
  20. // C #C by dim list of joint positions
  21. // BE #BE by 2 list of bone edge indices into C
  22. // point_color color of points
  23. // line_color color of lines
  24. IGL_INLINE void draw_skeleton_vector_graphics(
  25. const Eigen::MatrixXd & C,
  26. const Eigen::MatrixXi & BE,
  27. const float * point_color,
  28. const float * line_color);
  29. // Use default colors (originally from BBW paper)
  30. IGL_INLINE void draw_skeleton_vector_graphics(
  31. const Eigen::MatrixXd & C,
  32. const Eigen::MatrixXi & BE);
  33. // T #BE*(dim+1) by dim matrix of stacked transposed bone transformations
  34. template <typename DerivedC, typename DerivedBE, typename DerivedT>
  35. IGL_INLINE void draw_skeleton_vector_graphics(
  36. const Eigen::PlainObjectBase<DerivedC> & C,
  37. const Eigen::PlainObjectBase<DerivedBE> & BE,
  38. const Eigen::PlainObjectBase<DerivedT> & T,
  39. const float * point_color,
  40. const float * line_color);
  41. template <typename DerivedC, typename DerivedBE, typename DerivedT>
  42. IGL_INLINE void draw_skeleton_vector_graphics(
  43. const Eigen::PlainObjectBase<DerivedC> & C,
  44. const Eigen::PlainObjectBase<DerivedBE> & BE,
  45. const Eigen::PlainObjectBase<DerivedT> & T);
  46. }
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "draw_skeleton_vector_graphics.cpp"
  50. #endif
  51. #endif