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
vtkOTDensityMap::DensityLogPDFSampleCache
OTDensityCache * DensityLogPDFSampleCache
Definition: vtkOTDensityMap.h:171
vtkOTDensityMap::DensityPDFMTime
vtkTimeStamp DensityPDFMTime
Definition: vtkOTDensityMap.h:176
vtkX3D::value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:347
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:172
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:88
vtkX3D::port
Definition: vtkX3D.h:447
vtkOTDensityMap::ContourValues
vtkContourValues * ContourValues
Definition: vtkOTDensityMap.h:178
vtkOTDensityMap::BuildTime
vtkTimeStamp BuildTime
Definition: vtkOTDensityMap.h:174
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:169
vtkSmartPointer.h
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkMultiBlockDataSetAlgorithm.h
vtkOTDensityMap::ContourApproximationNumberOfPoints
int ContourApproximationNumberOfPoints
Definition: vtkOTDensityMap.h:180
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:80
vtkX3D::info
Definition: vtkX3D.h:376
vtkOTDensityMap::DensityLogPDFSampleMTime
vtkTimeStamp DensityLogPDFSampleMTime
Definition: vtkOTDensityMap.h:175
vtkOTDensityMap::GridSubdivisions
int GridSubdivisions
Definition: vtkOTDensityMap.h:179
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:79
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:32