VTK  9.2.6
vtkOTDensityMap.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOTDensityMap.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 =========================================================================*/
28 #ifndef vtkOTDensityMap_h
29 #define vtkOTDensityMap_h
30 
31 #include "vtkContourValues.h" // For Contour Values
32 #include "vtkFiltersOpenTURNSModule.h" // For export macro
34 #include "vtkSmartPointer.h" // For Smart Pointer
35 
36 #include <map> // For map
37 
38 class vtkIdList;
40 class vtkPolyData;
41 class vtkTable;
42 
43 class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
44 {
45 public:
46  static vtkOTDensityMap* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  vtkMTimeType GetMTime() override;
54 
56 
67  void SetValue(int i, double value);
68 
72  double GetValue(int i);
73 
78  double* GetValues();
79 
85  void GetValues(double* contourValues);
86 
92  void SetNumberOfContours(int number);
93 
99 
101 
108  void SetGridSubdivisions(int gridSubdivisions);
109  vtkGetMacro(GridSubdivisions, int);
111 
113 
120  vtkGetMacro(ContourApproximationNumberOfPoints, int);
123 
126  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
127  vtkInformationVector* outputVector) override;
128 
133 
134 protected:
136  ~vtkOTDensityMap() override;
137 
153  virtual vtkIdType FindNextCellId(vtkPolyData* pd, vtkIdType cellId, vtkIdType previousCellId,
154  bool& invertedPoints, bool up = true, vtkIdList* currentPointIndices = nullptr);
155 
156  void ClearCache();
157  void BuildContours(vtkPolyData* contourPd, int numContours, const double* contourValues,
158  const double* densityPDFContourValues, const char* xArrayName, const char* yArrayName,
159  std::multimap<double, vtkSmartPointer<vtkTable>>& contoursMap);
160 
161  // Cache
162  class OTDensityCache;
163  class OTDistributionCache;
164  OTDensityCache* DensityPDFCache;
165  OTDensityCache* DensityLogPDFSampleCache;
166  OTDistributionCache* DistributionCache;
167 
168  vtkTimeStamp BuildTime; // Keep track of last build time
169  vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
170  vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
171 
175 
176 private:
177  void operator=(const vtkOTDensityMap&) = delete;
178  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
179 };
180 #endif
helper object to manage setting and generating contour values
list of point or cell ids
Definition: vtkIdList.h:143
a simple class to control print indentation
Definition: vtkIndent.h:119
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:200
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:183
record modification and/or execution time
Definition: vtkTimeStamp.h:55
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287