------------------------------------------------------------------------------
| 667 | |
| 668 | //------------------------------------------------------------------------------ |
| 669 | void vtkGenericStreamTracer::Integrate(vtkGenericDataSet* input0, vtkPolyData* output, |
| 670 | vtkDataArray* seedSource, vtkIdList* seedIds, vtkIntArray* integrationDirections, |
| 671 | double lastPoint[3], vtkGenericInterpolatedVelocityField* func) |
| 672 | { |
| 673 | int i; |
| 674 | vtkIdType numLines = seedIds->GetNumberOfIds(); |
| 675 | |
| 676 | // Useful pointers |
| 677 | vtkDataSetAttributes* outputPD = output->GetPointData(); |
| 678 | vtkDataSetAttributes* outputCD = output->GetCellData(); |
| 679 | vtkGenericDataSet* input; |
| 680 | vtkGenericAttribute* inVectors; |
| 681 | |
| 682 | int direction = 1; |
| 683 | |
| 684 | if (this->GetIntegrator() == nullptr) |
| 685 | { |
| 686 | vtkErrorMacro("No integrator is specified."); |
| 687 | return; |
| 688 | } |
| 689 | |
| 690 | // Used in GetCell() |
| 691 | // vtkGenericCell* cell = vtkGenericCell::New(); |
| 692 | vtkGenericAdaptorCell* cell = nullptr; |
| 693 | |
| 694 | // Create a new integrator, the type is the same as Integrator |
| 695 | vtkInitialValueProblemSolver* integrator = this->GetIntegrator()->NewInstance(); |
| 696 | integrator->SetFunctionSet(func); |
| 697 | |
| 698 | // Since we do not know what the total number of points |
| 699 | // will be, we do not allocate any. This is important for |
| 700 | // cases where a lot of streamers are used at once. If we |
| 701 | // were to allocate any points here, potentially, we can |
| 702 | // waste a lot of memory if a lot of streamers are used. |
| 703 | // Always insert the first point |
| 704 | vtkPoints* outputPoints = vtkPoints::New(); |
| 705 | vtkCellArray* outputLines = vtkCellArray::New(); |
| 706 | |
| 707 | // We will keep track of time in this array |
| 708 | vtkDoubleArray* time = vtkDoubleArray::New(); |
| 709 | time->SetName("IntegrationTime"); |
| 710 | |
| 711 | // This array explains why the integration stopped |
| 712 | vtkIntArray* retVals = vtkIntArray::New(); |
| 713 | retVals->SetName("ReasonForTermination"); |
| 714 | |
| 715 | vtkDoubleArray* vorticity = nullptr; |
| 716 | vtkDoubleArray* rotation = nullptr; |
| 717 | vtkDoubleArray* angularVel = nullptr; |
| 718 | if (this->ComputeVorticity) |
| 719 | { |
| 720 | vorticity = vtkDoubleArray::New(); |
| 721 | vorticity->SetName("Vorticity"); |
| 722 | vorticity->SetNumberOfComponents(3); |
| 723 | |
| 724 | rotation = vtkDoubleArray::New(); |
| 725 | rotation->SetName("Rotation"); |
| 726 |
no test coverage detected