|
Cortex 6.0.0
|
#include <InterpolatedCache.h>
Inheritance diagram for IECore::InterpolatedCache:Public Types | |
| enum | Interpolation { None = 0, Linear, Cubic } |
|
typedef IECore::AttributeCache::ObjectHandle | ObjectHandle |
|
typedef IECore::AttributeCache::HeaderHandle | HeaderHandle |
|
typedef IECore::AttributeCache::AttributeHandle | AttributeHandle |
Public Member Functions | |
| IE_CORE_DECLAREMEMBERPTR (InterpolatedCache) | |
| InterpolatedCache (const std::string &pathTemplate="", Interpolation interpolation=None, const OversamplesCalculator &o=OversamplesCalculator(), size_t maxOpenFiles=10) | |
| void | setPathTemplate (const std::string &pathTemplate) |
| const std::string & | getPathTemplate () const |
| void | setMaxOpenFiles (size_t maxOpenFiles) |
| size_t | getMaxOpenFiles () const |
| void | setInterpolation (Interpolation interpolation) |
| Interpolation | getInterpolation () const |
| void | setOversamplesCalculator (const OversamplesCalculator &) |
| const OversamplesCalculator & | getOversamplesCalculator () const |
| ObjectPtr | read (float frame, const ObjectHandle &obj, const AttributeHandle &attr) const |
| CompoundObjectPtr | read (float frame, const ObjectHandle &obj) const |
| ObjectPtr | readHeader (float frame, const HeaderHandle &hdr) const |
| CompoundObjectPtr | readHeader (float frame) const |
| void | objects (float frame, std::vector< ObjectHandle > &objs) const |
| void | headers (float frame, std::vector< HeaderHandle > &hds) const |
| void | attributes (float frame, const ObjectHandle &obj, std::vector< AttributeHandle > &attrs) const |
| void | attributes (float frame, const ObjectHandle &obj, const std::string regex, std::vector< AttributeHandle > &attrs) const |
| bool | contains (float frame, const ObjectHandle &obj) const |
| bool | contains (float frame, const ObjectHandle &obj, const AttributeHandle &attr) const |
Provides higher level access to cache files by automatically interpolating data from multiple files. Or returns the data from the nearest frame if the data cannot be interpolated. The interface looks like AttributeCache reader functions.
| IECore::InterpolatedCache::InterpolatedCache | ( | const std::string & | pathTemplate = "", |
| Interpolation | interpolation = None, |
||
| const OversamplesCalculator & | o = OversamplesCalculator(), |
||
| size_t | maxOpenFiles = 10 |
||
| ) |
Constructor pathTemplate must be a valid FileSequence filename specifier, e.g. "myCacheFile.####.cob"
| void IECore::InterpolatedCache::attributes | ( | float | frame, |
| const ObjectHandle & | obj, | ||
| std::vector< AttributeHandle > & | attrs | ||
| ) | const |
Retrieve the list of attribute handles from the specified objects. Throws an exception if the object is not within the cache or the cache file is not found.
| void IECore::InterpolatedCache::attributes | ( | float | frame, |
| const ObjectHandle & | obj, | ||
| const std::string | regex, | ||
| std::vector< AttributeHandle > & | attrs | ||
| ) | const |
Retrieve the list of attribute handles that match the given regex from the specified objects. Throws an exception if the object is not within the cache or the cache file is not found.
| bool IECore::InterpolatedCache::contains | ( | float | frame, |
| const ObjectHandle & | obj | ||
| ) | const |
Determines whether or not the cache contains the specified object Throws an exception if the cache file is not found.
| bool IECore::InterpolatedCache::contains | ( | float | frame, |
| const ObjectHandle & | obj, | ||
| const AttributeHandle & | attr | ||
| ) | const |
Determines whether or not the cache contains the specified object and attribute Throws an exception if the cache file is not found.
| Interpolation IECore::InterpolatedCache::getInterpolation | ( | ) | const |
Returns the current interpolation method.
| size_t IECore::InterpolatedCache::getMaxOpenFiles | ( | ) | const |
Returns the maximum number of caches this class will keep open at one time.
| const OversamplesCalculator& IECore::InterpolatedCache::getOversamplesCalculator | ( | ) | const |
Returns the current OversamplesCalculator.
| const std::string& IECore::InterpolatedCache::getPathTemplate | ( | ) | const |
Returns the current path template used to open cache files.
| void IECore::InterpolatedCache::headers | ( | float | frame, |
| std::vector< HeaderHandle > & | hds | ||
| ) | const |
Retrieve the list of header handles from the cache (from the nearest frame). Throws an exception if the cache file is not found.
| void IECore::InterpolatedCache::objects | ( | float | frame, |
| std::vector< ObjectHandle > & | objs | ||
| ) | const |
Retrieve the list of object handles from the cache Throws an exception if the cache file is not found.
| ObjectPtr IECore::InterpolatedCache::read | ( | float | frame, |
| const ObjectHandle & | obj, | ||
| const AttributeHandle & | attr | ||
| ) | const |
Read a piece of data associated with the specified object and attribute from the cache. Throws an exception if the requested data is not present in the cache or if the cache file is not found.
| CompoundObjectPtr IECore::InterpolatedCache::read | ( | float | frame, |
| const ObjectHandle & | obj | ||
| ) | const |
Read a piece of data associated with the specified object from the cache. Returns a CompoundObject with attribute as keys. Throws an exception if the requested data is not present in the cache or if the cache file is not found.
| CompoundObjectPtr IECore::InterpolatedCache::readHeader | ( | float | frame | ) | const |
Creates a CompoundObject with the header names as keys. Read all header data present in the open cache files. The result will be interpolated whenever possible. Objects not existent in every opened file will not be interpolated and will be returned if they come from the nearest frame. Throws an exception if the cache file is not found.
| ObjectPtr IECore::InterpolatedCache::readHeader | ( | float | frame, |
| const HeaderHandle & | hdr | ||
| ) | const |
Read data associated with the specified header from the open cache files. The result will be interpolated whenever possible. Objects not existent in every opened file will not be interpolated and will be returned if they come from the nearest frame. Throws an exception if the requested header is not present in the cache or if the cache file is not found.
| void IECore::InterpolatedCache::setInterpolation | ( | Interpolation | interpolation | ) |
Sets the interpolation method.
| void IECore::InterpolatedCache::setMaxOpenFiles | ( | size_t | maxOpenFiles | ) |
Sets the maximum number of caches this class will keep open at one time.
| void IECore::InterpolatedCache::setOversamplesCalculator | ( | const OversamplesCalculator & | ) |
Sets the OversamplesCalculator.
| void IECore::InterpolatedCache::setPathTemplate | ( | const std::string & | pathTemplate | ) |
Changes the path template for cache files.
1.7.3