#include <InterpolatedCache.h>

Classes | |
| class | Implementation |
Public Types | |
| enum | Interpolation { None = 0, Linear, Cubic } |
| typedef std::vector < AttributeCachePtr > | CacheVector |
| 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) | |
| InterpolatedCache (const std::string &pathTemplate="", float frame=0.0, Interpolation interpolation=None, const OversamplesCalculator &o=OversamplesCalculator()) | |
| ~InterpolatedCache () | |
| void | setPathTemplate (const std::string &pathTemplate) |
| const std::string & | getPathTemplate () const |
| void | setMaxOpenFiles (size_t maxOpenFiles) |
| size_t | getMaxOpenFiles () const |
| void | setFrame (float frame) |
| float | getFrame () const |
| void | setInterpolation (Interpolation interpolation) |
| Interpolation | getInterpolation () const |
| void | setOversamplesCalculator (const OversamplesCalculator &) |
| OversamplesCalculator | getOversamplesCalculator () const |
| ObjectPtr | read (const ObjectHandle &obj, const AttributeHandle &attr) const |
| ObjectPtr | read (float frame, const ObjectHandle &obj, const AttributeHandle &attr) const |
| CompoundObjectPtr | read (const ObjectHandle &obj) const |
| CompoundObjectPtr | read (float frame, const ObjectHandle &obj) const |
| ObjectPtr | readHeader (const HeaderHandle &hdr) const |
| ObjectPtr | readHeader (float frame, const HeaderHandle &hdr) const |
| CompoundObjectPtr | readHeader () const |
| CompoundObjectPtr | readHeader (float frame) const |
| void | objects (std::vector< ObjectHandle > &objs) const |
| void | objects (float frame, std::vector< ObjectHandle > &objs) const |
| void | headers (std::vector< HeaderHandle > &hds) const |
| void | headers (float frame, std::vector< HeaderHandle > &hds) const |
| void | attributes (const ObjectHandle &obj, std::vector< AttributeHandle > &attrs) const |
| void | attributes (float frame, const ObjectHandle &obj, std::vector< AttributeHandle > &attrs) const |
| void | attributes (const ObjectHandle &obj, const std::string regex, std::vector< AttributeHandle > &attrs) const |
| void | attributes (float frame, const ObjectHandle &obj, const std::string regex, std::vector< AttributeHandle > &attrs) const |
| bool | contains (const ObjectHandle &obj) const |
| bool | contains (float frame, const ObjectHandle &obj) const |
| bool | contains (const ObjectHandle &obj, const AttributeHandle &attr) const |
| bool | contains (float frame, const ObjectHandle &obj, const AttributeHandle &attr) const |
It might be great to pass interpolation and oversamples calculator to each read method rather than have them store as state. This would allow different interpolation and oversampling per call and per thread. If we did this I think we should look at replacing the OversamplesCalculator class with some more sensible Time or TimeSampler class, and passing everything in one argument.
| typedef std::vector< AttributeCachePtr > IECore::InterpolatedCache::CacheVector |
| 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"
References IECore::ClassData< ClassTypeT, DataTypeT, DataDeletePolicyT >::create(), and setFrame().
| InterpolatedCache::InterpolatedCache | ( | const std::string & | pathTemplate = "", |
|
| float | frame = 0.0, |
|||
| Interpolation | interpolation = None, |
|||
| const OversamplesCalculator & | o = OversamplesCalculator() | |||
| ) |
References IECore::ClassData< ClassTypeT, DataTypeT, DataDeletePolicyT >::create(), and setFrame().
| InterpolatedCache::~InterpolatedCache | ( | ) |
| void 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.
| void InterpolatedCache::attributes | ( | const ObjectHandle & | obj, | |
| const std::string | regex, | |||
| std::vector< AttributeHandle > & | attrs | |||
| ) | const |
| void 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 InterpolatedCache::attributes | ( | const ObjectHandle & | obj, | |
| std::vector< AttributeHandle > & | attrs | |||
| ) | const |
| bool 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.
| bool InterpolatedCache::contains | ( | const ObjectHandle & | obj, | |
| const AttributeHandle & | attr | |||
| ) | const |
| bool 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 InterpolatedCache::contains | ( | const ObjectHandle & | obj | ) | const |
| float InterpolatedCache::getFrame | ( | ) | const |
| InterpolatedCache::Interpolation InterpolatedCache::getInterpolation | ( | ) | const |
Returns the current interpolation method.
| size_t InterpolatedCache::getMaxOpenFiles | ( | ) | const |
Returns the maximum number of caches this class will keep open at one time.
| OversamplesCalculator InterpolatedCache::getOversamplesCalculator | ( | ) | const |
Returns the current OversamplesCalculator.
| const std::string & InterpolatedCache::getPathTemplate | ( | ) | const |
Returns the current path template used to open cache files.
| void 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 InterpolatedCache::headers | ( | std::vector< HeaderHandle > & | hds | ) | const |
| IECore::InterpolatedCache::IE_CORE_DECLAREMEMBERPTR | ( | InterpolatedCache | ) |
| void 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.
| void InterpolatedCache::objects | ( | std::vector< ObjectHandle > & | objs | ) | const |
| CompoundObjectPtr 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 InterpolatedCache::read | ( | const ObjectHandle & | obj | ) | const |
| ObjectPtr 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.
| ObjectPtr InterpolatedCache::read | ( | const ObjectHandle & | obj, | |
| const AttributeHandle & | attr | |||
| ) | const |
| CompoundObjectPtr 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.
| CompoundObjectPtr InterpolatedCache::readHeader | ( | ) | const |
| ObjectPtr 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.
| ObjectPtr InterpolatedCache::readHeader | ( | const HeaderHandle & | hdr | ) | const |
| void InterpolatedCache::setFrame | ( | float | frame | ) |
Referenced by InterpolatedCache().
| void InterpolatedCache::setInterpolation | ( | InterpolatedCache::Interpolation | interpolation | ) |
Sets the interpolation method.
| void InterpolatedCache::setMaxOpenFiles | ( | size_t | maxOpenFiles | ) |
Sets the maximum number of caches this class will keep open at one time.
| void InterpolatedCache::setOversamplesCalculator | ( | const OversamplesCalculator & | oc | ) |
Sets the OversamplesCalculator.
| void InterpolatedCache::setPathTemplate | ( | const std::string & | pathTemplate | ) |
Changes the path template for cache files.
1.5.8