VTK  9.0.2
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 
96 
98 
105  void SetGridSubdivisions(int gridSubdivisions);
106  vtkGetMacro(GridSubdivisions, int);
108 
110 
117  vtkGetMacro(ContourApproximationNumberOfPoints, int);
120 
123  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
124  vtkInformationVector* outputVector) override;
125 
130 
131 protected:
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
helper object to manage setting and generating contour values
list of point or cell ids
Definition: vtkIdList.h:31
a simple class to control print indentation
Definition: vtkIndent.h:34
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
A VTK Filter to compute density map on any pair of numeric data arrays with the same number of tuples...
void GetValues(double *contourValues)
Fill a supplied list with contour values.
OTDistributionCache * DistributionCache
double * GetValues()
Get a pointer to an array of contour values.
vtkTimeStamp BuildTime
vtkTimeStamp DensityLogPDFSampleMTime
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
OTDensityCache * DensityLogPDFSampleCache
virtual void SetContourApproximationNumberOfPoints(int val)
static vtkOTDensityMap * New()
OTDensityCache * DensityPDFCache
int GetNumberOfContours()
Get the number of contours in the list of contour values.
void SetGridSubdivisions(int gridSubdivisions)
Methods to set / get grid subdivisions, aka the number of point in each dimensions of the grid for co...
void SetValue(int i, double value)
Methods to set / get density lines values.
~vtkOTDensityMap() override
virtual vtkMTimeType GetMTime() override
Check contour values to return actual mtime.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void BuildContours(vtkPolyData *contourPd, int numContours, const double *contourValues, const double *densityPDFContourValues, const char *xArrayName, const char *yArrayName, std::multimap< double, vtkSmartPointer< vtkTable > > &contoursMap)
static vtkInformationDoubleKey * DENSITY()
Key to recover density in output metadata.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
double GetValue(int i)
Get the ith contour value.
virtual vtkIdType FindNextCellId(vtkPolyData *pd, vtkIdType cellId, vtkIdType previousCellId, bool &invertedPoints, bool up=true, vtkIdList *currentPointIndices=nullptr)
Protected method to find the next cellid in specified direction on a polydata containing only lines o...
int ContourApproximationNumberOfPoints
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourValues * ContourValues
vtkTimeStamp DensityPDFMTime
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:63
record modification and/or execution time
Definition: vtkTimeStamp.h:33
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
int vtkIdType
Definition: vtkType.h:338
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293