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

Method RequestData

Filters/Sources/vtkSelectionSource.cxx:814–1095  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

812
813//------------------------------------------------------------------------------
814int vtkSelectionSource::RequestData(vtkInformation* vtkNotUsed(request),
815 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
816{
817 vtkSelection* outputSel = vtkSelection::GetData(outputVector);
818 if (!this->Expression.empty())
819 {
820 outputSel->SetExpression(this->Expression);
821 }
822 vtkInformation* outInfo = outputVector->GetInformationObject(0);
823
824 int piece = outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER())
825 ? outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER())
826 : 0;
827
828 int fieldType = this->FieldTypeOption == FieldTypeOptions::FIELD_TYPE
829 ? this->FieldType
830 : vtkSelectionNode::ConvertAttributeTypeToSelectionField(this->ElementType);
831
832 for (unsigned int nodeId = 0; nodeId < this->GetNumberOfNodes(); ++nodeId)
833 {
834 const auto& nodeInfo = this->NodesInfo[nodeId];
835 vtkNew<vtkSelectionNode> node;
836 if (!nodeInfo->Name.empty())
837 {
838 outputSel->SetNode(nodeInfo->Name, node);
839 }
840 else
841 {
842 outputSel->AddNode(node);
843 }
844 vtkInformation* oProperties = node->GetProperties();
845
846 if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()))
847 {
848 if (this->ProcessID >= 0)
849 {
850 oProperties->Set(vtkSelectionNode::PROCESS_ID(), this->ProcessID);
851 }
852 }
853 if (nodeInfo->CompositeIndex >= 0)
854 {
855 oProperties->Set(vtkSelectionNode::COMPOSITE_INDEX(), nodeInfo->CompositeIndex);
856 }
857
858 if (nodeInfo->HierarchicalLevel >= 0 && nodeInfo->HierarchicalIndex >= 0)
859 {
860 oProperties->Set(vtkSelectionNode::HIERARCHICAL_LEVEL(), nodeInfo->HierarchicalLevel);
861 oProperties->Set(vtkSelectionNode::HIERARCHICAL_INDEX(), nodeInfo->HierarchicalIndex);
862 }
863
864 if (!nodeInfo->AssemblyName.empty() && !nodeInfo->Selectors.empty())
865 {
866 oProperties->Set(vtkSelectionNode::ASSEMBLY_NAME(), nodeInfo->AssemblyName.c_str());
867 for (auto& selector : nodeInfo->Selectors)
868 {
869 oProperties->Append(vtkSelectionNode::SELECTORS(), selector.c_str());
870 }
871 }

Callers

nothing calls this directly

Calls 15

GetInformationObjectMethod · 0.80
SetSelectionListMethod · 0.80
SetQueryStringMethod · 0.80
GetSelectionListMethod · 0.80
GetDataFunction · 0.50
emptyMethod · 0.45
HasMethod · 0.45
GetMethod · 0.45
GetNumberOfNodesMethod · 0.45
SetNodeMethod · 0.45
AddNodeMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected