ccInteractor.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  15. //# #
  16. //##########################################################################
  17. #ifndef CC_INTERACTOR_HEADER
  18. #define CC_INTERACTOR_HEADER
  19. //Local
  20. #include "qCC_db.h"
  21. #include "CCGeom.h"
  22. //Qt
  23. #include <Qt>
  24. //! Interactor interface (entity that can be dragged or clicked in a 3D view)
  25. class QCC_DB_LIB_API ccInteractor
  26. {
  27. public:
  28. virtual ~ccInteractor() = default;
  29. //! Called on mouse click
  30. virtual bool acceptClick(int x, int y, Qt::MouseButton button) { return false; }
  31. //! Called on mouse move (for 2D interactors)
  32. /** \return true if a movement occurs
  33. **/
  34. virtual bool move2D(int x, int y, int dx, int dy, int screenWidth, int screenHeight) { return false; }
  35. //! Called on mouse move (for 3D interactors)
  36. /** \return true if a movement occurs
  37. **/
  38. virtual bool move3D(const CCVector3d& u) { return false; }
  39. };
  40. #endif //CC_INTERACTOR_HEADER