Cortex  10.0.0-a4
Public Member Functions | List of all members
IECore::SampledSceneInterface Class Referenceabstract

#include <SampledSceneInterface.h>

+ Inheritance diagram for IECore::SampledSceneInterface:

Public Member Functions

 IE_CORE_DECLARERUNTIMETYPED (SampledSceneInterface, SceneInterface)
 
virtual size_t numBoundSamples () const =0
 Returns the number of bounding box samples are available for reading.
 
virtual size_t numTransformSamples () const =0
 Returns the number of transform samples are available for reading.
 
virtual size_t numAttributeSamples (const SceneInterface::Name &name) const =0
 Returns the number of attribute samples are available for reading.
 
virtual size_t numObjectSamples () const =0
 Returns the number of object samples are available for reading.
 
virtual double boundSampleTime (size_t sampleIndex) const =0
 Returns the time associated with the specified bounding box sample.
 
virtual double transformSampleTime (size_t sampleIndex) const =0
 Returns the time associated with the specified transform sample.
 
virtual double attributeSampleTime (const SceneInterface::Name &name, size_t sampleIndex) const =0
 Returns the time associated with the specified attribute sample.
 
virtual double objectSampleTime (size_t sampleIndex) const =0
 Returns the time associated with the specified object sample.
 
virtual Imath::Box3d readBoundAtSample (size_t sampleIndex) const =0
 Returns the local bounding box of this node stored for the specified sample.
 
virtual ConstDataPtr readTransformAtSample (size_t sampleIndex) const =0
 Returns the transform applied to this path within the scene.
 
virtual Imath::M44d readTransformAsMatrixAtSample (size_t sampleIndex) const =0
 Returns the transform applied to this path within the scene as a matrix.
 
virtual ConstObjectPtr readAttributeAtSample (const SceneInterface::Name &name, size_t sampleIndex) const =0
 Reads the named attribute applied to this path within the scene.
 
virtual ConstObjectPtr readObjectAtSample (size_t sampleIndex) const =0
 
virtual double boundSampleInterval (double time, size_t &floorIndex, size_t &ceilIndex) const =0
 Computes a sample interval suitable for use in producing interpolated bounding box values.
 
virtual double transformSampleInterval (double time, size_t &floorIndex, size_t &ceilIndex) const =0
 Computes a sample interval suitable for use in producing interpolated transform values.
 
virtual double attributeSampleInterval (const SceneInterface::Name &name, double time, size_t &floorIndex, size_t &ceilIndex) const =0
 Computes a sample interval suitable for use in producing interpolated attribute values.
 
virtual double objectSampleInterval (double time, size_t &floorIndex, size_t &ceilIndex) const =0
 Computes a sample interval suitable for use in producing interpolated objects.
 
Imath::Box3d readBound (double time) const override
 
ConstDataPtr readTransform (double time) const override
 
Imath::M44d readTransformAsMatrix (double time) const override
 
ConstObjectPtr readAttribute (const Name &name, double time) const override
 Returns the attribute value at the given time.
 
ConstObjectPtr readObject (double time) const override
 Reads the object stored at this path in the scene at the given time.
 
- Public Member Functions inherited from IECore::SceneInterface
 IE_CORE_DECLARERUNTIMETYPED (SceneInterface, RunTimeTyped)
 
virtual std::string fileName () const =0
 Returns the file that this scene is mapped to. Throws exception if there's no file.
 
virtual Name name () const =0
 Returns the name of the scene location which this instance is referring to. The root path returns "/".
 
virtual void path (Path &p) const =0
 Returns the path scene this instance is referring to.
 
virtual bool hasBound () const
 
virtual void writeBound (const Imath::Box3d &bound, double time)=0
 
virtual void writeTransform (const Data *transform, double time)=0
 
virtual bool hasAttribute (const Name &name) const =0
 Convenience method to determine if an attribute exists without reading it.
 
virtual void attributeNames (NameList &attrs) const =0
 Fills attrs with the names of all attributes available in the current directory.
 
virtual void writeAttribute (const Name &name, const Object *attribute, double time)=0
 
virtual bool hasTag (const Name &name, int filter=LocalTag) const =0
 
virtual void readTags (NameList &tags, int filter=LocalTag) const =0
 
virtual void writeTags (const NameList &tags)=0
 Adds tags to the current scene location.
 
