draw_skeleton_vector_graphics.h 1.9 KB

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