ccSetSFAsVec3Dlg.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. //##########################################################################
  3. //# #
  4. //# CLOUDCOMPARE #
  5. //# #
  6. //# This program is free software; you can redistribute it and/or modify #
  7. //# it under the terms of the GNU General Public License as published by #
  8. //# the Free Software Foundation; version 2 or later of the License. #
  9. //# #
  10. //# This program is distributed in the hope that it will be useful, #
  11. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  12. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  13. //# GNU General Public License for more details. #
  14. //# #
  15. //# COPYRIGHT: CloudCompare project #
  16. //# #
  17. //##########################################################################
  18. #include <ui_setSFAsVec3Dlg.h>
  19. //Qt
  20. #include <QDialog>
  21. class ccPointCloud;
  22. //! Let the user choose up to 3 scalar fields (to be used as Normal components)
  23. class ccSetSFsAsVec3Dialog : public QDialog, public Ui::SetSFsAsVec3Dialog
  24. {
  25. Q_OBJECT
  26. public:
  27. //! Default constructor
  28. ccSetSFsAsVec3Dialog( const ccPointCloud* cloud,
  29. const QString& xLabel,
  30. const QString& yLabel,
  31. const QString& zLabel,
  32. bool allowUnchanged,
  33. QWidget* parent = nullptr);
  34. //! No SF index
  35. static const int SF_INDEX_NO = -1;
  36. //! 'Zero' SF index
  37. static const int SF_INDEX_ZERO = -2;
  38. //! 'One' SF index
  39. static const int SF_INDEX_ONE = -3;
  40. //! 'Unchanged' index
  41. static const int SF_INDEX_UNCHANGED = -4;
  42. //! Sets the 3 SF indexes
  43. void setSFIndexes(int sf1Index, int sf2Index, int sf3Index);
  44. //! Returns the 3 SF indexes
  45. void getSFIndexes(int& sf1Index, int& sf2Index, int& sf3Index) const;
  46. protected:
  47. //! Converts an input 'SF' index to a combo-box index
  48. int toComboBoxIndex(int index) const;
  49. //! Converts a combo-box index to a 'SF' index
  50. int fromComboBoxIndex(int index) const;
  51. //! Number of constant fields at the beginning of each combo-box
  52. int m_constFields;
  53. };