ctkTransferFunctionBarsItem.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 2010 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.commontk.org/LICENSE
  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. class CTK_WIDGETS_EXPORT ctkTransferFunctionBarsItem: public ctkTransferFunctionItem
  26. {
  27. Q_OBJECT
  28. Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth)
  29. Q_PROPERTY(QColor barColor READ barColor WRITE setBarColor)
  30. public:
  31. ctkTransferFunctionBarsItem(QGraphicsItem* parent = 0);
  32. ctkTransferFunctionBarsItem(ctkTransferFunction* transferFunc,
  33. QGraphicsItem* parent = 0);
  34. virtual ~ctkTransferFunctionBarsItem();
  35. void setBarWidth(qreal newBarWidth);
  36. qreal barWidth()const;
  37. void setBarColor(const QColor& newBarColor);
  38. QColor barColor()const;
  39. enum LogMode
  40. {
  41. NoLog = 0,
  42. UseLog = 1,
  43. AutoLog =2
  44. };
  45. virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
  46. private:
  47. CTK_DECLARE_PRIVATE(ctkTransferFunctionBarsItem);
  48. };
  49. #endif