VTK  9.3.1
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 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkIdList;
29 class vtkPolyData;
30 class vtkTable;
31 
32 class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
33 {
34 public:
35  static vtkOTDensityMap* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  vtkMTimeType GetMTime() override;
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 
86  int GetNumberOfContours();
88 
90 
97  void SetGridSubdivisions(int gridSubdivisions);
98  vtkGetMacro(GridSubdivisions, int);
100 
102 
109  vtkGetMacro(ContourApproximationNumberOfPoints, int);
110  virtual void SetContourApproximationNumberOfPoints(int val);
112 
113  int FillInputPortInformation(int port, vtkInformation* info) override;
115  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
116  vtkInformationVector* outputVector) override;
117 
121  static vtkInformationDoubleKey* DENSITY();
122 
123 protected:
124  vtkOTDensityMap();
125  ~vtkOTDensityMap() override;
126 
142  virtual vtkIdType FindNextCellId(vtkPolyData* pd, vtkIdType cellId, vtkIdType previousCellId,
143  bool& invertedPoints, bool up = true, vtkIdList* currentPointIndices = nullptr);
144 
145  void ClearCache();
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;
154  OTDensityCache* DensityLogPDFSampleCache;
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 
165 private:
166  void operator=(const vtkOTDensityMap&) = delete;
167  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
168 };
169 VTK_ABI_NAMESPACE_END
170 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
OTDensityCache * DensityLogPDFSampleCache
record modification and/or execution time
Definition: vtkTimeStamp.h:24
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
vtkContourValues * ContourValues
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkTimeStamp DensityPDFMTime
static vtkMultiBlockDataSetAlgorithm * New()
vtkTimeStamp DensityLogPDFSampleMTime
OTDensityCache * DensityPDFCache
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
virtual vtkMTimeType GetMTime()
Return this object's modified time.
A VTK Filter to compute density map on any pair of numeric data arrays with the same number of tuples...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
vtkTimeStamp BuildTime
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
OTDistributionCache * DistributionCache
int ContourApproximationNumberOfPoints