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

Method Initialize

Common/DataModel/vtkEdgeTable.cxx:33–84  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Free memory and return to instantiated state.

Source from the content-addressed store, hash-verified

31//------------------------------------------------------------------------------
32// Free memory and return to instantiated state.
33void vtkEdgeTable::Initialize()
34{
35 vtkIdType i;
36
37 if (this->Table)
38 {
39 for (i = 0; i < this->TableSize; i++)
40 {
41 if (this->Table[i])
42 {
43 this->Table[i]->Delete();
44 }
45 }
46 delete[] this->Table;
47 this->Table = nullptr;
48 this->TableMaxId = -1;
49
50 if (this->StoreAttributes == 1)
51 {
52 for (i = 0; i < this->TableSize; i++)
53 {
54 if (this->Attributes[i])
55 {
56 this->Attributes[i]->Delete();
57 }
58 }
59 delete[] this->Attributes;
60 this->Attributes = nullptr;
61 }
62 else if (this->StoreAttributes == 2)
63 {
64 for (i = 0; i < this->TableSize; i++)
65 {
66 if (this->PointerAttributes[i])
67 {
68 this->PointerAttributes[i]->Delete();
69 }
70 }
71 delete[] this->PointerAttributes;
72 this->PointerAttributes = nullptr;
73 }
74 } // if table defined
75
76 if (this->Points)
77 {
78 this->Points->Delete();
79 this->Points = nullptr;
80 }
81
82 this->TableSize = 0;
83 this->NumberOfEdges = 0;
84}
85
86//------------------------------------------------------------------------------
87// Free memory and return to instantiated state.

Callers 3

~vtkEdgeTableMethod · 0.95
InitEdgeInsertionMethod · 0.95
InitPointInsertionMethod · 0.95

Calls 1

DeleteMethod · 0.65

Tested by

no test coverage detected