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

Method IndexOfFirstOccurrence

Common/Core/vtkCollection.cxx:198–219  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

196
197//------------------------------------------------------------------------------
198int vtkCollection::IndexOfFirstOccurrence(vtkObject* a) const
199{
200 if (!this->Top || !a)
201 {
202 return -1;
203 }
204
205 vtkCollectionElement* elem = this->Top;
206 for (int i = 0; i < this->NumberOfItems; i++)
207 {
208 if (elem->Item == a)
209 {
210 return i;
211 }
212 else
213 {
214 elem = elem->Next;
215 }
216 }
217
218 return -1;
219}
220
221//------------------------------------------------------------------------------
222int vtkCollection::IsItemPresent(vtkObject* a) VTK_FUTURE_CONST

Callers 15

IndexOfFirstOccurenceMethod · 0.95
WriteDataMethod · 0.45
TestRemoveItemFunction · 0.45
TestGeneralFunction · 0.45
AddFunctionMethod · 0.45
RemoveFunctionMethod · 0.45
AddCueMethod · 0.45
AddDataSetMethod · 0.45
GetDataSetIndexMethod · 0.45
SetFunctionWeightMethod · 0.45
HasPropMethod · 0.45
HasPropMethod · 0.45

Calls

no outgoing calls

Tested by 2

TestRemoveItemFunction · 0.36
TestGeneralFunction · 0.36