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

Function updateArrayGroups

Examples/GUI/Qt/CellGridSource/CellGridSource.cxx:80–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void updateArrayGroups(ArrayGroupModel& model, vtkCellGridCellSource* cellSource,
81 QComboBox* groupSelector, bool signalChange = true)
82{
83 cellSource->Update();
84 int idx = -1;
85 groupSelector->clear();
86 auto* cellGrid = cellSource->GetOutput();
87 auto curGroupName = model.groupName();
88 for (const auto& entry : cellGrid->GetArrayGroups())
89 {
90 vtkStringToken groupName(static_cast<vtkStringToken::Hash>(entry.first));
91 if (groupName.IsValid() && groupName.HasData())
92 {
93 if (groupName == curGroupName)
94 {
95 idx = groupSelector->count();
96 }
97 groupSelector->addItem(QString::fromStdString(groupName.Data()));
98 }
99 }
100 if (idx < 0 && groupSelector->count() > 0)
101 {
102 idx = 0;
103 curGroupName = groupSelector->currentText().toStdString();
104 }
105 model.setGroupName(curGroupName, signalChange);
106}
107
108} // anonymous namespace
109

Callers 1

mainFunction · 0.85

Calls 9

groupNameMethod · 0.80
setGroupNameMethod · 0.80
UpdateMethod · 0.45
clearMethod · 0.45
GetOutputMethod · 0.45
IsValidMethod · 0.45
HasDataMethod · 0.45
countMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected