ctkTransferFunctionBarsItem.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 __ctkTransferFunctionBarsItem_h
  15. #define __ctkTransferFunctionBarsItem_h
  16. /// Qt includes
  17. #include <QGraphicsObject>
  18. /// CTK includes
  19. #include "ctkPimpl.h"
  20. #include "ctkTransferFunctionItem.h"
  21. #include "ctkWidgetsExport.h"
  22. class ctkTransferFunction;
  23. class ctkTransferFunctionBarsItemPrivate;
  24. //-----------------------------------------------------------------------------
  25. /// \ingroup Widgets
  26. class CTK_WIDGETS_EXPORT ctkTransferFunctionBarsItem: public ctkTransferFunctionItem
  27. {
  28. Q_OBJECT
  29. Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth)
  30. Q_PROPERTY(QColor barColor READ barColor WRITE setBarColor)
  31. public:
  32. ctkTransferFunctionBarsItem(QGraphicsItem* parent = 0);
  33. ctkTransferFunctionBarsItem(ctkTransferFunction* transferFunc,
  34. QGraphicsItem* parent = 0);
  35. virtual ~ctkTransferFunctionBarsItem();
  36. void setBarWidth(qreal newBarWidth);
  37. qreal barWidth()const;
  38. void setBarColor(const QColor& newBarColor);
  39. QColor barColor()const;
  40. enum LogMode
  41. {
  42. NoLog = 0,
  43. UseLog = 1,
  44. AutoLog =2
  45. };
  46. virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
  47. protected:
  48. QScopedPointer<ctkTransferFunctionBarsItemPrivate> d_ptr;
  49. private:
  50. Q_DECLARE_PRIVATE(ctkTransferFunctionBarsItem);
  51. Q_DISABLE_COPY(ctkTransferFunctionBarsItem);
  52. };
  53. #endif