ctkHistogram.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkHistogram_h
  15. #define __ctkHistogram_h
  16. /// Qt includes
  17. #include <QColor>
  18. #include <QObject>
  19. #include <QtGlobal>
  20. #include <QSharedPointer>
  21. #include <QVariant>
  22. /// CTK includes
  23. #include "ctkTransferFunction.h"
  24. #include "ctkCoreExport.h"
  25. //-----------------------------------------------------------------------------
  26. /// \ingroup Core
  27. struct CTK_CORE_EXPORT ctkHistogramBar : public ctkControlPoint
  28. {
  29. QColor Color;
  30. };
  31. //-----------------------------------------------------------------------------
  32. /// \ingroup Core
  33. class CTK_CORE_EXPORT ctkHistogram: public ctkTransferFunction
  34. {
  35. Q_OBJECT
  36. public:
  37. ctkHistogram(QObject* parent = 0);
  38. virtual ~ctkHistogram();
  39. virtual bool isDiscrete()const;
  40. virtual bool isEditable()const;
  41. ///
  42. virtual int insertControlPoint(const ctkControlPoint& cp);
  43. virtual int insertControlPoint(qreal pos);
  44. ///
  45. /// be careful with it, as changing the value might require
  46. /// more changes to ctkControlPoint.
  47. virtual void setControlPointPos(int index, qreal pos);
  48. ///
  49. /// be careful with it, as changing the value might require
  50. /// more changes to ctkControlPoint.
  51. virtual void setControlPointValue(int index, const QVariant& value);
  52. virtual void build()=0;
  53. protected:
  54. };
  55. #endif