ccApplyTransformationDlg.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_APPLY_TRANSFORMATION_DLG_HEADER
  18. #define CC_APPLY_TRANSFORMATION_DLG_HEADER
  19. #include <ui_applyTransformationDlg.h>
  20. //qCC_db
  21. #include <ccGLMatrix.h>
  22. //! Dialog to input a 4x4 matrix
  23. class ccApplyTransformationDlg : public QDialog, public Ui::ApplyTransformationDialog
  24. {
  25. Q_OBJECT
  26. public:
  27. //! Default constructor
  28. explicit ccApplyTransformationDlg(QWidget* parent = nullptr);
  29. //! Returns input matrix
  30. ccGLMatrixd getTransformation(bool& applyToGlobal) const;
  31. protected:
  32. //! Checks matrix validity and 'accept' dialog if ok
  33. void checkMatrixValidityAndAccept();
  34. //! Automatically removes anything between square brackets, and update the other forms
  35. void onMatrixTextChange();
  36. //! Updates dialog when a component of the Rotation axis/angle form changes
  37. void onRotAngleValueChanged(double);
  38. //! Updates dialog when a component of the Euler form changes
  39. void onEulerValueChanged(double);
  40. //! Updates dialog when a component of the From/to axes form changes
  41. void onFromToValueChanged(double);
  42. //! Loads matrix from ASCII file
  43. void loadFromASCIIFile();
  44. //! Loads matrix from clipboard ("paste")
  45. void loadFromClipboard();
  46. //! Inits matrix from dip / dip direction values
  47. void initFromDipAndDipDir();
  48. //! Signal called when a button is clicked
  49. void buttonClicked(QAbstractButton*);
  50. void axisFromClipboard();
  51. void transFromClipboard();
  52. void eulerAnglesFromClipboard();
  53. void eulerTransFromClipboard();
  54. void fromAxisFromClipboard();
  55. void toAxisFromClipboard();
  56. void fromToTransFromClipboard();
  57. protected:
  58. //! Updates all forms with a given matrix
  59. void updateAll(const ccGLMatrixd& mat, bool textForm = true, bool axisAngleForm = true, bool eulerForm = true, bool fromToForm = true);
  60. };
  61. #endif //CC_APPLY_TRANSFORMATION_DLG_HEADER