AsciiSaveDlg.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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_ASCII_SAVE_DIALOG_HEADER
  18. #define CC_ASCII_SAVE_DIALOG_HEADER
  19. //local
  20. #include "qCC_io.h"
  21. //Qt
  22. #include <QDialog>
  23. class Ui_AsciiSaveDialog;
  24. //! Dialog for configuration of ASCII files saving sequence
  25. class QCC_IO_LIB_API AsciiSaveDlg : public QDialog
  26. {
  27. Q_OBJECT
  28. public:
  29. //! Default constructor
  30. explicit AsciiSaveDlg(QWidget* parent = nullptr);
  31. //! Destructor
  32. virtual ~AsciiSaveDlg();
  33. //! Returns whether columns names should be be saved in header
  34. bool saveColumnsNamesHeader() const;
  35. //! Sets whether columns names should be be saved in header
  36. void enableSaveColumnsNamesHeader(bool state);
  37. //! Returns whether the number of points should be saved in header
  38. bool savePointCountHeader() const;
  39. //! Sets whether the number of points should be saved in header
  40. void enableSavePointCountHeader(bool state);
  41. //! Returns separator
  42. unsigned char getSeparator() const;
  43. //! Sets separator (index)
  44. /** 0 = space
  45. 1 = semicolon
  46. 2 = comma
  47. 3 = tab
  48. **/
  49. void setSeparatorIndex(int index);
  50. //! Returns separator index
  51. int getSeparatorIndex() const;
  52. //! Returns coordinates precision
  53. int coordsPrecision() const;
  54. //! Sets coordinates precision
  55. void setCoordsPrecision(int prec);
  56. //! Returns SF precision
  57. int sfPrecision() const;
  58. //! Sets SF precision
  59. void setSfPrecision(int prec);
  60. //! Returns whether SF(s) and color should be swapped
  61. bool swapColorAndSF() const;
  62. //! Sets whether SF(s) and color should be swapped
  63. void enableSwapColorAndSF(bool state);
  64. //! Sets whether to save colors as float values (instead of unsigned bytes)
  65. void setSaveFloatColors(bool state);
  66. //! Returns whether to save colors as float values (instead of unsigned bytes)
  67. bool saveFloatColors() const;
  68. //! Sets whether to save the alpha (transparency) channel
  69. void setSaveAlphaChannel(bool state);
  70. //! Returns whether to save the alpha (transparency) channel
  71. bool saveAlphaChannel() const;
  72. protected:
  73. //! Saves dialog state to persistent settings
  74. void acceptAndSaveSettings();
  75. protected:
  76. //! Associated UI
  77. Ui_AsciiSaveDialog* m_ui;
  78. //! Inits dialog state from persistent settings
  79. void initFromPersistentSettings();
  80. };
  81. #endif //CC_ASCII_SAVE_DIALOG_HEADER