VTK  9.0.1
vtkPlotHistogram2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtk2DHistogramItem.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
24 #ifndef vtkPlotHistogram2D_h
25 #define vtkPlotHistogram2D_h
26 
27 #include "vtkChartsCoreModule.h" // For export macro
28 #include "vtkPlot.h"
29 #include "vtkRect.h" // Needed for vtkRectf
30 #include "vtkSmartPointer.h" // Needed for SP ivars
31 
32 class vtkImageData;
33 class vtkScalarsToColors;
34 
35 class VTKCHARTSCORE_EXPORT vtkPlotHistogram2D : public vtkPlot
36 {
37 public:
38  vtkTypeMacro(vtkPlotHistogram2D, vtkPlot);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  static vtkPlotHistogram2D* New();
45 
51  void Update() override;
52 
56  bool Paint(vtkContext2D* painter) override;
57 
63  virtual void SetInputData(vtkImageData* data, vtkIdType z = 0);
64  void SetInputData(vtkTable*) override {}
65  void SetInputData(vtkTable*, const vtkStdString&, const vtkStdString&) override {}
66 
70  vtkImageData* GetInputImageData();
71 
76  void SetTransferFunction(vtkScalarsToColors* transfer);
77 
81  vtkScalarsToColors* GetTransferFunction();
82 
83  void GetBounds(double bounds[4]) override;
84 
85  virtual void SetPosition(const vtkRectf& pos);
86  virtual vtkRectf GetPosition();
87 
107  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
108 
117  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
119 #ifndef VTK_LEGACY_REMOVE
120  vtkIdType* segmentId) override;
121 #else
122  vtkIdType* segmentId = nullptr) override;
123 #endif // VTK_LEGACY_REMOVE
124 
125 #ifndef VTK_LEGACY_REMOVE
127 #endif // VTK_LEGACY_REMOVE
128 
129 protected:
131  ~vtkPlotHistogram2D() override;
132 
136  void GenerateHistogram();
137 
142 
143 private:
144  vtkPlotHistogram2D(const vtkPlotHistogram2D&) = delete;
145  void operator=(const vtkPlotHistogram2D&) = delete;
146 };
147 
148 #endif // vtkPlotHistogram2D_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:343
void SetInputData(vtkTable *) override
This is a convenience function to set the input table and the x, y column for the plot...
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId)
Function to query a plot for the nearest point to the specified coordinate.
int vtkIdType
Definition: vtkType.h:338
Superclass for mapping scalar values to colors.
void SetInputData(vtkTable *, const vtkStdString &, const vtkStdString &) override
This is a convenience function to set the input table and the x, y column for the plot...
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkSmartPointer< vtkScalarsToColors > TransferFunction
Abstract class for 2D plots.
Definition: vtkPlot.h:46
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot...
vtkSmartPointer< vtkImageData > Input
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkSmartPointer< vtkImageData > Output
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
Generate and return the tooltip label string for this plot The segmentIndex parameter is ignored...