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

Method HasAttribute

Common/DataModel/vtkGenericAttributeCollection.cxx:442–460  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description Does the array `attributes' of size `size' have `attribute'?

Source from the content-addressed store, hash-verified

440// Description
441// Does the array `attributes' of size `size' have `attribute'?
442vtkTypeBool vtkGenericAttributeCollection::HasAttribute(int size, int* attributes, int attribute)
443{
444 assert("pre: positive_size" && size >= 0);
445 assert("pre: valid_attributes" &&
446 ((!(size > 0)) || (attributes != nullptr))); // size>0 => attributes!=0 (A=>B: !A||B )
447
448 int result = 0; // false
449 int i;
450
451 if (size != 0)
452 {
453 i = 0;
454 while (!result && i++ < size)
455 {
456 result = attributes[i] == attribute;
457 }
458 }
459 return result;
460}
461
462//------------------------------------------------------------------------------
463// Description:

Callers 1

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected