------------------------------------------------------------------------------
| 244 | |
| 245 | //------------------------------------------------------------------------------ |
| 246 | int 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 | //------------------------------------------------------------------------------ |
| 276 | int vtkEvenlySpacedStreamlines2D::FillInputPortInformation(int port, vtkInformation* info) |
no test coverage detected