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 DistributionImplementationType;
36 class vtkIdList;
39 class vtkPolyData;
40 class vtkTable;
41 
42 class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
43 {
44 public:
45  static vtkOTDensityMap* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  virtual vtkMTimeType GetMTime() override;
53 
55 
66  void SetValue(int i, double value);
67 
71  double GetValue(int i);
72 
77  double* GetValues();
78 
84  void GetValues(double* contourValues);
85 
91  void SetNumberOfContours(int number);
92 
96  int GetNumberOfContours();
98 
100 
107  void SetGridSubdivisions(int gridSubdivisions);
108  vtkGetMacro(GridSubdivisions, int);
110 
112 
119  vtkGetMacro(ContourApproximationNumberOfPoints, int);
120  virtual void SetContourApproximationNumberOfPoints(int val);
122 
123  virtual int FillInputPortInformation(int port, vtkInformation* info) override;
124 
125  virtual int RequestData(vtkInformation* request,
126  vtkInformationVector** inputVector,
127  vtkInformationVector* outputVector) override;
128 
132  static vtkInformationDoubleKey* DENSITY();
133 
134 protected:
135  vtkOTDensityMap();
136  ~vtkOTDensityMap();
137 
153  virtual vtkIdType FindNextCellId(vtkPolyData* pd,
154  vtkIdType cellId,
155  vtkIdType previousCellId,
156  bool& invertedPoints,
157  bool up = true,
158  vtkIdList* currentPointIndices = nullptr);
159 
160  void ClearCache();
161  void BuildContours(vtkPolyData* contourPd,
162  int numContours,
163  const double* contourValues,
164  const double* densityPDFContourValues,
165  const char* xArrayName,
166  const char* yArrayName,
167  std::multimap<double, vtkSmartPointer<vtkTable> >& contoursMap);
168 
169  // Cache
170  class OTDensityCache;
171  OTDensityCache* DensityPDFCache;
172  OTDensityCache* DensityLogPDFSampleCache;
173 
175  vtkTimeStamp BuildTime; // Keep track of last build time
176  vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
177  vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
178 
182 
183 private:
184  void operator=(const vtkOTDensityMap&) = delete;
185  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
186 };
187 #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:32
int vtkIdType
Definition: vtkType.h:345
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.
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.
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:62
vtkTimeStamp BuildTime
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
int ContourApproximationNumberOfPoints