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 vtkIdList;
40 class vtkPolyData;
41 class vtkTable;
42 
43 class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
44 {
45 public:
46  static vtkOTDensityMap* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  virtual vtkMTimeType GetMTime() override;
54 
56 
67  void SetValue(int i, double value);
68 
72  double GetValue(int i);
73 
78  double* GetValues();
79 
85  void GetValues(double* contourValues);
86 
92  void SetNumberOfContours(int number);
93 
99 
101 
108  void SetGridSubdivisions(int gridSubdivisions);
109  vtkGetMacro(GridSubdivisions, int);
111 
113 
120  vtkGetMacro(ContourApproximationNumberOfPoints, int);
123 
127  vtkInformationVector** inputVector,
128  vtkInformationVector* outputVector) override;
129 
134 
135 protected:
138 
155  vtkIdType cellId,
156  vtkIdType previousCellId,
157  bool& invertedPoints,
158  bool up = true,
159  vtkIdList* currentPointIndices = nullptr);
160 
161  void ClearCache();
162  void BuildContours(vtkPolyData* contourPd,
163  int numContours,
164  const double* contourValues,
165  const double* densityPDFContourValues,
166  const char* xArrayName,
167  const char* yArrayName,
168  std::multimap<double, vtkSmartPointer<vtkTable> >& contoursMap);
169 
170  // Cache
171  class OTDensityCache;
172  class OTDistributionCache;
173  OTDensityCache* DensityPDFCache;
174  OTDensityCache* DensityLogPDFSampleCache;
175  OTDistributionCache* DistributionCache;
176 
177  vtkTimeStamp BuildTime; // Keep track of last build time
178  vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime
179  vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time
180 
184 
185 private:
186  void operator=(const vtkOTDensityMap&) = delete;
187  vtkOTDensityMap(const vtkOTDensityMap&) = delete;
188 };
189 #endif
vtkOTDensityMap::DensityLogPDFSampleCache
OTDensityCache * DensityLogPDFSampleCache
Definition: vtkOTDensityMap.h:174
vtkOTDensityMap::SetContourApproximationNumberOfPoints
virtual void SetContourApproximationNumberOfPoints(int val)
vtkOTDensityMap::DensityPDFMTime
vtkTimeStamp DensityPDFMTime
Definition: vtkOTDensityMap.h:179
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkOTDensityMap::SetValue
void SetValue(int i, double value)
Methods to set / get density lines values.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
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...
vtkOTDensityMap::~vtkOTDensityMap
~vtkOTDensityMap()
vtkSmartPointer< vtkTable >
vtkOTDensityMap::DistributionCache
OTDistributionCache * DistributionCache
Definition: vtkOTDensityMap.h:175
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:35
vtkOTDensityMap::GetValues
void GetValues(double *contourValues)
Fill a supplied list with contour values.
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkOTDensityMap::ContourValues
vtkContourValues * ContourValues
Definition: vtkOTDensityMap.h:181
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:177
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:40
vtkOTDensityMap::DensityPDFCache
OTDensityCache * DensityPDFCache
Definition: vtkOTDensityMap.h:172
vtkSmartPointer.h
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkMultiBlockDataSetAlgorithm.h
vtkOTDensityMap::GetValue
double GetValue(int i)
Get the ith contour value.
vtkOTDensityMap::ContourApproximationNumberOfPoints
int ContourApproximationNumberOfPoints
Definition: vtkOTDensityMap.h:183
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:44
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
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:178
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:182
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
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:302
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:36