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

Method BuildTube

Filters/General/vtkHyperStreamline.cxx:657–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657int 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 }

Callers 1

RequestDataMethod · 0.95

Calls 15

PiFunction · 0.85
AllocateEstimateMethod · 0.80
GetHyperPointMethod · 0.80
InsertCellPointMethod · 0.80
SetStripsMethod · 0.80
SetVectorsMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
cosFunction · 0.50
sinFunction · 0.50
NormalizeFunction · 0.50
GetLengthMethod · 0.45

Tested by

no test coverage detected