ctkTransferFunctionGradientItem.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 __ctkTransferFunctionGradientItem_h
  15. #define __ctkTransferFunctionGradientItem_h
  16. /// Qt includes
  17. #include <QGraphicsObject>
  18. #include <QColor>
  19. /// CTK includes
  20. #include "ctkWidgetsExport.h"
  21. #include "ctkPimpl.h"
  22. #include "ctkTransferFunctionItem.h"
  23. class ctkTransferFunctionGradientItemPrivate;
  24. //-----------------------------------------------------------------------------
  25. /// \ingroup Widgets
  26. class CTK_WIDGETS_EXPORT ctkTransferFunctionGradientItem: public ctkTransferFunctionItem
  27. {
  28. Q_OBJECT
  29. Q_PROPERTY(bool mask READ mask WRITE setMask)
  30. public:
  31. ctkTransferFunctionGradientItem(QGraphicsItem* parent = 0);
  32. ctkTransferFunctionGradientItem(ctkTransferFunction* transferFunction,
  33. QGraphicsItem* parent = 0);
  34. virtual ~ctkTransferFunctionGradientItem();
  35. virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
  36. bool mask()const;
  37. void setMask(bool mask);
  38. protected:
  39. QScopedPointer<ctkTransferFunctionGradientItemPrivate> d_ptr;
  40. private:
  41. Q_DECLARE_PRIVATE(ctkTransferFunctionGradientItem);
  42. Q_DISABLE_COPY(ctkTransferFunctionGradientItem);
  43. };
  44. #endif