VTK  9.5.20251216
vtkVisualStatistics.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2010 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
15
16#ifndef vtkVisualStatistics_h
17#define vtkVisualStatistics_h
18
20#include "vtkFiltersStatisticsModule.h" // For export macro
21
22VTK_ABI_NAMESPACE_BEGIN
24class vtkStringArray;
25class vtkTable;
26class vtkVariant;
27class vtkDoubleArray;
28
29class VTKFILTERSSTATISTICS_EXPORT vtkVisualStatistics : public vtkDescriptiveStatistics
30{
31public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
35
46 virtual void SetFieldRange(const char* field, double lo, double hi);
47 virtual void SetFieldRange(const std::string& field, double lo, double hi);
48
50 virtual void ResetFieldRanges() { this->FieldRanges.clear(); }
51
73 vtkSetClampMacro(NumberOfBins, int, 1, VTK_INT_MAX - 3);
74 vtkGetMacro(NumberOfBins, int);
75
80 vtkDataArray* GetHistogramForField(const std::string& fieldName);
81
83 void AppendAlgorithmParameters(std::string& algorithmParameters) const override;
84
87 vtkStringToken parameterName, const std::string& algorithmParameters) override;
88
89protected:
92
98
103
108
109private:
110 std::map<std::string, std::pair<double, double>> FieldRanges;
111 int NumberOfBins{ 512 };
112
114 void operator=(const vtkVisualStatistics&) = delete;
115};
116
117VTK_ABI_NAMESPACE_END
118#endif
maintain an unordered list of data objects
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition vtkIndent.h:108
a base class for statistical modeling of other data
a vtkAbstractArray subclass for strings
Represent a string by its integer hash.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
A type representing the union of many types.
Definition vtkVariant.h:162
A class to provide normality estimation and binned histogram data to render.
~vtkVisualStatistics() override
vtkDataArray * GetHistogramForField(const std::string &fieldName)
Fetch a histogram array given a fieldName.
void Derive(vtkStatisticalModel *) override
Execute the calculations required by the Derive option.
virtual void SetFieldRange(const char *field, double lo, double hi)
Set the numeric range to use for binning the histogram of the field.
void Learn(vtkTable *, vtkTable *, vtkStatisticalModel *) override
Execute the calculations required by the Learn option, given some input Data NB: input parameters are...
virtual void SetFieldRange(const std::string &field, double lo, double hi)
bool Aggregate(vtkDataObjectCollection *, vtkStatisticalModel *) override
Given a collection of models, calculate aggregate model.
std::size_t ConsumeNextAlgorithmParameter(vtkStringToken parameterName, const std::string &algorithmParameters) override
Implement the inverse of AppendAlgorithmParameters(): given parameters, update this algorithm.
static vtkVisualStatistics * New()
virtual void ResetFieldRanges()
Clear all field ranges from this filter.
void AppendAlgorithmParameters(std::string &algorithmParameters) const override
Provide a string that can be used to recreate an instance of this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define vtkDataArray
#define VTK_INT_MAX
Definition vtkType.h:197