VTK  9.3.20240329
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 
88 
90 
97  void SetGridSubdivisions(int gridSubdivisions);
98  vtkGetMacro(GridSubdivisions, int);
100 
102 
109  vtkGetMacro(ContourApproximationNumberOfPoints, int);
112 
115  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
116  vtkInformationVector* outputVector) override;
117 
122 
123 protected:
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
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...
void GetValues(double *contourValues)
Fill a supplied list with contour values.
OTDistributionCache * DistributionCache
double * GetValues()
Get a pointer to an array of contour values.
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 vtkOTDensityMap * New()
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.
static vtkInformationDoubleKey * DENSITY()
Key to recover density in output metadata.
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...
void BuildContours(vtkPolyData *contourPd, int numContours, const double *contourValues, const double *densityPDFContourValues, const char *xArrayName, const char *yArrayName, std::multimap< double, vtkSmartPointer< vtkTable >> &contoursMap)
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
Definition: vtkPolyData.h:181
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:168
record modification and/or execution time
Definition: vtkTimeStamp.h:44
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270