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

Method setGroupName

Examples/GUI/Qt/CellGridSource/ArrayGroupModel.cxx:41–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool ArrayGroupModel::setGroupName(vtkStringToken groupName, bool signalChange)
42{
43 if (groupName == this->GroupName)
44 {
45 return false;
46 }
47 if (signalChange)
48 {
49 Q_EMIT beginResetModel();
50 }
51 // Clear and rebuild CurrentTable, ArrayColumnStart, ColumnToArrayComponent.
52 this->GroupName = groupName;
53 this->CurrentTable = this->Data->FindAttributes(this->GroupName);
54 this->ColumnToArrayComponent.clear();
55 this->ArrayColumnStart.clear();
56 if (this->CurrentTable)
57 {
58 int numArrays = this->CurrentTable->GetNumberOfArrays();
59 for (int ii = 0; ii < numArrays; ++ii)
60 {
61 auto* array = this->CurrentTable->GetAbstractArray(ii);
62 this->ArrayColumnStart[array->GetName()] =
63 static_cast<int>(this->ColumnToArrayComponent.size());
64 int numComps = array->GetNumberOfComponents();
65 for (int jj = 0; jj < numComps; ++jj)
66 {
67 this->ColumnToArrayComponent.emplace_back(array, jj, columnName(array, jj));
68 }
69 }
70 }
71 // Notify Qt the table has completely changed.
72 if (signalChange)
73 {
74 Q_EMIT endResetModel();
75 }
76 return true;
77}
78
79int ArrayGroupModel::rowCount(const QModelIndex& parent) const
80{

Callers 3

ArrayGroupModelMethod · 0.95
updateArrayGroupsFunction · 0.80
mainFunction · 0.80

Calls 9

columnNameFunction · 0.85
FindAttributesMethod · 0.80
GetAbstractArrayMethod · 0.80
clearMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetNameMethod · 0.45
sizeMethod · 0.45
GetNumberOfComponentsMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected