------------------------------------------------------------------------------ Free memory and return to instantiated state.
| 31 | //------------------------------------------------------------------------------ |
| 32 | // Free memory and return to instantiated state. |
| 33 | void 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. |
no test coverage detected