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
vtkOTDensityMap::DensityLogPDFSampleCache
OTDensityCache * DensityLogPDFSampleCache
Definition: vtkOTDensityMap.h:162
vtkOTDensityMap::DensityPDFMTime
vtkTimeStamp DensityPDFMTime
Definition: vtkOTDensityMap.h:167
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkMultiBlockDataSetAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkSmartPointer< vtkTable >
vtkOTDensityMap::DistributionCache
OTDistributionCache * DistributionCache
Definition: vtkOTDensityMap.h:163
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkInformationDoubleKey
Key for double values in vtkInformation.
Definition: vtkInformationDoubleKey.h:31
vtkMultiBlockDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:89
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkOTDensityMap::ContourValues
vtkContourValues * ContourValues
Definition: vtkOTDensityMap.h:169
vtkOTDensityMap::BuildTime
vtkTimeStamp BuildTime
Definition: vtkOTDensityMap.h:165
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkOTDensityMap::DensityPDFCache
OTDensityCache * DensityPDFCache
Definition: vtkOTDensityMap.h:160
vtkSmartPointer.h
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkMultiBlockDataSetAlgorithm.h
vtkOTDensityMap::ContourApproximationNumberOfPoints
int ContourApproximationNumberOfPoints
Definition: vtkOTDensityMap.h:171
vtkContourValues.h
vtkOTDensityMap
A VTK Filter to compute density map on any pair of numeric data arrays with the same number of tuples...
Definition: vtkOTDensityMap.h:40
vtkMultiBlockDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkOTDensityMap::DensityLogPDFSampleMTime
vtkTimeStamp DensityLogPDFSampleMTime
Definition: vtkOTDensityMap.h:166
vtkOTDensityMap::GridSubdivisions
int GridSubdivisions
Definition: vtkOTDensityMap.h:170
vtkMultiBlockDataSetAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:32