CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKHistogram.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkVTKHistogram_h
22 #define __ctkVTKHistogram_h
23 
24 // CTK includes
25 #include "ctkHistogram.h"
26 #include "ctkPimpl.h"
27 #include "ctkVisualizationVTKWidgetsExport.h"
28 #include "ctkVTKObject.h"
29 
30 class vtkDataArray;
31 class ctkVTKHistogramPrivate;
32 
37 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKHistogram: public ctkHistogram
38 {
39  Q_OBJECT;
41  Q_PROPERTY(int component READ component WRITE setComponent)
42  Q_PROPERTY(QVariant maxValue READ maxValue)
43  Q_PROPERTY(QVariant minValue READ minValue)
44  Q_PROPERTY(int numberOfBins READ numberOfBins WRITE setNumberOfBins)
45 public:
46  ctkVTKHistogram(QObject* parent = 0);
47  ctkVTKHistogram(vtkDataArray* dataArray, QObject* parent = 0);
48  virtual ~ctkVTKHistogram();
49 
50  virtual ctkControlPoint* controlPoint(int index)const;
51  virtual QVariant value(qreal pos)const;
53  virtual int count()const;
54 
56  virtual void range(qreal& minRange, qreal& maxRange)const;
57  virtual QVariant minValue()const;
58  virtual QVariant maxValue()const;
59 
60  Q_INVOKABLE void setDataArray(vtkDataArray* dataArray);
61  Q_INVOKABLE vtkDataArray* dataArray()const;
62 
63  void setComponent(int component);
64  int component()const;
65 
66  int numberOfBins()const;
67  void setNumberOfBins(int number);
68 
69  Q_INVOKABLE virtual void removeControlPoint( qreal pos );
70 
71  Q_INVOKABLE virtual void build();
72 protected:
73  qreal indexToPos(int index)const;
74  int posToIndex(qreal pos)const;
75 
76 protected:
77  QScopedPointer<ctkVTKHistogramPrivate> d_ptr;
78 
79 private:
80  Q_DECLARE_PRIVATE(ctkVTKHistogram);
81  Q_DISABLE_COPY(ctkVTKHistogram);
82 };
83 
84 #endif
#define QVTK_OBJECT
Define VTK/Qt event/slot connection utility methods. It is a convenient macro that declares and defin...
Definition: ctkVTKObject.h:222