MCPcopy Create free account
hub / github.com/ImageEngine/cortex / interpolateCompoundObject

Function interpolateCompoundObject

src/IECore/ObjectInterpolator.cpp:143–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143CompoundObjectPtr interpolateCompoundObject( const CompoundObject *y0, const CompoundObject *y1, double x )
144{
145 CompoundObjectPtr result = y0->copy();
146 CompoundObject::ObjectMap &resultWritable = result->members();
147 const CompoundObject::ObjectMap y1Readable = y1->members();
148 for( const auto &member : y0->members() )
149 {
150 CompoundObject::ObjectMap::const_iterator it = y1Readable.find( member.first );
151 if( it != y1Readable.end() && it->second->typeId() == member.second->typeId() )
152 {
153 ObjectPtr interpolatedMember = linearObjectInterpolation( member.second.get(), it->second.get(), x );
154 if( interpolatedMember )
155 {
156 resultWritable[member.first] = interpolatedMember;
157 }
158 }
159 }
160 return result;
161}
162
163IECore::InterpolatorDescription<IECore::Data> g_dataDescription( interpolateData );
164IECore::InterpolatorDescription<IECore::CompoundData> g_compoundDataDescription( interpolateCompoundData );

Callers

nothing calls this directly

Calls 6

typeIdMethod · 0.80
copyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected