draw_point.h 1.5 KB

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