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

Method BuildLinks

Common/DataModel/vtkPolyData.cxx:862–898  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Create upward links from points to cells that use each point. Enables topologically complex queries.

Source from the content-addressed store, hash-verified

860// Create upward links from points to cells that use each point. Enables
861// topologically complex queries.
862void vtkPolyData::BuildLinks(int initialSize)
863{
864 if (this->Cells == nullptr)
865 {
866 this->BuildCells();
867 }
868 if (!this->Points)
869 {
870 return;
871 }
872 if (!this->Links)
873 {
874 if (!this->Editable)
875 {
876 this->Links = vtkSmartPointer<vtkStaticCellLinks>::New();
877 }
878 else
879 {
880 this->Links = vtkSmartPointer<vtkCellLinks>::New();
881 if (initialSize > 0)
882 {
883 static_cast<vtkCellLinks*>(this->Links.Get())->Allocate(initialSize);
884 }
885 }
886 this->Links->SetDataSet(this);
887 }
888 else if (initialSize > 0 && this->Links->IsA("vtkCellLinks"))
889 {
890 static_cast<vtkCellLinks*>(this->Links.Get())->Allocate(initialSize);
891 this->Links->SetDataSet(this);
892 }
893 else if (this->Points->GetMTime() > this->Links->GetMTime())
894 {
895 this->Links->SetDataSet(this);
896 }
897 this->Links->BuildLinks();
898}
899
900//------------------------------------------------------------------------------
901// Copy a cells point ids into list provided. (Less efficient.)

Callers 6

GetPointCellsMethod · 0.95
GetCellEdgeNeighborsMethod · 0.95
GetCellNeighborsMethod · 0.95
MakeBoundaryMeshMethod · 0.45
TestStaticCellLinksFunction · 0.45

Calls 7

BuildCellsMethod · 0.95
IsAMethod · 0.80
NewFunction · 0.50
AllocateMethod · 0.45
GetMethod · 0.45
SetDataSetMethod · 0.45
GetMTimeMethod · 0.45

Tested by 1

TestStaticCellLinksFunction · 0.36