----------------------------------------------------------------------------
| 936 | |
| 937 | //---------------------------------------------------------------------------- |
| 938 | std::vector<std::string> vtkDataAssemblyUtilities::GetSelectorsForCompositeIds( |
| 939 | const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy) |
| 940 | { |
| 941 | const auto root = vtkDataAssembly::GetRootNode(); |
| 942 | if (strcmp(hierarchy->GetAttributeOrDefault(root, CATEGORY_ATTRIBUTE_NAME, ""), |
| 943 | CATEGORY_HIERARCHY) != 0) |
| 944 | { |
| 945 | vtkLogF(ERROR, |
| 946 | "GetSelectorForCompositeId is only supported on a data-assembly representation a hierarchy."); |
| 947 | return {}; |
| 948 | } |
| 949 | |
| 950 | const auto dataType = hierarchy->GetAttributeOrDefault(root, "vtk_type", -1); |
| 951 | if (vtkDataObjectTypes::TypeIdIsA(dataType, VTK_PARTITIONED_DATA_SET_COLLECTION) || |
| 952 | vtkDataObjectTypes::TypeIdIsA(dataType, VTK_MULTIBLOCK_DATA_SET)) |
| 953 | { |
| 954 | vtkNew<vtkSelectorsForCompositeIdsVisitor> visitor; |
| 955 | std::copy( |
| 956 | ids.begin(), ids.end(), std::inserter(visitor->CompositeIds, visitor->CompositeIds.end())); |
| 957 | hierarchy->Visit(visitor); |
| 958 | return visitor->Selectors; |
| 959 | } |
| 960 | |
| 961 | // in theory, this can work for AMR too, but I am leaving that until we have a |
| 962 | // use-case. |
| 963 | return {}; |
| 964 | } |
| 965 | |
| 966 | //---------------------------------------------------------------------------- |
| 967 | std::vector<std::string> vtkDataAssemblyUtilities::GetSelectorsForCompositeIds( |
nothing calls this directly
no test coverage detected