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

Method RequestData

Filters/Generic/vtkGenericProbeFilter.cxx:79–216  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

77
78//------------------------------------------------------------------------------
79int 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 }

Callers

nothing calls this directly

Calls 15

GetInformationObjectMethod · 0.80
GetCenteringMethod · 0.80
GetComponentTypeMethod · 0.80
NullDataMethod · 0.80
DeleteMethod · 0.65
CreateDataArrayFunction · 0.50
GetMethod · 0.45
CopyStructureMethod · 0.45
GetNumberOfPointsMethod · 0.45
AllocateMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected