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

Function interpolateCompoundData

src/IECore/ObjectInterpolator.cpp:121–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121CompoundDataPtr interpolateCompoundData( const CompoundData *y0, const CompoundData *y1, double x )
122{
123 CompoundDataPtr result = y0->copy();
124 CompoundDataMap &resultWritable = result->writable();
125 const CompoundDataMap y1Readable = y1->readable();
126 for( const auto &member : y0->readable() )
127 {
128 CompoundDataMap::const_iterator it = y1Readable.find( member.first );
129 if( it != y1Readable.end() && it->second->typeId() == member.second->typeId() )
130 {
131 DataPtr interpolatedMember = boost::static_pointer_cast<Data>(
132 linearObjectInterpolation( member.second.get(), it->second.get(), x )
133 );
134 if( interpolatedMember )
135 {
136 resultWritable[member.first] = interpolatedMember;
137 }
138 }
139 }
140 return result;
141}
142
143CompoundObjectPtr interpolateCompoundObject( const CompoundObject *y0, const CompoundObject *y1, double x )
144{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected