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

Method SetTable

Common/DataModel/vtkStatisticalModel.cxx:350–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350bool vtkStatisticalModel::SetTable(
351 int type, int index, vtkTable* table, const std::string& tableName)
352{
353 auto it = this->ModelTables.find(type);
354 if (it == this->ModelTables.end())
355 {
356 // Call SetNumberOfTables(type, number) first.
357 return false;
358 }
359 if (index < 0 || index >= static_cast<int>(it->second.size()))
360 {
361 return false;
362 }
363 if (it->second[index].GetPointer() == table)
364 {
365 if (it->second[index] &&
366 it->second[index]->GetInformation()->Get(vtkCompositeDataSet::NAME()) != tableName)
367 {
368 if (tableName.empty())
369 {
370 it->second[index]->GetInformation()->Remove(vtkCompositeDataSet::NAME());
371 }
372 else
373 {
374 it->second[index]->GetInformation()->Set(vtkCompositeDataSet::NAME(), tableName.c_str());
375 }
376 this->Modified();
377 return true;
378 }
379 // Table is already set to the same value.
380 return false;
381 }
382 it->second[index] = table;
383 if (!tableName.empty())
384 {
385 it->second[index]->GetInformation()->Set(vtkCompositeDataSet::NAME(), tableName.c_str());
386 }
387 this->Modified();
388 return true;
389}
390
391bool vtkStatisticalModel::SetTableName(int type, int index, const std::string& name)
392{

Callers 1

DeepCopyMethod · 0.95

Calls 11

findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
GetPointerMethod · 0.45
GetMethod · 0.45
GetInformationMethod · 0.45
emptyMethod · 0.45
RemoveMethod · 0.45
SetMethod · 0.45
c_strMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected