| 141 | } |
| 142 | |
| 143 | CompoundObjectPtr 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 | |
| 163 | IECore::InterpolatorDescription<IECore::Data> g_dataDescription( interpolateData ); |
| 164 | IECore::InterpolatorDescription<IECore::CompoundData> g_compoundDataDescription( interpolateCompoundData ); |