ccPointPickingGenericInterface.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_POINT_PICKING_GENERIC_INTERFACE_HEADER
  18. #define CC_POINT_PICKING_GENERIC_INTERFACE_HEADER
  19. //Local
  20. #include "ccOverlayDialog.h"
  21. #include "ccCommon.h"
  22. #include "ccPickingListener.h"
  23. //CCCoreLib
  24. #include <CCGeom.h>
  25. //system
  26. #include <vector>
  27. class ccGLWindowInterface;
  28. class ccPointCloud;
  29. class ccHObject;
  30. class ccPickingHub;
  31. /** Generic interface for any dialog/graphical interactor that relies on point picking.
  32. **/
  33. class ccPointPickingGenericInterface : public ccOverlayDialog, public ccPickingListener
  34. {
  35. Q_OBJECT
  36. public:
  37. //! Default constructor
  38. explicit ccPointPickingGenericInterface(ccPickingHub* pickingHub, QWidget* parent = nullptr);
  39. //! Destructor
  40. ~ccPointPickingGenericInterface() override = default;
  41. //inherited from ccOverlayDialog
  42. bool linkWith(ccGLWindowInterface* win) override;
  43. bool start() override;
  44. void stop(bool state) override;
  45. //! Inherited from ccPickingListener
  46. void onItemPicked(const PickedItem& pi) override;
  47. protected:
  48. //! Generic method to process picked points
  49. virtual void processPickedPoint(const PickedItem& picked) = 0;
  50. //! Picking hub
  51. ccPickingHub* m_pickingHub;
  52. };
  53. #endif