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

Method GetItemAsObject

Common/Core/vtkCollection.cxx:254–284  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

252
253//------------------------------------------------------------------------------
254vtkObject* vtkCollection::GetItemAsObject(int i) VTK_FUTURE_CONST
255{
256 vtkCollectionElement* elem = this->Top;
257
258 if (i < 0)
259 {
260 return nullptr;
261 }
262
263 if (i == this->NumberOfItems - 1)
264 {
265 // optimize for the special case where we're looking for the last elem
266 elem = this->Bottom;
267 }
268 else
269 {
270 while (elem != nullptr && i > 0)
271 {
272 elem = elem->Next;
273 i--;
274 }
275 }
276 if (elem != nullptr)
277 {
278 return elem->Item;
279 }
280 else
281 {
282 return nullptr;
283 }
284}
285
286//------------------------------------------------------------------------------
287void vtkCollection::ReplaceItem(int i, vtkObject* a)

Callers 15

WritePropCollectionMethod · 0.80
ReadFileMethod · 0.80
GetNthTransformMethod · 0.80
WriteFileMethod · 0.80
ProcessRequestMethod · 0.80
RequestDataMethod · 0.80
ReadVariableFilesMethod · 0.80
rendererSerializerFunction · 0.80
renderWindowSerializerFunction · 0.80
parseRendererMethod · 0.80
parseSceneMethod · 0.80
generateRendererDataMethod · 0.80

Calls

no outgoing calls

Tested by 9

testSubclassGhostMethod · 0.64
TestGeneralFunction · 0.64
TestOSPRayRenderMeshFunction · 0.64
TestOSPRayDynamicObjectFunction · 0.64
OnKeyPressMethod · 0.64
OnKeyPressMethod · 0.64
TestAnariDynamicObjectFunction · 0.64
prepareTestImageMethod · 0.64