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

Method GetPointCells

Common/DataModel/vtkExplicitStructuredGrid.cxx:163–193  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

161
162//------------------------------------------------------------------------------
163void vtkExplicitStructuredGrid::GetPointCells(vtkIdType ptId, vtkIdList* cellIds)
164{
165 if (!this->Links)
166 {
167 this->BuildLinks();
168 }
169 cellIds->Reset();
170
171 // Use the correct cell links. Use an explicit cast for performance reasons
172 // (virtuals, and templated functions were tested to be slow -- if you make
173 // changes, please make sure to measure performance impacts).
174 vtkIdType numCells, *cells;
175 if (!this->Editable)
176 {
177 vtkStaticCellLinks* links = static_cast<vtkStaticCellLinks*>(this->Links.Get());
178 numCells = links->GetNcells(ptId);
179 cells = links->GetCells(ptId);
180 }
181 else
182 {
183 vtkCellLinks* links = static_cast<vtkCellLinks*>(this->Links.Get());
184 numCells = links->GetNcells(ptId);
185 cells = links->GetCells(ptId);
186 }
187
188 cellIds->SetNumberOfIds(numCells);
189 for (auto i = 0; i < numCells; i++)
190 {
191 cellIds->SetId(i, cells[i]);
192 }
193}
194
195//------------------------------------------------------------------------------
196vtkIdType* vtkExplicitStructuredGrid::GetCellPoints(vtkIdType cellId)

Callers

nothing calls this directly

Calls 6

BuildLinksMethod · 0.95
SetNumberOfIdsMethod · 0.80
ResetMethod · 0.45
GetMethod · 0.45
GetCellsMethod · 0.45
SetIdMethod · 0.45

Tested by

no test coverage detected