draw_skeleton_3d.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_3D_H
  9. #define IGL_DRAW_SKELETON_3D_H
  10. #include "igl_inline.h"
  11. #include "material_colors.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. #ifndef IGL_NO_OPENGL
  16. // Draw a skeleton
  17. //
  18. // Inputs:
  19. // C #C by dim List of joint rest positions
  20. // BE #BE by 2 list of bone edge indices into C
  21. // T #BE*(dim+1) by dim matrix of stacked transposed bone transformations
  22. // color #BE|1 by 4 list of color
  23. // half_bbd half bounding box diagonal to determine scaling {1.0}
  24. template <
  25. typename DerivedC,
  26. typename DerivedBE,
  27. typename DerivedT,
  28. typename Derivedcolor>
  29. IGL_INLINE void draw_skeleton_3d(
  30. const Eigen::PlainObjectBase<DerivedC> & C,
  31. const Eigen::PlainObjectBase<DerivedBE> & BE,
  32. const Eigen::PlainObjectBase<DerivedT> & T,
  33. const Eigen::PlainObjectBase<Derivedcolor> & color,
  34. const double half_bbd=0.5);
  35. // Default color
  36. template <typename DerivedC, typename DerivedBE, typename DerivedT>
  37. IGL_INLINE void draw_skeleton_3d(
  38. const Eigen::PlainObjectBase<DerivedC> & C,
  39. const Eigen::PlainObjectBase<DerivedBE> & BE,
  40. const Eigen::PlainObjectBase<DerivedT> & T);
  41. template <typename DerivedC, typename DerivedBE>
  42. IGL_INLINE void draw_skeleton_3d(
  43. const Eigen::PlainObjectBase<DerivedC> & C,
  44. const Eigen::PlainObjectBase<DerivedBE> & BE);
  45. };
  46. #endif
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "draw_skeleton_3d.cpp"
  49. #endif
  50. #endif