MCPcopy Create free account
hub / github.com/Kitware/VTK / GenerateContinuousDataLookupTable

Method GenerateContinuousDataLookupTable

Views/Infovis/vtkHeatmapItem.cxx:214–244  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

212
213//------------------------------------------------------------------------------
214void vtkHeatmapItem::GenerateContinuousDataLookupTable()
215{
216 this->ContinuousDataLookupTable->SetNumberOfTableValues(255);
217 this->ContinuousDataLookupTable->Build();
218 this->ContinuousDataLookupTable->SetRange(0, 255);
219 this->ContinuousDataLookupTable->SetNanColor(0.75, 0.75, 0.75, 1.0);
220
221 // black to red
222 for (int i = 0; i < 85; ++i)
223 {
224 float f = static_cast<float>(i) / 84.0;
225 this->ContinuousDataLookupTable->SetTableValue(i, f, 0, 0);
226 }
227
228 // red to yellow
229 for (int i = 0; i < 85; ++i)
230 {
231 float f = static_cast<float>(i) / 84.0;
232 this->ContinuousDataLookupTable->SetTableValue(85 + i, 1.0, f, 0);
233 }
234
235 // yellow to white
236 for (int i = 0; i < 85; ++i)
237 {
238 float f = static_cast<float>(i) / 84.0;
239 this->ContinuousDataLookupTable->SetTableValue(170 + i, 1.0, 1.0, f);
240 }
241
242 this->ColorLegendLookupTable->DeepCopy(this->ContinuousDataLookupTable);
243 this->ColorLegend->SetTransferFunction(this->ColorLegendLookupTable);
244}
245
246//------------------------------------------------------------------------------
247void vtkHeatmapItem::AccumulateProminentCategoricalDataValues(vtkIdType column)

Callers 1

Calls 7

SetNanColorMethod · 0.80
SetTableValueMethod · 0.80
BuildMethod · 0.45
SetRangeMethod · 0.45
DeepCopyMethod · 0.45
SetTransferFunctionMethod · 0.45

Tested by

no test coverage detected