ctkVTKLookupTable.h 2.0 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 __ctkVTKLookupTable_h
  15. #define __ctkVTKLookupTable_h
  16. // CTK includes
  17. #include "ctkTransferFunction.h"
  18. #include "ctkPimpl.h"
  19. #include "CTKVisualizationVTKCoreExport.h"
  20. #include "ctkVTKObject.h"
  21. class vtkLookupTable;
  22. class ctkVTKLookupTablePrivate;
  23. ///
  24. /// Transfer function for a vtkColorTransferFunction.
  25. /// The value is an RGB QColor (no alpha supported)
  26. class CTK_VISUALIZATION_VTK_CORE_EXPORT ctkVTKLookupTable: public ctkTransferFunction
  27. {
  28. Q_OBJECT;
  29. QVTK_OBJECT;
  30. public:
  31. ctkVTKLookupTable(QObject* parent = 0);
  32. ctkVTKLookupTable(vtkLookupTable* lookupTable, QObject* parent = 0);
  33. virtual ~ctkVTKLookupTable();
  34. virtual ctkControlPoint* controlPoint(int index)const;
  35. virtual QVariant value(qreal pos)const;
  36. virtual int count()const;
  37. virtual bool isDiscrete()const;
  38. virtual void range(qreal& minRange, qreal& maxRange)const;
  39. virtual QVariant minValue()const;
  40. virtual QVariant maxValue()const;
  41. virtual int insertControlPoint(const ctkControlPoint& cp);
  42. virtual void setControlPointPos(int index, qreal pos);
  43. virtual void setControlPointValue(int index, const QVariant& value);
  44. void setLookupTable(vtkLookupTable* lookupTable);
  45. vtkLookupTable* lookupTable()const;
  46. private:
  47. CTK_DECLARE_PRIVATE(ctkVTKLookupTable);
  48. };
  49. #endif