VTK  9.3.20240424
vtkOTDensityMap.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
16#ifndef vtkOTDensityMap_h
17#define vtkOTDensityMap_h
18
19#include "vtkContourValues.h" // For Contour Values
20#include "vtkFiltersOpenTURNSModule.h" // For export macro
22#include "vtkSmartPointer.h" // For Smart Pointer
23
24#include <map> // For map
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkIdList;
29class vtkPolyData;
30class vtkTable;
31
32class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
43
45
56 void SetValue(int i, double value);
57
61 double GetValue(int i);
62
67 double* GetValues();
68
74 void GetValues(double* contourValues);
75
81 void SetNumberOfContours(int number);
82
88
90
97 void SetGridSubdivisions(int gridSubdivisions);
98 vtkGetMacro(GridSubdivisions, int);
100
102
109 vtkGetMacro(ContourApproximationNumberOfPoints, int);
112
113 int FillInputPortInformation(int port, vtkInformation* info) override;
114 int FillOutputPortInformation(int port, vtkInformation* info) override;
116 vtkInformationVector* outputVector) override;
117
122
123protected:
126
142 virtual vtkIdType FindNextCellId(vtkPolyData* pd, vtkIdType cellId, vtkIdType previousCellId,
143 bool& invertedPoints, bool up = true, vtkIdList* currentPointIndices = nullptr);
144
146 void BuildContours(vtkPolyData* contourPd, int numContours, const double* contourValues,
147 const double* densityPDFContourValues, const char* xArrayName, const char* yArrayName,
148 std::multimap<double, vtkSmartPointer<vtkTable>>& contoursMap);
149
150 // Cache
151 class OTDensityCache;
152 class OTDistributionCache;
153 OTDensityCache* DensityPDFCache;
155 OTDistributionCache* DistributionCache;
156
157 vtkTimeStamp BuildTime; // Keep track of last build time
158 vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
159 vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
160
164
165private:
166 void operator=(const vtkOTDensityMap&) = delete;
167 vtkOTDensityMap(const vtkOTDensityMap&) = delete;
168};
169VTK_ABI_NAMESPACE_END
170#endif
helper object to manage setting and generating contour values
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
A VTK Filter to compute density map on any pair of numeric data arrays with the same number of tuples...
double * GetValues()
Get a pointer to an array of contour values.
void GetValues(double *contourValues)
Fill a supplied list with contour values.
OTDistributionCache * DistributionCache
vtkTimeStamp BuildTime
vtkTimeStamp DensityLogPDFSampleMTime
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
OTDensityCache * DensityLogPDFSampleCache
virtual void SetContourApproximationNumberOfPoints(int val)
Methods to set / get number of points to compute the contour values approximations using a LogPDF.
static vtkInformationDoubleKey * DENSITY()
Key to recover density in output metadata.
OTDensityCache * DensityPDFCache
int GetNumberOfContours()
Get the number of contours in the list of contour values.
void SetGridSubdivisions(int gridSubdivisions)
Methods to set / get grid subdivisions, aka the number of point in each dimensions of the grid for co...
void SetValue(int i, double value)
Methods to set / get density lines values.
~vtkOTDensityMap() override
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void BuildContours(vtkPolyData *contourPd, int numContours, const double *contourValues, const double *densityPDFContourValues, const char *xArrayName, const char *yArrayName, std::multimap< double, vtkSmartPointer< vtkTable > > &contoursMap)
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
double GetValue(int i)
Get the ith contour value.
virtual vtkIdType FindNextCellId(vtkPolyData *pd, vtkIdType cellId, vtkIdType previousCellId, bool &invertedPoints, bool up=true, vtkIdList *currentPointIndices=nullptr)
Protected method to find the next cellid in specified direction on a polydata containing only lines o...
static vtkOTDensityMap * New()
int ContourApproximationNumberOfPoints
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourValues * ContourValues
vtkTimeStamp DensityPDFMTime
vtkMTimeType GetMTime() override
Check contour values to return actual mtime.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
concrete dataset represents vertices, lines, polygons, and triangle strips
Hold a reference to a vtkObjectBase instance.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:168
record modification and/or execution time
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270