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 =========================================================================*/
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 DistributionImplementationType;
39 class vtkIdList;
42 class vtkPolyData;
43 class vtkTable;
44 
45 class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
46 {
47 public:
48  static vtkOTDensityMap* New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  virtual vtkMTimeType GetMTime() override;
56 
58 
69  void SetValue(int i, double value);
70 
74  double GetValue(int i);
75 
80  double* GetValues();
81 
87  void GetValues(double* contourValues);
88 
94  void SetNumberOfContours(int number);
95 
99  int GetNumberOfContours();
101 
103 
110  void SetGridSubdivisions(int gridSubdivisions);
111  vtkGetMacro(GridSubdivisions, int);
113 
115 
122  vtkGetMacro(ContourApproximationNumberOfPoints, int);
123  virtual void SetContourApproximationNumberOfPoints(int val);
125 
126  virtual int FillInputPortInformation(int port, vtkInformation* info) override;
127 
128  virtual int RequestData(vtkInformation* request,
129  vtkInformationVector** inputVector,
130  vtkInformationVector* outputVector) override;
131 
135  static vtkInformationDoubleKey* DENSITY();
136 
137 protected:
138  vtkOTDensityMap();
139  ~vtkOTDensityMap();
140 
156  virtual vtkIdType FindNextCellId(vtkPolyData* pd,
157  vtkIdType cellId,
158  vtkIdType previousCellId,
159  bool& invertedPoints,
160  bool up = true,
161  vtkIdList* currentPointIndices = nullptr);
162 
163  void ClearCache();
164  void BuildContours(vtkPolyData* contourPd,
165  int numContours,
166  const double* contourValues,
167  const double* densityPDFContourValues,
168  const char* xArrayName,
169  const char* yArrayName,
170  std::multimap<double, vtkSmartPointer<vtkTable> >& contoursMap);
171 
172  // Cache
173  class OTDensityCache;
174  OTDensityCache* DensityPDFCache;
175  OTDensityCache* DensityLogPDFSampleCache;
176 
178  vtkTimeStamp BuildTime; // Keep track of last build time
179  vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
180  vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
181 
185 
186 private:
187  void operator=(const vtkOTDensityMap&) = delete;
188  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
189 };
190 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
OTDensityCache * DensityLogPDFSampleCache
vtkOTDistributionImplementationWrapper * DensityDistribution
record modification and/or execution time
Definition: vtkTimeStamp.h:35
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
vtkContourValues * ContourValues
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkTimeStamp DensityPDFMTime
static vtkMultiBlockDataSetAlgorithm * New()
vtkTimeStamp DensityLogPDFSampleMTime
OTDensityCache * DensityPDFCache
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
virtual vtkMTimeType GetMTime()
Return this object's modified time.
Wrapper for forward declaration of OT::DistributionFactoryImplementation::Implementation.
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:68
vtkTimeStamp BuildTime
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
int ContourApproximationNumberOfPoints