| 83 | } |
| 84 | |
| 85 | bool vtkCellGridCopyQuery::Finalize() |
| 86 | { |
| 87 | // Copy cell-attribute range caches, but only when performing shallow |
| 88 | // copies as deep copies indicate that values will likely be changed |
| 89 | // downstream. |
| 90 | if (this->CopyArrays && this->CopyArrayValues && !this->DeepCopyArrays) |
| 91 | { |
| 92 | const auto& sourceRangeCache(this->Source->GetRangeCache()); |
| 93 | auto& targetRangeCache(this->Target->GetRangeCache()); |
| 94 | for (const auto& entry : this->AttributeMap) |
| 95 | { |
| 96 | auto it = sourceRangeCache.find(entry.first); |
| 97 | if (it != sourceRangeCache.end()) |
| 98 | { |
| 99 | targetRangeCache[entry.second] = it->second; |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | this->ArrayMap.clear(); |
| 105 | this->AttributeMap.clear(); |
| 106 | |
| 107 | if (this->CopySchema) |
| 108 | { |
| 109 | this->Target->SetSchema(this->Source->GetSchemaName(), this->Source->GetSchemaVersion()); |
| 110 | } |
| 111 | |
| 112 | if (this->Source->GetContentVersion() > 0) |
| 113 | { |
| 114 | this->Target->SetContentVersion(this->Source->GetContentVersion() + 1); |
| 115 | } |
| 116 | |
| 117 | // Do not copy the integer attribute counter: |
| 118 | // this->Target->NextAttribute = this->Source->NextAttribute; |
| 119 | return true; |
| 120 | } |
| 121 | |
| 122 | bool vtkCellGridCopyQuery::AddSourceCellAttributeId(int attributeId) |
| 123 | { |