draw_point.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_POINT_H
  9. #define IGL_OPENGL2_DRAW_POINT_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace opengl2
  15. {
  16. //double POINT_COLOR[3] = {239./255.,213./255.,46./255.};
  17. // Draw a nice looking, colored dot at a given point in 3d.
  18. //
  19. // Note: expects that GL_CURRENT_COLOR is set with the desired foreground color
  20. //
  21. // Inputs:
  22. // x x-coordinate of point, modelview coordinates
  23. // y y-coordinate of point, modelview coordinates
  24. // z z-coordinate of point, modelview coordinates
  25. // requested_r outer-most radius of dot {7}, measured in screen space pixels
  26. // selected fills inner circle with black {false}
  27. // Asserts that requested_r does not exceed 0.5*GL_POINT_SIZE_MAX
  28. IGL_INLINE void draw_point(
  29. const double x,
  30. const double y,
  31. const double z,
  32. const double requested_r = 7,
  33. const bool selected = false);
  34. template <typename DerivedP>
  35. IGL_INLINE void draw_point(
  36. const Eigen::PlainObjectBase<DerivedP> & P,
  37. const double requested_r = 7,
  38. const bool selected = false);
  39. }
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "draw_point.cpp"
  43. #endif
  44. #endif