| 244 | } |
| 245 | |
| 246 | int frame() const override |
| 247 | { |
| 248 | const Data *d = m_variables->member( "frame" ); |
| 249 | if( !d ) |
| 250 | { |
| 251 | return 1; |
| 252 | } |
| 253 | switch( d->typeId() ) |
| 254 | { |
| 255 | case IntDataTypeId : |
| 256 | return static_cast<const IntData *>( d )->readable(); |
| 257 | case FloatDataTypeId : |
| 258 | return (int)round( static_cast<const FloatData *>( d )->readable() ); |
| 259 | default : |
| 260 | throw IECore::Exception( |
| 261 | string( "Unexpected data type \"" ) + d->typeName() + |
| 262 | "\" for frame : expected IntData or FloatData" |
| 263 | ); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | const std::string &variable( const boost::string_view &name, bool &recurse ) const override |
| 268 | { |
no test coverage detected