virtual bool hasObject () const =0
 Convenience method to determine if a piece of geometry exists without reading it.
 
virtual PrimitiveVariableMap readObjectPrimitiveVariables (const std::vector< InternedString > &primVarNames, double time) const =0
 
virtual void writeObject (const Object *object, double time)=0
 
virtual bool hasChild (const Name &name) const =0
 Convenience method to determine if a child exists.
 
virtual void childNames (NameList &childNames) const =0
 
virtual SceneInterfacePtr child (const Name &name, MissingBehaviour missingBehaviour=ThrowIfMissing)=0
 
virtual ConstSceneInterfacePtr child (const Name &name, MissingBehaviour missingBehaviour=ThrowIfMissing) const =0
 Returns a read-only interface for a child location in the scene.
 
virtual SceneInterfacePtr createChild (const Name &name)=0
 
virtual SceneInterfacePtr scene (const Path &path, MissingBehaviour missingBehaviour=ThrowIfMissing)=0
 Returns a interface for querying the scene at the given path (full path).
 
virtual ConstSceneInterfacePtr scene (const Path &path, MissingBehaviour missingBehaviour=ThrowIfMissing) const =0
 Returns a const interface for querying the scene at the given path (full path).
 
virtual void hash (HashType hashType, double time, MurmurHash &h) const
 
- Public Member Functions inherited from IECore::RunTimeTyped
 IE_CORE_DECLAREMEMBERPTR (RunTimeTyped)
 
virtual TypeId typeId () const
 
virtual const char * typeName () const
 
virtual bool isInstanceOf (TypeId typeId) const
 
virtual bool isInstanceOf (const char *typeName) const
 
- Public Member Functions inherited from IECore::RefCounted
 IE_CORE_DECLAREMEMBERPTR (RefCounted)
 
void addRef () const
 Add a reference to the current object.
 
void removeRef () const
 Remove a reference from the current object.
 
RefCount refCount () const
 Returns the current reference count.
 

Additional Inherited Members

- Public Types inherited from IECore::SceneInterface
enum  MissingBehaviour { ThrowIfMissing = IndexedIO::ThrowIfMissing, NullIfMissing = IndexedIO::NullIfMissing, CreateIfMissing = IndexedIO::CreateIfMissing }
 
enum  TagFilter { DescendantTag = 1, LocalTag = 2, AncestorTag = 4, EveryTag = DescendantTag | LocalTag | AncestorTag }
 
enum  HashType {
  TransformHash, AttributesHash, BoundHash, ObjectHash,
  ChildNamesHash, HierarchyHash
}
 
typedef IndexedIO::EntryID Name
 
typedef IndexedIO::EntryIDList NameList
 
typedef IndexedIO::EntryIDList Path
 
- Public Types inherited from IECore::RunTimeTyped
typedef RefCounted BaseClass
 A typedef for the class this class derives from. All RunTimeTyped classes define this typedef.
 
- Public Types inherited from IECore::RefCounted
typedef size_t RefCount
 
- Static Public Member Functions inherited from IECore::SceneInterface
static SceneInterfacePtr create (const std::string &path, IndexedIO::OpenMode mode)
 
static std::vector< std::string > supportedExtensions (IndexedIO::OpenMode modes=IndexedIO::Read|IndexedIO::Write|IndexedIO::Append)
 
static void pathToString (const Path &p, std::string &path)
 Converts a internal Path to a path-like string. The root path results in "/".
 
static void stringToPath (const std::string &path, Path &p)
 
- Static Public Member Functions inherited from IECore::RunTimeTyped
static TypeId staticTypeId ()
 Returns the TypeId for this class, without needing an instance.
 
static const char * staticTypeName ()
 Returns the type name for this class, without needing an instance.
 
static TypeId baseTypeId ()
 
static const char * baseTypeName ()
 
static bool inheritsFrom (TypeId typeId)
 Returns true if this class inherits from the specified type.
 
static bool inheritsFrom (const char *typeName)
 Returns true if this class inherits from the specified type.
 
static bool inheritsFrom (TypeId type, TypeId baseType)
 Returns true if type inherits from baseType.
 
static bool inheritsFrom (const char *typeName, const char *baseTypeName)
 Returns true if typeName inherits from baseTypeName.
 
