ccPointPropertiesDlg.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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_PROPERTIES_DIALOG_HEADER
  18. #define CC_POINT_PROPERTIES_DIALOG_HEADER
  19. #include "ccPointPickingGenericInterface.h"
  20. //Local
  21. #include <ui_pointPropertiesDlg.h>
  22. class cc2DLabel;
  23. class cc2DViewportLabel;
  24. class ccHObject;
  25. //! Dialog for simple point picking (information, distance, etc.)
  26. class ccPointPropertiesDlg : public ccPointPickingGenericInterface, public Ui::PointPropertiesDlg
  27. {
  28. Q_OBJECT
  29. public:
  30. //! Default constructor
  31. explicit ccPointPropertiesDlg(ccPickingHub* pickingHub, QWidget* parent);
  32. //! Default destructor
  33. virtual ~ccPointPropertiesDlg();
  34. //inherited from ccPointPickingGenericInterface
  35. virtual bool start() override;
  36. virtual void stop(bool state) override;
  37. virtual bool linkWith(ccGLWindowInterface* win) override;
  38. protected:
  39. void onClose();
  40. void activatePointPropertiesDisplay();
  41. void activateDistanceDisplay();
  42. void activateAngleDisplay();
  43. void activate2DZonePicking();
  44. void initializeState();
  45. void exportCurrentLabel();
  46. void update2DZone(int x, int y, Qt::MouseButtons buttons);
  47. void processClickedPoint(int x, int y);
  48. void close2DZone();
  49. Q_SIGNALS:
  50. //! Signal emitted when a new label is created
  51. void newLabel(ccHObject*);
  52. protected:
  53. //! Picking mode
  54. enum Mode
  55. {
  56. POINT_INFO,
  57. POINT_POINT_DISTANCE,
  58. POINTS_ANGLE,
  59. RECT_ZONE
  60. };
  61. //inherited from ccPointPickingGenericInterface
  62. void processPickedPoint(const PickedItem& picked) override;
  63. //! Current picking mode
  64. Mode m_pickingMode;
  65. //! Associated 3D label
  66. cc2DLabel* m_label;
  67. //! Associated 2D label
  68. cc2DViewportLabel* m_rect2DLabel;
  69. };
  70. #endif