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

Method PopulateDataArray

Common/Core/vtkRandomPool.cxx:158–187  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

156
157//------------------------------------------------------------------------------
158void vtkRandomPool::PopulateDataArray(vtkDataArray* da, double minRange, double maxRange)
159{
160 if (da == nullptr)
161 {
162 vtkWarningMacro(<< "Bad request");
163 return;
164 }
165
166 vtkIdType size = da->GetNumberOfTuples();
167 int numComp = da->GetNumberOfComponents();
168
169 this->SetSize(size);
170 this->SetNumberOfComponents(numComp);
171 const double* pool = this->GeneratePool();
172 if (pool == nullptr)
173 {
174 return;
175 }
176
177 // Now perform the scaling of all components
178 using Dispatcher = vtkArrayDispatch::Dispatch;
179 PopulateLauncher worker;
180 if (!Dispatcher::Execute(da, worker, pool, minRange, maxRange))
181 { // Fallback for unknown array types:
182 worker(da, pool, minRange, maxRange);
183 }
184
185 // Make sure that the data array is marked modified
186 da->Modified();
187}
188
189//------------------------------------------------------------------------------
190void vtkRandomPool::PopulateDataArray(

Callers 4

testWarningCheckMethod · 0.80
TestWarningCheckFunction · 0.80
TestSelectEnclosedPointsFunction · 0.80

Calls 9

GeneratePoolMethod · 0.95
ExecuteFunction · 0.50
maxFunction · 0.50
minFunction · 0.50
GetNumberOfTuplesMethod · 0.45
GetNumberOfComponentsMethod · 0.45
SetSizeMethod · 0.45
SetNumberOfComponentsMethod · 0.45
ModifiedMethod · 0.45

Tested by 3

testWarningCheckMethod · 0.64
TestWarningCheckFunction · 0.64
TestSelectEnclosedPointsFunction · 0.64