ccNormalComputationDlg.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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_NORMAL_COMPUTATION_DLG_HEADER
  18. #define CC_NORMAL_COMPUTATION_DLG_HEADER
  19. #include <ui_normalComputationDlg.h>
  20. //qCC_db
  21. #include <ccNormalVectors.h>
  22. class ccPointCloud;
  23. //! Dialog for normal computation
  24. class ccNormalComputationDlg : public QDialog, public Ui::NormalComputationDlg
  25. {
  26. Q_OBJECT
  27. public:
  28. //! Default constructor
  29. /** \param withScanGrid whether the selection contains some structured point clouds
  30. * \param withSensor whether the selection contains some sensors associated to the point clouds
  31. \param parent parent widget
  32. **/
  33. explicit ccNormalComputationDlg(bool withScanGrid, bool withSensor, QWidget* parent = nullptr);
  34. //! Returns the local model chosen for normal computation
  35. CCCoreLib::LOCAL_MODEL_TYPES getLocalModel() const;
  36. //! Sets the local model chosen for normal computation
  37. void setLocalModel(CCCoreLib::LOCAL_MODEL_TYPES model);
  38. //! Sets default value for local neighbourhood radius
  39. void setRadius(PointCoordinateType radius);
  40. //! Sets the preferred orientation
  41. void setPreferredOrientation(ccNormalVectors::Orientation orientation);
  42. //! Sets the currently selected cloud (required for 'auto' feature)
  43. void setCloud(ccPointCloud* cloud);
  44. //! Returns whether scan grids should be used for computation
  45. bool useScanGridsForComputation() const;
  46. //! Returns the min angle for grid triangles
  47. double getMinGridAngle_deg() const;
  48. //! Sets the min angle for grid triangles
  49. void setMinGridAngle_deg(double value);
  50. //! Returns local neighbourhood radius
  51. PointCoordinateType getRadius() const;
  52. //! Returns whether normals should be oriented or not
  53. bool orientNormals() const;
  54. //! Sets whether normals should be oriented or not
  55. void setOrientNormals(bool state);
  56. //! Returns whether scan grids should be used for normals orientation
  57. bool useScanGridsForOrientation() const;
  58. //! Returns whether scan grids should be used for normals computation
  59. bool useSensorsForOrientation() const;
  60. //! Returns whether a preferred orientation should be used
  61. bool usePreferredOrientation() const;
  62. //! Returns the preferred orientation (if any)
  63. ccNormalVectors::Orientation getPreferredOrientation() const;
  64. //! Returns whether a Minimum Spanning Tree (MST) should be used for normals orientation
  65. bool useMSTOrientation() const;
  66. //! Returns the number of neighbors for Minimum Spanning Tree (MST)
  67. int getMSTNeighborCount() const;
  68. //! Sets the number of neighbors for Minimum Spanning Tree (MST)
  69. void setMSTNeighborCount(int n);
  70. protected:
  71. //! On local model change
  72. void localModelChanged(int index);
  73. //! Automatically estimate the local surface radius
  74. void autoEstimateRadius();
  75. protected:
  76. //! Selected cloud
  77. ccPointCloud* m_cloud;
  78. };
  79. #endif // CC_NORMAL_COMPUTATION_DLG_HEADER