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

Method ConsumeNextAlgorithmParameter

Filters/Statistics/vtkVisualStatistics.cxx:451–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451std::size_t vtkVisualStatistics::ConsumeNextAlgorithmParameter(
452 vtkStringToken parameterName, const std::string& algorithmParameters)
453{
454 using namespace vtk::literals;
455 std::size_t consumed = 0;
456 switch (parameterName.GetHash())
457 {
458 case "number_of_bins"_hash:
459 {
460 int value;
461 if ((consumed = this->ConsumeInt(algorithmParameters, value)))
462 {
463 this->SetNumberOfBins(value);
464 }
465 }
466 break;
467 case "field_ranges"_hash:
468 {
469 std::map<std::string, std::vector<double>> map;
470 if ((consumed = this->ConsumeStringToDoublesMap(algorithmParameters, map)))
471 {
472 this->ResetFieldRanges();
473 for (const auto& entry : map)
474 {
475 if (entry.second.size() != 2 || entry.second[1] < entry.second[0])
476 {
477 vtkErrorMacro("Invalid range for \"" << entry.first << "\".");
478 continue;
479 }
480 this->SetFieldRange(entry.first, entry.second[0], entry.second[1]);
481 }
482 }
483 }
484 break;
485 default:
486 consumed =
487 this->Superclass::ConsumeNextAlgorithmParameter(parameterName, algorithmParameters);
488 break;
489 }
490 return consumed;
491}
492
493VTK_ABI_NAMESPACE_END

Callers

nothing calls this directly

Calls 6

SetFieldRangeMethod · 0.95
GetHashMethod · 0.80
ConsumeIntMethod · 0.80
SetNumberOfBinsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected