----------------------------------------------------------------------------
| 1571 | |
| 1572 | //---------------------------------------------------------------------------- |
| 1573 | int vtkSMPropertyHelper::GetInputArrayAssociation() const |
| 1574 | { |
| 1575 | if (this->Type != vtkSMPropertyHelper::STRING) |
| 1576 | { |
| 1577 | vtkSMPropertyHelperWarningMacro( |
| 1578 | "Property for 'InputArrayToProcess' can only be vtkSMStringVectorProperty."); |
| 1579 | return -1; |
| 1580 | } |
| 1581 | |
| 1582 | vtkSMStringVectorProperty* svp = vtkSMStringVectorProperty::SafeDownCast(this->Property); |
| 1583 | |
| 1584 | if (this->GetUseUnchecked()) |
| 1585 | { |
| 1586 | if (svp->GetNumberOfUncheckedElements() != 2 && svp->GetNumberOfUncheckedElements() != 5) |
| 1587 | { |
| 1588 | vtkSMPropertyHelperWarningMacro("We only support 2 or 5 element properties."); |
| 1589 | return -1; |
| 1590 | } |
| 1591 | const std::string_view str = svp->GetNumberOfUncheckedElements() == 2 |
| 1592 | ? svp->GetUncheckedElement(0) |
| 1593 | : svp->GetUncheckedElement(3); |
| 1594 | int assoc = 0; |
| 1595 | if (!str.empty()) |
| 1596 | { |
| 1597 | VTK_FROM_CHARS_IF_ERROR_RETURN(str, assoc, 0); |
| 1598 | } |
| 1599 | return assoc; |
| 1600 | } |
| 1601 | else |
| 1602 | { |
| 1603 | if (svp->GetNumberOfElements() != 2 && svp->GetNumberOfElements() != 5) |
| 1604 | { |
| 1605 | vtkSMPropertyHelperWarningMacro("We only support 2 or 5 element properties."); |
| 1606 | return -1; |
| 1607 | } |
| 1608 | |
| 1609 | const std::string_view str = |
| 1610 | svp->GetNumberOfElements() == 2 ? svp->GetElement(0) : svp->GetElement(3); |
| 1611 | int assoc = 0; |
| 1612 | if (!str.empty()) |
| 1613 | { |
| 1614 | VTK_FROM_CHARS_IF_ERROR_RETURN(str, assoc, 0); |
| 1615 | } |
| 1616 | return assoc; |
| 1617 | } |
| 1618 | } |
| 1619 | |
| 1620 | //---------------------------------------------------------------------------- |
| 1621 | const char* vtkSMPropertyHelper::GetInputArrayNameToProcess() const |
no test coverage detected