VTK  9.0.1
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 =========================================================================*/
25 #ifndef vtkOTDensityMap_h
26 #define vtkOTDensityMap_h
27 
28 #include "vtkContourValues.h" // For Contour Values
29 #include "vtkFiltersOpenTURNSModule.h" // For export macro
31 #include "vtkSmartPointer.h" // For Smart Pointer
32 
33 #include <map> // For map
34 
35 class vtkIdList;
37 class vtkPolyData;
38 class vtkTable;
39 
40 class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
41 {
42 public:
43  static vtkOTDensityMap* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  virtual vtkMTimeType GetMTime() override;
51 
53 
64  void SetValue(int i, double value);
65 
69  double GetValue(int i);
70 
75  double* GetValues();
76 
82  void GetValues(double* contourValues);
83 
89  void SetNumberOfContours(int number);
90 
94  int GetNumberOfContours();
96 
98 
105  void SetGridSubdivisions(int gridSubdivisions);
106  vtkGetMacro(GridSubdivisions, int);
108 
110 
117  vtkGetMacro(ContourApproximationNumberOfPoints, int);
118  virtual void SetContourApproximationNumberOfPoints(int val);
120 
121  int FillInputPortInformation(int port, vtkInformation* info) override;
123  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
124  vtkInformationVector* outputVector) override;
125 
129  static vtkInformationDoubleKey* DENSITY();
130 
131 protected:
132  vtkOTDensityMap();
133  ~vtkOTDensityMap() override;
134 
150  virtual vtkIdType FindNextCellId(vtkPolyData* pd, vtkIdType cellId, vtkIdType previousCellId,
151  bool& invertedPoints, bool up = true, vtkIdList* currentPointIndices = nullptr);
152 
153  void ClearCache();
154  void BuildContours(vtkPolyData* contourPd, int numContours, const double* contourValues,
155  const double* densityPDFContourValues, const char* xArrayName, const char* yArrayName,
156  std::multimap<double, vtkSmartPointer<vtkTable> >& contoursMap);
157 
158  // Cache
159  class OTDensityCache;
160  class OTDistributionCache;
161  OTDensityCache* DensityPDFCache;
162  OTDensityCache* DensityLogPDFSampleCache;
163  OTDistributionCache* DistributionCache;
164 
165  vtkTimeStamp BuildTime; // Keep track of last build time
166  vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
167  vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
168 
172 
173 private:
174  void operator=(const vtkOTDensityMap&) = delete;
175  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
176 };
177 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
OTDensityCache * DensityLogPDFSampleCache
record modification and/or execution time
Definition: vtkTimeStamp.h:32
int vtkIdType
Definition: vtkType.h:338
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
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:33
list of point or cell ids
Definition: vtkIdList.h:30
virtual vtkMTimeType GetMTime()
Return this object&#39;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:62
vtkTimeStamp BuildTime
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
OTDistributionCache * DistributionCache
int ContourApproximationNumberOfPoints