| 174 | { |
| 175 | |
| 176 | ObjectPtr linearObjectInterpolation( const Object *y0, const Object *y1, double x ) |
| 177 | { |
| 178 | if( y0->typeId() != y1->typeId() ) |
| 179 | { |
| 180 | throw( Exception( "Object types don't match" ) ); |
| 181 | } |
| 182 | |
| 183 | const Registry &r = registry(); |
| 184 | |
| 185 | TypeId typeId = y0->typeId(); |
| 186 | while( typeId != InvalidTypeId ) |
| 187 | { |
| 188 | Registry::const_iterator it = r.find( typeId ); |
| 189 | if( it != r.end() ) |
| 190 | { |
| 191 | return it->second( y0, y1, x ); |
| 192 | } |
| 193 | typeId = RunTimeTyped::baseTypeId( typeId ); |
| 194 | } |
| 195 | |
| 196 | return nullptr; |
| 197 | } |
| 198 | |
| 199 | void registerInterpolator( IECore::TypeId objectType, ObjectInterpolator interpolator ) |
| 200 | { |
no test coverage detected