VTK  9.1.0
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
35class vtkIdList;
37class vtkPolyData;
38class vtkTable;
39
40class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
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
124 vtkInformationVector* outputVector) override;
125
130
131protected:
134
150 virtual vtkIdType FindNextCellId(vtkPolyData* pd, vtkIdType cellId, vtkIdType previousCellId,
151 bool& invertedPoints, bool up = true, vtkIdList* currentPointIndices = nullptr);
152
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;
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
173private:
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:140
a simple class to control print indentation
Definition: vtkIndent.h:113
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...
double * GetValues()
Get a pointer to an array of contour values.
void GetValues(double *contourValues)
Fill a supplied list with contour values.
OTDistributionCache * DistributionCache
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)
Methods to set / get number of points to compute the contour values approximations using a LogPDF.
static vtkInformationDoubleKey * DENSITY()
Key to recover density in output metadata.
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
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)
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...
static vtkOTDensityMap * New()
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
vtkMTimeType GetMTime() override
Check contour values to return actual mtime.
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:195
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
record modification and/or execution time
Definition: vtkTimeStamp.h:52
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287