ccColorGradientDlg.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_COLOR_GRADIENT_DLG_HEADER
  18. #define CC_COLOR_GRADIENT_DLG_HEADER
  19. //Qt
  20. #include <QColor>
  21. #include <ui_colorGradientDlg.h>
  22. //! Dialog to define a color gradient (default, with 2 colors, banding, etc.)
  23. class ccColorGradientDlg : public QDialog, public Ui::ColorGradientDialog
  24. {
  25. Q_OBJECT
  26. public:
  27. //! Default constructor
  28. explicit ccColorGradientDlg(QWidget* parent);
  29. //! Gradient types
  30. enum GradientType { Default, TwoColors, Banding };
  31. //! Returns selected gradient type
  32. GradientType getType() const;
  33. //! Sets the currently activated type
  34. void setType(GradientType type);
  35. //! Returns the two colors of the gradient ('TwoColors' mode)
  36. void getColors(QColor& first, QColor& second) const;
  37. //! Returns the frequency of the gradient ('Banding' mode)
  38. double getBandingFrequency() const;
  39. //! Returns the ramp dimension
  40. unsigned char getDimension() const;
  41. protected:
  42. void changeFirstColor();
  43. void changeSecondColor();
  44. };
  45. #endif //CC_COLOR_GRADIENT_DLG_HEADER