3 #include "SMDS_UnstructuredGrid.hxx"
7 vtkCellLinks::Link* SMDS_CellLinks::AdjustSize(vtkIdType sz)
10 vtkCellLinks::Link *newArray;
11 vtkIdType newSize = sz;
12 vtkCellLinks::Link linkInit = {0,NULL};
14 newArray = new vtkCellLinks::Link[newSize];
16 for (i=0; i<sz && i<this->Size; i++)
18 newArray[i] = this->Array[i];
21 for (i=this->Size; i < newSize ; i++)
23 newArray[i] = linkInit;
27 delete [] this->Array;
28 this->Array = newArray;
33 SMDS_CellLinks* SMDS_CellLinks::New()
35 return new SMDS_CellLinks();
38 SMDS_CellLinks::SMDS_CellLinks() : vtkCellLinks()
42 SMDS_CellLinks::~SMDS_CellLinks()
46 /*! initialize an SMDS_CellLinks instance instead of a vtkCellLinks instance
49 void SMDS_UnstructuredGrid::BuildLinks()
51 // Remove the old links if they are already built
54 this->Links->UnRegister(this);
57 this->Links = SMDS_CellLinks::New();
58 this->Links->Allocate(this->GetNumberOfPoints());
59 this->Links->Register(this);
60 this->Links->BuildLinks(this, this->Connectivity);
61 this->Links->Delete();
64 SMDS_CellLinks* SMDS_UnstructuredGrid::GetCellLinks()
66 return static_cast<SMDS_CellLinks*>(this->Links);
69 SMDS_UnstructuredGrid* SMDS_UnstructuredGrid::New()
71 return new SMDS_UnstructuredGrid();
74 SMDS_UnstructuredGrid::SMDS_UnstructuredGrid() : vtkUnstructuredGrid()
78 SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid()