ctkVTKDataSetArrayComboBox.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 __ctkVTKDataSetArrayComboBox_h
  15. #define __ctkVTKDataSetArrayComboBox_h
  16. // Qt includes
  17. #include <QComboBox>
  18. // CTK includes
  19. #include "ctkVisualizationVTKWidgetsExport.h"
  20. class ctkVTKDataSetArrayComboBoxPrivate;
  21. class vtkDataArray;
  22. class vtkDataSet;
  23. /// \ingroup Visualization_VTK_Widgets
  24. ///
  25. /// QComboBox linked to vtkDataSet field arrays
  26. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKDataSetArrayComboBox : public QComboBox
  27. {
  28. Q_OBJECT
  29. public:
  30. /// Superclass typedef
  31. typedef QComboBox Superclass;
  32. /// Constructors
  33. explicit ctkVTKDataSetArrayComboBox(QWidget* parent = 0);
  34. virtual ~ctkVTKDataSetArrayComboBox();
  35. vtkDataArray* currentArray()const;
  36. QString currentArrayName()const;
  37. vtkDataSet* dataSet()const;
  38. public Q_SLOTS:
  39. void setDataSet(vtkDataSet* dataSet);
  40. /// The array must exist in the dataset
  41. void setCurrentArray(vtkDataArray* dataArray);
  42. /// the array must exist in the dataset
  43. void setCurrentArray(const QString& name);
  44. Q_SIGNALS:
  45. void currentArrayChanged(vtkDataArray*);
  46. void currentArrayChanged(const QString& name);
  47. protected Q_SLOTS:
  48. void onCurrentIndexChanged(int);
  49. protected:
  50. QScopedPointer<ctkVTKDataSetArrayComboBoxPrivate> d_ptr;
  51. private:
  52. Q_DECLARE_PRIVATE(ctkVTKDataSetArrayComboBox);
  53. Q_DISABLE_COPY(ctkVTKDataSetArrayComboBox);
  54. };
  55. #endif