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

Method InsertEdge

Common/DataModel/vtkEdgeTable.cxx:280–325  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Insert the edge (p1,p2) into the table. It is the user's responsibility to check if the edge has already been inserted.

Source from the content-addressed store, hash-verified

278// Insert the edge (p1,p2) into the table. It is the user's responsibility to
279// check if the edge has already been inserted.
280vtkIdType vtkEdgeTable::InsertEdge(vtkIdType p1, vtkIdType p2)
281{
282 vtkIdType index, search;
283
284 if (p1 < p2)
285 {
286 index = p1;
287 search = p2;
288 }
289 else
290 {
291 index = p2;
292 search = p1;
293 }
294
295 if (index >= this->TableSize)
296 {
297 this->Resize(index + 1);
298 }
299
300 this->TableMaxId = std::max(index, this->TableMaxId);
301
302 if (this->Table[index] == nullptr)
303 {
304 this->Table[index] = vtkIdList::New();
305 this->Table[index]->Allocate(6, 12);
306 if (this->StoreAttributes == 1)
307 {
308 if (this->Attributes[index])
309 {
310 this->Attributes[index]->Delete();
311 }
312 this->Attributes[index] = vtkIdList::New();
313 this->Attributes[index]->Allocate(6, 12);
314 }
315 }
316
317 this->Table[index]->InsertNextId(search);
318 if (this->StoreAttributes == 1)
319 {
320 this->Attributes[index]->InsertNextId(this->NumberOfEdges);
321 }
322 this->NumberOfEdges++;
323
324 return (this->NumberOfEdges - 1);
325}
326
327//------------------------------------------------------------------------------
328void vtkEdgeTable::InsertEdge(vtkIdType p1, vtkIdType p2, vtkIdType attributeId)

Callers 15

InsertUniquePointMethod · 0.95
GenerateEdgesMethod · 0.45
TriangulateMethod · 0.45
BuildEdgesMethod · 0.45
operator()Method · 0.45
SamplePolygonMethod · 0.45
SamplePolygonMethod · 0.45
RequestDataMethod · 0.45

Calls 7

ResizeMethod · 0.95
InsertNextIdMethod · 0.80
InsertNextVoidPointerMethod · 0.80
DeleteMethod · 0.65
maxFunction · 0.50
NewFunction · 0.50
AllocateMethod · 0.45

Tested by

no test coverage detected