35 #ifndef IECORE_SCENEINTERFACE_H
36 #define IECORE_SCENEINTERFACE_H
38 #include "OpenEXR/ImathBox.h"
39 #include "OpenEXR/ImathMatrix.h"
41 #include "IECore/Export.h"
42 #include "IECore/Object.h"
43 #include "IECore/Renderable.h"
44 #include "IECore/PrimitiveVariable.h"
49 IE_CORE_FORWARDDECLARE( SceneInterface );
76 typedef IndexedIO::EntryIDList NameList;
77 typedef IndexedIO::EntryIDList Path;
80 ThrowIfMissing = IndexedIO::ThrowIfMissing,
81 NullIfMissing = IndexedIO::NullIfMissing,
82 CreateIfMissing = IndexedIO::CreateIfMissing
89 EveryTag = DescendantTag | LocalTag | AncestorTag
117 static SceneInterfacePtr create(
const std::string &path, IndexedIO::OpenMode mode);
121 static std::vector<std::string> supportedExtensions( IndexedIO::OpenMode modes = IndexedIO::Read|IndexedIO::Write|IndexedIO::Append );
133 static SceneInterfacePtr creator(
const std::string &fileName, IndexedIO::OpenMode mode );
139 virtual std::string fileName()
const = 0;
142 virtual Name name()
const = 0;
144 virtual void path( Path &p )
const = 0;
152 virtual bool hasBound()
const;
156 virtual Imath::Box3d readBound(
double time )
const = 0;
161 virtual void writeBound(
const Imath::Box3d &bound,
double time ) = 0;
169 virtual ConstDataPtr readTransform(
double time )
const = 0;
172 virtual Imath::M44d readTransformAsMatrix(
double time )
const = 0;
176 virtual void writeTransform(
const Data *transform,
double time ) = 0;
183 virtual bool hasAttribute(
const Name &name )
const = 0;
185 virtual void attributeNames( NameList &attrs )
const = 0;
187 virtual ConstObjectPtr readAttribute(
const Name &name,
double time )
const = 0;
190 virtual void writeAttribute(
const Name &name,
const Object *attribute,
double time ) = 0;
199 virtual bool hasTag(
const Name &name,
int filter = LocalTag )
const = 0;
203 virtual void readTags( NameList &tags,
int filter = LocalTag )
const = 0;
205 virtual void writeTags(
const NameList &tags ) = 0;
212 virtual bool hasObject()
const = 0;
214 virtual ConstObjectPtr readObject(
double time )
const = 0;
217 virtual PrimitiveVariableMap readObjectPrimitiveVariables(
const std::vector<InternedString> &primVarNames,
double time )
const = 0;
220 virtual void writeObject(
const Object *
object,
double time ) = 0;
227 virtual bool hasChild(
const Name &name )
const = 0;
230 virtual void childNames( NameList &childNames )
const = 0;
237 virtual SceneInterfacePtr child(
const Name &name, MissingBehaviour missingBehaviour = ThrowIfMissing ) = 0;
239 virtual ConstSceneInterfacePtr child(
const Name &name, MissingBehaviour missingBehaviour = ThrowIfMissing )
const = 0;
243 virtual SceneInterfacePtr createChild(
const Name &name ) = 0;
245 virtual SceneInterfacePtr scene(
const Path &path, MissingBehaviour missingBehaviour = ThrowIfMissing ) = 0;
247 virtual ConstSceneInterfacePtr scene(
const Path &path, MissingBehaviour missingBehaviour = ThrowIfMissing )
const = 0;
267 static void pathToString(
const Path &p, std::string &path );
272 static void stringToPath(
const std::string &path, Path &p );
276 typedef SceneInterfacePtr (*CreatorFn)(
const std::string &, IndexedIO::OpenMode );
278 static CreatorMap &fileCreators();
279 static void registerCreator(
const std::string &extension, IndexedIO::OpenMode modes, CreatorFn f );
285 #include "IECore/SceneInterface.inl"
287 #endif // IECORE_SCENEINTERFACE_H
static const Name & rootName
Constant name assigned to the root location "/".
Definition: SceneInterface.h:104
static const Name & visibilityName
Name of the visibility attribute.
Definition: SceneInterface.h:108
Definition: MurmurHash.h:64
HashType
Definition: SceneInterface.h:94
Definition: SceneInterface.h:69
Definition: InternedString.h:55
static const Path & rootPath
Utility variable that can be used anytime you want to refer to the root path in the Scene...
Definition: SceneInterface.h:106
Definition: RunTimeTyped.h:211
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43
std::map< std::string, PrimitiveVariable > PrimitiveVariableMap
A simple type to hold named PrimitiveVariables.
Definition: PrimitiveVariable.h:107