VTK
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,
124  vtkInformationVector** inputVector,
125  vtkInformationVector* outputVector) override;
126 
130  static vtkInformationDoubleKey* DENSITY();
131 
132 protected:
133  vtkOTDensityMap();
134  ~vtkOTDensityMap();
135 
151  virtual vtkIdType FindNextCellId(vtkPolyData* pd,
152  vtkIdType cellId,
153  vtkIdType previousCellId,
154  bool& invertedPoints,
155  bool up = true,
156  vtkIdList* currentPointIndices = nullptr);
157 
158  void ClearCache();
159  void BuildContours(vtkPolyData* contourPd,
160  int numContours,
161  const double* contourValues,
162  const double* densityPDFContourValues,
163  const char* xArrayName,
164  const char* yArrayName,
165  std::multimap<double, vtkSmartPointer<vtkTable> >& contoursMap);
166 
167  // Cache
168  class OTDensityCache;
169  class OTDistributionCache;
170  OTDensityCache* DensityPDFCache;
171  OTDensityCache* DensityLogPDFSampleCache;
172  OTDistributionCache* DistributionCache;
173 
174  vtkTimeStamp BuildTime; // Keep track of last build time
175  vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
176  vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
177 
181 
182 private:
183  void operator=(const vtkOTDensityMap&) = delete;
184  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
185 };
186 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
OTDensityCache * DensityLogPDFSampleCache
record modification and/or execution time
Definition: vtkTimeStamp.h:32
int vtkIdType
Definition: vtkType.h:347
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:33
list of point or cell ids
Definition: vtkIdList.h:30
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:62
vtkTimeStamp BuildTime
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
OTDistributionCache * DistributionCache
int ContourApproximationNumberOfPoints