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