24 #ifndef PXR_USD_SDF_FILE_FORMAT_H
25 #define PXR_USD_SDF_FILE_FORMAT_H
30 #include "pxr/usd/ar/ar.h"
31 #include "pxr/usd/sdf/api.h"
37 #include "pxr/base/tf/type.h"
44 PXR_NAMESPACE_OPEN_SCOPE
55 #define SDF_FILE_FORMAT_TOKENS \
56 ((TargetArg, "target"))
115 const std::string& resolvedPath)
const;
132 virtual SdfAbstractDataRefPtr
138 const std::string &identifier,
139 const std::string &realPath,
148 SDF_API
bool LayersAreFileBased()
const;
182 const std::string& file)
const = 0;
197 const std::string& resolvedPath,
198 bool metadataOnly)
const = 0;
207 const std::string& filePath,
208 const std::string& comment = std::string(),
217 const std::string& str)
const;
222 const SdfSpecHandle &spec,
224 size_t indent)
const;
233 const std::string& comment = std::string())
const;
263 static SdfFileFormatConstPtr
FindById(
277 const std::string& path,
278 const std::string& target = std::string());
288 const std::string& path,
297 const std::string& extension);
305 const std::string& extension,
313 const std::string& extension,
321 const std::vector<std::string> &extensions);
329 const std::vector<std::string> &extensions,
337 const std::vector<std::string> &extensions,
355 SdfLayer* layer, SdfAbstractDataRefPtr& data);
363 SdfLayer* layer, SdfAbstractDataRefPtr& data,
372 virtual SdfLayer *_InstantiateNewLayer(
373 const SdfFileFormatConstPtr &fileFormat,
374 const std::string &identifier,
375 const std::string &realPath,
382 virtual bool _ShouldSkipAnonymousReload()
const;
389 virtual bool _LayersAreFileBased()
const;
403 const std::string _cookie;
405 const std::vector<std::string> _extensions;
406 const bool _isPrimaryFormat;
412 virtual SdfFileFormatRefPtr New()
const = 0;
416 template <
typename T>
417 class Sdf_FileFormatFactory :
public Sdf_FileFormatFactoryBase {
419 virtual SdfFileFormatRefPtr New()
const
421 return TfCreateRefPtr(
new T);
447 #define SDF_DEFINE_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
449 #define SDF_DEFINE_FILE_FORMAT(...) SdfDefineFileFormat<__VA_ARGS__>()
451 template <
class FileFormat,
class ...BaseFormats>
452 void SdfDefineFileFormat()
455 .
template SetFactory<Sdf_FileFormatFactory<FileFormat>>();
481 #define SDF_DEFINE_ABSTRACT_FILE_FORMAT(FileFormatClass, BaseClass1, ...)
483 #define SDF_DEFINE_ABSTRACT_FILE_FORMAT(...) \
484 SdfDefineAbstractFileFormat<__VA_ARGS__>()
486 template <
class FileFormat,
class ...BaseFormats>
487 void SdfDefineAbstractFileFormat()
511 #define SDF_FILE_FORMAT_FACTORY_ACCESS
513 #define SDF_FILE_FORMAT_FACTORY_ACCESS \
514 template<typename T> friend class Sdf_FileFormatFactory
517 PXR_NAMESPACE_CLOSE_SCOPE
A unit of scene description that you combine with other units of scene description to form a shot...
Standard pointer typedefs.
Generic class that provides information about scene description fields but doesn't actually provide a...
Base class for all Sdf spec classes.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Base class of all factory types.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
A type-list of C++ base types.
static TfType const & Define()
Define a TfType with the given C++ type T and C++ base types B.
This file defines some macros that are useful for declaring and using static TfTokens.
Contains hints about layer contents that may be used to accelerate certain composition operations...
Enable a concrete base class for use with TfWeakPtr.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Interface for scene description data storage.
Contains information about a resolved asset.