draw_skeleton_3d.h 1.7 KB

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