static TypeId baseTypeId (TypeId typeId)
 Returns the base type of the given type, or InvalidTypeId if no such base exists.
 
static const std::vector< TypeId > & baseTypeIds (TypeId typeId)
 
static const std::set< TypeId > & derivedTypeIds (TypeId typeId)
 
static TypeId typeIdFromTypeName (const char *typeName)
 
static const char * typeNameFromTypeId (TypeId typeId)
 
static void registerType (TypeId derivedTypeId, const char *derivedTypeName, TypeId baseTypeId)
 Allows external modules to register their own type ids.
 
- Static Public Attributes inherited from IECore::SceneInterface
static const NamerootName
 Constant name assigned to the root location "/".
 
static const Path & rootPath
 Utility variable that can be used anytime you want to refer to the root path in the Scene.
 
static const NamevisibilityName
 Name of the visibility attribute.
 
- Protected Types inherited from IECore::SceneInterface
typedef SceneInterfacePtr(* CreatorFn) (const std::string &, IndexedIO::OpenMode)
 
- Protected Types inherited from IECore::RunTimeTyped
typedef std::map< TypeId, TypeIdBaseTypeRegistryMap
 
typedef std::map< TypeId, std::vector< TypeId > > BaseTypesRegistryMap
 
typedef std::map< TypeId, std::set< TypeId > > DerivedTypesRegistryMap
 
typedef tbb::spin_rw_mutex Mutex
 
typedef std::map< TypeId, std::string > TypeIdsToTypeNamesMap
 
typedef std::map< std::string, TypeIdTypeNamesToTypeIdsMap
 
- Static Protected Member Functions inherited from IECore::SceneInterface
static CreatorMap & fileCreators ()
 
static void registerCreator (const std::string &extension, IndexedIO::OpenMode modes, CreatorFn f)
 
- Static Protected Member Functions inherited from IECore::RunTimeTyped
static BaseTypeRegistryMap & baseTypeRegistry ()
 
static DerivedTypesRegistryMap & derivedTypesRegistry ()
 
static BaseTypesRegistryMap & completeBaseTypesRegistry ()
 
static DerivedTypesRegistryMap & completeDerivedTypesRegistry ()
 
static void derivedTypeIdsWalk (TypeId typeId, std::set< TypeId > &)
 
static TypeIdsToTypeNamesMap & typeIdsToTypeNames ()
 
static TypeNamesToTypeIdsMap & typeNamesToTypeIds ()
 
- Static Protected Attributes inherited from IECore::RunTimeTyped
static Mutex g_baseTypeIdsMutex
 
static Mutex g_derivedTypeIdsMutex
 

Detailed Description

A pure virtual base class for navigating a hierarchical sampled-animated 3D scene. The calls to the base class functions readFoo() will return interpolated values from the stored sampled data. They may return the closest sample if the object cannot be interpolated. The functions numFooSamples() can be used in combination with fooSampleTime() and readFooAtSample() to read the exact stored samples without interpolation. The functions fooSampleInterval should be used when the interpolation provided by the functions readFoo are not suitable. These functions return the two closest samples that enclose the given time and also return the appropriate lerp factor between the two samples. In the case of time falling outside of the sample range, or coinciding nearly exactly with a single sample, 0 is returned and floorIndex==ceilIndex will hold.

Member Function Documentation

Imath::Box3d IECore::SampledSceneInterface::readBound ( double  time) const
overridevirtual

Implementations of base class methods

These are implemented using the read*AtSample() and sample*Interval() methods above. Derived classes may reimplement them again, but typically this should not be necessary.

Implements IECore::SceneInterface.

virtual ConstObjectPtr IECore::SampledSceneInterface::readObjectAtSample ( size_t  sampleIndex) const
pure virtual

Reads the object stored at this path in the scene - may return 0 when no object has been stored.

Implemented in IECore::LinkedScene, and IECore::SceneCache.

ConstDataPtr IECore::SampledSceneInterface::readTransform ( double  time) const
overridevirtual

Returns the interpolated transform object of this node at the specified point in time.

Implements IECore::SceneInterface.

Imath::M44d IECore::SampledSceneInterface::readTransformAsMatrix ( double  time) const
overridevirtual

Implemented using readTransform() rather than readTransformMatrixAtSample(), as it potentially provides improved interpolation.

Implements IECore::SceneInterface.


The documentation for this class was generated from the following file: