view_axis.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_VIEW_AXIS_H
  9. #define IGL_OPENGL2_VIEW_AXIS_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace opengl2
  15. {
  16. // Determines the view axis or depth axis of the current gl matrix
  17. // Inputs:
  18. // mv pointer to modelview matrix
  19. // Outputs:
  20. // x pointer to x-coordinate in scene coordinates of the un-normalized
  21. // viewing axis
  22. // y pointer to y-coordinate in scene coordinates of the un-normalized
  23. // viewing axis
  24. // z pointer to z-coordinate in scene coordinates of the un-normalized
  25. // viewing axis
  26. //
  27. // Note: View axis is returned *UN-normalized*
  28. IGL_INLINE void view_axis(const double * mv, double * x, double * y, double * z);
  29. // Extract mv from current GL state.
  30. IGL_INLINE void view_axis(double * x, double * y, double * z);
  31. template <typename DerivedV>
  32. IGL_INLINE void view_axis(Eigen::PlainObjectBase<DerivedV> & V);
  33. }
  34. };
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "view_axis.cpp"
  37. #endif
  38. #endif