| 655 | } |
| 656 | |
| 657 | int vtkHyperStreamline::BuildTube(vtkDataSet* input, vtkPolyData* output) |
| 658 | { |
| 659 | vtkHyperPoint *sPrev, *sPtr; |
| 660 | vtkPoints* newPts; |
| 661 | vtkFloatArray* newVectors; |
| 662 | vtkFloatArray* newNormals; |
| 663 | vtkFloatArray* newScalars = nullptr; |
| 664 | vtkCellArray* newStrips; |
| 665 | vtkIdType i, npts, ptOffset = 0; |
| 666 | int ptId, j, id, k, i1, i2; |
| 667 | double dOffset, x[3], v[3], s, r, r1[3], r2[3], stepLength; |
| 668 | double xT[3], sFactor, normal[3], w[3]; |
| 669 | double theta = 2.0 * vtkMath::Pi() / this->NumberOfSides; |
| 670 | vtkPointData* outPD; |
| 671 | int iv, ix, iy; |
| 672 | vtkIdType numIntPts; |
| 673 | // |
| 674 | // Initialize |
| 675 | // |
| 676 | vtkDebugMacro(<< "Creating hyperstreamline tube"); |
| 677 | if (this->NumberOfStreamers <= 0) |
| 678 | { |
| 679 | return 0; |
| 680 | } |
| 681 | |
| 682 | stepLength = input->GetLength() * this->StepLength; |
| 683 | outPD = output->GetPointData(); |
| 684 | |
| 685 | iv = this->IntegrationEigenvector; |
| 686 | ix = (iv + 1) % 3; |
| 687 | iy = (iv + 2) % 3; |
| 688 | // |
| 689 | // Allocate |
| 690 | // |
| 691 | newPts = vtkPoints::New(); |
| 692 | newPts->Allocate(2500); |
| 693 | if (input->GetPointData()->GetScalars()) |
| 694 | { |
| 695 | newScalars = vtkFloatArray::New(); |
| 696 | newScalars->Allocate(2500); |
| 697 | } |
| 698 | newVectors = vtkFloatArray::New(); |
| 699 | newVectors->SetNumberOfComponents(3); |
| 700 | newVectors->Allocate(7500); |
| 701 | newNormals = vtkFloatArray::New(); |
| 702 | newNormals->SetNumberOfComponents(3); |
| 703 | newNormals->Allocate(7500); |
| 704 | newStrips = vtkCellArray::New(); |
| 705 | newStrips->AllocateEstimate(3 * this->NumberOfStreamers, VTK_CELL_SIZE); |
| 706 | // |
| 707 | // Loop over all hyperstreamlines generating points |
| 708 | // |
| 709 | for (ptId = 0; ptId < this->NumberOfStreamers; ptId++) |
| 710 | { |
| 711 | if ((numIntPts = this->Streamers[ptId].GetNumberOfPoints()) < 2) |
| 712 | { |
| 713 | continue; |
| 714 | } |
no test coverage detected