MCPcopy Create free account
hub / github.com/commontk/CTK / arrayFromItem

Method arrayFromItem

Libs/Visualization/VTK/Widgets/ctkVTKDataSetModel.cpp:234–253  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

232
233//------------------------------------------------------------------------------
234vtkAbstractArray* ctkVTKDataSetModel::arrayFromItem(QStandardItem* arrayItem)const
235{
236 if (arrayItem == 0 || arrayItem == this->invisibleRootItem())
237 {
238 return 0;
239 }
240 QVariant arrayPointer = arrayItem->data(ctkVTK::PointerRole);
241 Q_ASSERT(arrayPointer.isValid());
242 vtkAbstractArray* array = static_cast<vtkAbstractArray*>(
243 reinterpret_cast<void *>(arrayPointer.toLongLong()));
244 if (arrayItem->data(ctkVTK::LocationRole).toInt() == this->NullItemLocation)
245 {
246 // null item
247 Q_ASSERT(array==0);
248 return 0;
249 }
250
251 Q_ASSERT(array);
252 return array;
253}
254
255//------------------------------------------------------------------------------
256int ctkVTKDataSetModel::locationFromItem(QStandardItem* arrayItem)const

Callers 4

arrayFromIndexMethod · 0.95
onItemChangedMethod · 0.95
foreachFunction · 0.80
ctkVTKDataSetModelTest1Function · 0.80

Calls 3

dataMethod · 0.45
isValidMethod · 0.45
toIntMethod · 0.45

Tested by 2

foreachFunction · 0.64
ctkVTKDataSetModelTest1Function · 0.64