matrixDisplayDlg.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_MATRIX_DISPLAY_DIALOG_HEADER
  18. #define CC_MATRIX_DISPLAY_DIALOG_HEADER
  19. //Qt
  20. #include <QWidget>
  21. //qCC_db
  22. #include <ccGLMatrix.h>
  23. namespace Ui {
  24. class MatrixDisplayDlg;
  25. }
  26. //! Simple widget to display a 4x4 matrix in various formats
  27. class MatrixDisplayDlg : public QWidget
  28. {
  29. Q_OBJECT
  30. public:
  31. //! Default constructor
  32. explicit MatrixDisplayDlg(QWidget* parent = nullptr);
  33. ~MatrixDisplayDlg();
  34. //! Clears widget
  35. void clear();
  36. //! Updates dialog with a given (float) matrix
  37. void fillDialogWith(const ccGLMatrix& mat);
  38. //! Updates dialog with a given (double) matrix
  39. void fillDialogWith(const ccGLMatrixd& mat);
  40. public:
  41. //! Exports current matrix to an ASCII file
  42. /** Will display a file selection dialog!
  43. **/
  44. void exportToASCII();
  45. //! Exports current matrix to the clipboard
  46. void exportToClipboard();
  47. protected:
  48. //! Fills the second part of the dialog
  49. void fillDialogWith(const CCVector3d& axis, double angle_rad, const CCVector3d& T, int precision);
  50. //! Matrix
  51. ccGLMatrixd m_mat;
  52. Ui::MatrixDisplayDlg* m_ui;
  53. };
  54. #endif //CC_MATRIX_DISPLAY_DIALOG_HEADER