------------------------------------------------------------------------------
| 77 | |
| 78 | //------------------------------------------------------------------------------ |
| 79 | int vtkGenericProbeFilter::RequestData(vtkInformation* vtkNotUsed(request), |
| 80 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 81 | { |
| 82 | // get the info objects |
| 83 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 84 | vtkInformation* sourceInfo = inputVector[1]->GetInformationObject(0); |
| 85 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 86 | |
| 87 | // get the input and output |
| 88 | vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 89 | vtkDataSet* output = vtkDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 90 | |
| 91 | vtkGenericDataSet* source = |
| 92 | vtkGenericDataSet::SafeDownCast(sourceInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 93 | |
| 94 | vtkIdType ptId, numPts; |
| 95 | double x[3], tol2; |
| 96 | int subId; |
| 97 | |
| 98 | double pcoords[3]; |
| 99 | |
| 100 | vtkDebugMacro(<< "Probing data"); |
| 101 | |
| 102 | if (source == nullptr) |
| 103 | { |
| 104 | vtkErrorMacro(<< "Source is nullptr."); |
| 105 | return 1; |
| 106 | } |
| 107 | |
| 108 | // First, copy the input to the output as a starting point |
| 109 | output->CopyStructure(input); |
| 110 | |
| 111 | numPts = input->GetNumberOfPoints(); |
| 112 | this->ValidPoints->Allocate(numPts); |
| 113 | |
| 114 | vtkPointData* outputPD = output->GetPointData(); |
| 115 | vtkCellData* outputCD = output->GetCellData(); |
| 116 | |
| 117 | // prepare the output attributes |
| 118 | vtkGenericAttributeCollection* attributes = source->GetAttributes(); |
| 119 | vtkGenericAttribute* attribute; |
| 120 | vtkDataArray* attributeArray; |
| 121 | |
| 122 | int c = attributes->GetNumberOfAttributes(); |
| 123 | vtkDataSetAttributes* dsAttributes; |
| 124 | |
| 125 | int attributeType; |
| 126 | |
| 127 | double* tuples = new double[attributes->GetMaxNumberOfComponents()]; |
| 128 | |
| 129 | for (int i = 0; i < c; ++i) |
| 130 | { |
| 131 | attribute = attributes->GetAttribute(i); |
| 132 | attributeType = attribute->GetType(); |
| 133 | if (attribute->GetCentering() == vtkPointCentered) |
| 134 | { |
| 135 | dsAttributes = outputPD; |
| 136 | } |
nothing calls this directly
no test coverage detected