// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen // SPDX-License-Identifier: BSD-3-Clause /** * @class vtkOTDensityMap * @brief * A VTK Filter to compute density map on any pair of numeric data arrays * with the same number of tuples, using OpenTURNS. * The Output will be a MultiBlock of table, each table containing * X and Y coordinate of a density map line. * */ #ifndef vtkOTDensityMap_h #define vtkOTDensityMap_h #include "vtkContourValues.h" // For Contour Values #include "vtkFiltersOpenTURNSModule.h" // For export macro #include "vtkMultiBlockDataSetAlgorithm.h" #include "vtkSmartPointer.h" // For Smart Pointer #include // For map VTK_ABI_NAMESPACE_BEGIN class vtkIdList; class vtkInformationDoubleKey; class vtkPolyData; class vtkTable; class VTKFILTERSOPENTURNS_EXPORT vtkOTDensityMap : public vtkMultiBlockDataSetAlgorithm { public: static vtkOTDensityMap* New(); vtkTypeMacro(vtkOTDensityMap, vtkMultiBlockDataSetAlgorithm); void PrintSelf(ostream& os, vtkIndent indent) override; /** * Check contour values to return actual mtime */ vtkMTimeType GetMTime() override; ///@{ /** * Methods to set / get density lines values. * Values are expected to be between 0 and 1. * Modifying these parameters does not trigger a pdf * computation, thus will be very fast to compute, * empty by default */ /** * Set a particular contour value at contour number i. The index i ranges * between 0<=i 0, the result of this method is ensured to be != * previousCellId. * invertedPoints is an output, informing that the current cellId has inverted points * up is an input, allowing to specify the direction to follow. In any case, if the * next cell id cannot be found in this direction, the other direction will be tried, this is the * case where we consider the cell points are inverted. * currentPointIndices is an optional output, if != nullptr, the current cell points will be * stored in. */ virtual vtkIdType FindNextCellId(vtkPolyData* pd, vtkIdType cellId, vtkIdType previousCellId, bool& invertedPoints, bool up = true, vtkIdList* currentPointIndices = nullptr); void ClearCache(); void BuildContours(vtkPolyData* contourPd, int numContours, const double* contourValues, const double* densityPDFContourValues, const char* xArrayName, const char* yArrayName, std::multimap>& contoursMap); // Cache class OTDensityCache; class OTDistributionCache; OTDensityCache* DensityPDFCache; OTDensityCache* DensityLogPDFSampleCache; OTDistributionCache* DistributionCache; vtkTimeStamp BuildTime; // Keep track of last build time vtkTimeStamp DensityLogPDFSampleMTime; // Keep track of DensityLogPDFSample Parameters mtime vtkTimeStamp DensityPDFMTime; // Keep track of DensityPDF Parameters modification time vtkContourValues* ContourValues; int GridSubdivisions; int ContourApproximationNumberOfPoints; private: void operator=(const vtkOTDensityMap&) = delete; vtkOTDensityMap(const vtkOTDensityMap&) = delete; }; VTK_ABI_NAMESPACE_END #endif