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

Method Finalize

Common/DataModel/vtkCellGridCopyQuery.cxx:85–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85bool 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
122bool vtkCellGridCopyQuery::AddSourceCellAttributeId(int attributeId)
123{

Callers

nothing calls this directly

Calls 4

SetSchemaMethod · 0.80
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected