MCPcopy Create free account
hub / github.com/Kitware/VTK / operator+

Function operator+

Common/DataModel/vtkDataSetAttributesFieldList.cxx:168–194  ·  view source on GitHub ↗

* This method merges `this` and `other` to return a new FieldInfo. */

Source from the content-addressed store, hash-verified

166 * This method merges `this` and `other` to return a new FieldInfo.
167 */
168 FieldInfo operator+(const FieldInfo& other) const
169 {
170 if (!this->IsEmpty() && this->IsSimilar(other))
171 {
172 FieldInfo result;
173 result = *this;
174 result.LUT = result.LUT ? result.LUT : other.LUT;
175 result.Information = result.Information ? result.Information : other.Information;
176
177 // merge component names.
178 assert(result.ComponentNames.size() == other.ComponentNames.size());
179 std::transform(result.ComponentNames.begin(), result.ComponentNames.end(),
180 other.ComponentNames.begin(), result.ComponentNames.begin(),
181 [](const std::string& in0, const std::string& in1) { return in0.empty() ? in1 : in0; });
182
183 assert(other.Location.size() == 1);
184 result.Location.insert(result.Location.end(), other.Location.begin(), other.Location.end());
185
186 result.AttributeTypes.insert(
187 result.AttributeTypes.end(), other.AttributeTypes.begin(), other.AttributeTypes.end());
188 return result;
189 }
190 else
191 {
192 return FieldInfo();
193 }
194 }
195
196 ///@{
197 /**

Callers

nothing calls this directly

Calls 9

FieldInfoFunction · 0.85
assertFunction · 0.50
transformFunction · 0.50
IsEmptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected