This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
variantSpec.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_SDF_VARIANT_SPEC_H
8#define PXR_USD_SDF_VARIANT_SPEC_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/declareSpec.h"
15#include "pxr/usd/sdf/proxyTypes.h"
16#include "pxr/usd/sdf/spec.h"
17#include <string>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
21SDF_DECLARE_HANDLES(SdfLayer);
22SDF_DECLARE_HANDLES(SdfPrimSpec);
23SDF_DECLARE_HANDLES(SdfVariantSpec);
24SDF_DECLARE_HANDLES(SdfVariantSetSpec);
25
26class SdfPath;
27
38class SdfVariantSpec : public SdfSpec
39{
40 SDF_DECLARE_SPEC(SdfVariantSpec, SdfSpec);
41
42public:
46
48 SDF_API
49 static SdfVariantSpecHandle New(const SdfVariantSetSpecHandle& owner,
50 const std::string& name);
51
53
56
58 SDF_API
59 std::string GetName() const;
60
62 SDF_API
64
68
70 SDF_API
71 SdfVariantSetSpecHandle GetOwner() const;
72
74 SDF_API
75 SdfPrimSpecHandle GetPrimSpec() const;
76
81 SDF_API
82 SdfVariantSetsProxy GetVariantSets() const;
83
85 SDF_API
86 std::vector<std::string> GetVariantNames(const std::string& name) const;
87
89};
90
101SDF_API SdfVariantSpecHandle SdfCreateVariantInLayer(
102 const SdfLayerHandle &layer,
103 const SdfPath &primPath,
104 const std::string &variantSetName,
105 const std::string &variantName );
106
107PXR_NAMESPACE_CLOSE_SCOPE
108
109#endif /* SDF_VARIANT_SPEC_H */
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:84
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:58
Base class for all Sdf spec classes.
Definition: spec.h:33
Represents a coherent set of alternate representations for part of a scene.
Represents a single variant in a variant set.
Definition: variantSpec.h:39
SDF_API std::string GetName() const
Returns the name of this variant.
SDF_API SdfPrimSpecHandle GetPrimSpec() const
Get the prim spec owned by this variant.
SDF_API TfToken GetNameToken() const
Returns the name of this variant.
SDF_API std::vector< std::string > GetVariantNames(const std::string &name) const
Returns list of variant names for the given variant set.
SDF_API SdfVariantSetSpecHandle GetOwner() const
Return the SdfVariantSetSpec that owns this variant.
SDF_API SdfVariantSetsProxy GetVariantSets() const
Returns the nested variant sets.
static SDF_API SdfVariantSpecHandle New(const SdfVariantSetSpecHandle &owner, const std::string &name)
Constructs a new instance.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
SDF_API SdfVariantSpecHandle SdfCreateVariantInLayer(const SdfLayerHandle &layer, const SdfPath &primPath, const std::string &variantSetName, const std::string &variantName)
Convenience function to create a variant spec for a given variant set and a prim at the given path wi...