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

Method ComputeCellLength

Filters/FlowPaths/vtkEvenlySpacedStreamlines2D.cxx:246–273  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

244
245//------------------------------------------------------------------------------
246int vtkEvenlySpacedStreamlines2D::ComputeCellLength(double* cellLength)
247{
248 vtkAbstractInterpolatedVelocityField* func;
249 int maxCellSize = 0;
250 if (this->CheckInputs(func, &maxCellSize) != VTK_OK)
251 {
252 if (func)
253 {
254 func->Delete();
255 }
256 return 0;
257 }
258 vtkDataSet* input;
259 auto cell = vtkSmartPointer<vtkGenericCell>::New();
260 double velocity[3];
261 // access the start position
262 if (!func->FunctionValues(this->StartPosition, velocity))
263 {
264 func->Delete();
265 return 0;
266 }
267 // Make sure we use the dataset found by the vtkAbstractInterpolatedVelocityField
268 input = func->GetLastDataSet();
269 input->GetCell(func->GetLastCellId(), cell);
270 *cellLength = sqrt(cell->GetLength2());
271 func->Delete();
272 return 1;
273}
274
275//------------------------------------------------------------------------------
276int vtkEvenlySpacedStreamlines2D::FillInputPortInformation(int port, vtkInformation* info)

Callers 1

RequestDataMethod · 0.95

Calls 7

CheckInputsMethod · 0.95
DeleteMethod · 0.65
NewFunction · 0.50
sqrtFunction · 0.50
FunctionValuesMethod · 0.45
GetCellMethod · 0.45
GetLength2Method · 0.45

Tested by

no test coverage detected