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

Method Trace

Filters/ParallelFlowPaths/vtkPStreamTracer.cxx:1714–1784  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1712
1713//------------------------------------------------------------------------------
1714void vtkPStreamTracer::Trace(vtkDataSet* input, int vecType, const char* vecName,
1715 PStreamTracerPoint* point, vtkSmartPointer<vtkPolyData>& traceOut,
1716 vtkAbstractInterpolatedVelocityField* func, int maxCellSize)
1717{
1718 double* seedSource = point->GetSeed();
1719 int direction = point->GetDirection();
1720
1721 this->Utils->InitializeVelocityFunction(point, func);
1722
1723 vtkSmartPointer<vtkFloatArray> seeds = vtkSmartPointer<vtkFloatArray>::New();
1724 seeds->SetNumberOfComponents(3);
1725 seeds->InsertNextTuple(seedSource);
1726
1727 vtkNew<vtkIdList> seedIds;
1728 seedIds->InsertNextId(0);
1729
1730 vtkNew<vtkIntArray> integrationDirections;
1731 integrationDirections->InsertNextValue(direction);
1732 traceOut = vtkSmartPointer<vtkPolyData>::New();
1733
1734 double propagation = point->GetPropagation();
1735 vtkIdType numSteps = point->GetNumSteps();
1736 double integrationTime = point->GetIntegrationTime();
1737
1738 vtkStreamTracer::Integrate(input->GetPointData(), traceOut, seeds, seedIds, integrationDirections,
1739 func, maxCellSize, vecType, vecName, propagation, numSteps, integrationTime,
1740 this->CustomTerminationCallback, this->CustomTerminationClientData,
1741 this->CustomReasonForTermination);
1742
1743 AssertGe(propagation, point->GetPropagation());
1744 AssertGe(numSteps, point->GetNumSteps());
1745
1746 point->SetPropagation(propagation);
1747 point->SetNumSteps(numSteps);
1748 point->SetIntegrationTime(integrationTime);
1749
1750 if (this->GenerateNormalsInIntegrate)
1751 {
1752 this->GenerateNormals(traceOut, point->GetNormal(), vecName);
1753 }
1754
1755 if (traceOut->GetNumberOfPoints() > 0)
1756 {
1757 // If a point was produced, but no streamline, create arrays
1758 // which are used to communicate about streamline traversal.
1759 if (traceOut->GetLines()->GetNumberOfCells() == 0)
1760 {
1761 PRINT("Fix Single Point Path")
1762 AssertEq(traceOut->GetNumberOfPoints(), 1); // fix it
1763 vtkNew<vtkCellArray> newCells;
1764 vtkIdType cells[2] = { 0, 0 };
1765 newCells->InsertNextCell(2, cells);
1766 traceOut->SetLines(newCells);
1767
1768 // Don't forget to add the ReasonForTermination cell array.
1769 vtkNew<vtkIntArray> retVals;
1770 retVals->SetName("ReasonForTermination");
1771 retVals->SetNumberOfTuples(1);

Callers 1

RequestDataMethod · 0.95

Calls 15

IntegrateClass · 0.85
PRINTFunction · 0.85
SameShapeFunction · 0.85
InsertNextIdMethod · 0.80
GetIntegrationTimeMethod · 0.80
SetIntegrationTimeMethod · 0.80
SetLinesMethod · 0.80
GetTailMethod · 0.80
GetProtoMethod · 0.80
NewFunction · 0.50
AssertFunction · 0.50
GetSeedMethod · 0.45

Tested by

no test coverage detected