| 124 | } // end anon namespace |
| 125 | |
| 126 | VTK_ABI_NAMESPACE_BEGIN |
| 127 | //------------------------------------------------------------------------------ |
| 128 | // Normally subclasses will do this when the input and output type of the |
| 129 | // DeepCopy are the same. When they are not the same, then we use the |
| 130 | // templated code below. |
| 131 | void vtkDataArray::DeepCopy(vtkDataArray* da) |
| 132 | { |
| 133 | // Match the behavior of the old AttributeData |
| 134 | if (da == nullptr) |
| 135 | { |
| 136 | return; |
| 137 | } |
| 138 | |
| 139 | if (this != da) |
| 140 | { |
| 141 | this->Superclass::DeepCopy(da); // copy Information object |
| 142 | |
| 143 | vtkIdType numTuples = da->GetNumberOfTuples(); |
| 144 | int numComps = da->NumberOfComponents; |
| 145 | |
| 146 | this->SetNumberOfComponents(numComps); |
| 147 | this->SetNumberOfTuples(numTuples); |
| 148 | |
| 149 | if (numTuples != 0) |
| 150 | { |
| 151 | DeepCopyWorker worker; |
| 152 | if (!vtkArrayDispatch::Dispatch2::Execute(da, this, worker)) |
| 153 | { |
| 154 | // If dispatch fails, use fallback: |
| 155 | worker(da, this); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | this->SetLookupTable(nullptr); |
| 160 | if (da->LookupTable) |
| 161 | { |
| 162 | this->LookupTable = da->LookupTable->NewInstance(); |
| 163 | this->LookupTable->DeepCopy(da->LookupTable); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | this->Squeeze(); |
| 168 | } |
| 169 | VTK_ABI_NAMESPACE_END |
nothing calls this directly
no test coverage detected