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

Method StartPass

Filters/CellGrid/vtkCellGridSampleQuery.cxx:89–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void vtkCellGridSampleQuery::StartPass()
90{
91 this->Superclass::StartPass();
92 if (this->Pass == PassType::GenerateOutputs)
93 {
94 // Turn OutputOffsets into a cumulative sum.
95 vtkIdType next = 0;
96 for (auto& entry : this->OutputOffsets)
97 {
98 vtkIdType curr = next;
99 next += entry.second;
100 entry.second = curr;
101 }
102 // Before we allocate table rows, make sure the cell-site array
103 // has the proper number of components (or remove it if unused).
104 if (this->MaximumParametricDimension)
105 {
106 if (this->SourceCellSite)
107 {
108 this->SourceCellSite->SetNumberOfComponents(this->MaximumParametricDimension);
109 }
110 }
111 else
112 {
113 if (this->SourceCellSite)
114 {
115 this->Output->RemoveColumnByName("SourceCellSite");
116 this->SourceCellSite = nullptr;
117 }
118 }
119 // Allocate table rows.
120 this->Output->SetNumberOfRows(next);
121 // If we are storing source cell types, populate the array
122 // now because it is allocated and we know the offsets.
123 if (this->SourceCellType)
124 {
125 vtkStringToken hash;
126 vtkIdType prev = 0;
127 for (const auto& entry : this->OutputOffsets)
128 {
129 if (hash.IsValid() && prev != entry.second)
130 {
131 vtkSMPTools::For(prev, entry.second,
132 [hash, this](vtkIdType begin, vtkIdType end)
133 {
134 for (vtkIdType ii = begin; ii < end; ++ii)
135 {
136 this->SourceCellType->SetValue(ii, hash.GetId());
137 }
138 });
139 }
140 prev = entry.second;
141 hash = entry.first;
142 }
143 if (prev != next)
144 {
145 vtkSMPTools::For(prev, next,
146 [hash, this](vtkIdType begin, vtkIdType end)

Callers

nothing calls this directly

Calls 7

RemoveColumnByNameMethod · 0.80
SetNumberOfRowsMethod · 0.80
ForFunction · 0.50
SetNumberOfComponentsMethod · 0.45
IsValidMethod · 0.45
SetValueMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected