VTK  9.1.0
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
32class vtkImageData;
34
35class VTKCHARTSCORE_EXPORT vtkPlotHistogram2D : public vtkPlot
36{
37public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
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
71
77
82
83 void GetBounds(double bounds[4]) override;
84
85 virtual void SetPosition(const vtkRectf& pos);
87
107 const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
108
117 vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
118 vtkVector2f* location, vtkIdType* segmentId) override;
120
121protected:
124
129
134
135private:
136 vtkPlotHistogram2D(const vtkPlotHistogram2D&) = delete;
137 void operator=(const vtkPlotHistogram2D&) = delete;
138};
139
140#endif // vtkPlotHistogram2D_h
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId) override
Function to query a plot for the nearest point to the specified coordinate.
bool Paint(vtkContext2D *painter) override
Paint event for the item, called whenever it needs to be drawn.
vtkImageData * GetInputImageData()
Get the input table used by the plot.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkImageData > Output
void Update() override
Perform any updates to the item that may be necessary before rendering.
virtual vtkRectf GetPosition()
~vtkPlotHistogram2D() override
vtkScalarsToColors * GetTransferFunction()
Get the color transfer function that is used to generate the histogram.
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.
vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override
Generate and return the tooltip label string for this plot The segmentIndex parameter is ignored.
virtual void SetInputData(vtkImageData *data, vtkIdType z=0)
Set the input, we are expecting a vtkImageData with just one component, this would normally be a floa...
void SetInputData(vtkTable *) override
This is a convenience function to set the input table and the x, y column for the plot.
static vtkPlotHistogram2D * New()
Creates a new object.
void SetTransferFunction(vtkScalarsToColors *transfer)
Set the color transfer function that will be used to generate the 2D histogram.
virtual void SetPosition(const vtkRectf &pos)
vtkSmartPointer< vtkImageData > Input
void GenerateHistogram()
Where all the magic happens...
void GetBounds(double bounds[4]) override
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
vtkSmartPointer< vtkScalarsToColors > TransferFunction
Abstract class for 2D plots.
Definition: vtkPlot.h:157
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.
Superclass for mapping scalar values to colors.
Hold a reference to a vtkObjectBase instance.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
int vtkIdType
Definition: vtkType.h:332