Loading...
Searching...
No Matches
variantSetSpec.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_SDF_VARIANT_SET_SPEC_H
25#define PXR_USD_SDF_VARIANT_SET_SPEC_H
26
28
29#include "pxr/pxr.h"
30#include "pxr/usd/sdf/api.h"
31#include "pxr/usd/sdf/declareSpec.h"
32#include "pxr/usd/sdf/spec.h"
33#include "pxr/usd/sdf/proxyTypes.h"
34#include "pxr/usd/sdf/types.h"
35
36#include <iosfwd>
37#include <map>
38#include <string>
39#include <vector>
40
41PXR_NAMESPACE_OPEN_SCOPE
42
63{
64 SDF_DECLARE_SPEC(SdfVariantSetSpec, SdfSpec);
65
66public:
70
72 SDF_API
73 static SdfVariantSetSpecHandle
74 New(const SdfPrimSpecHandle& prim, const std::string& name);
75
77 SDF_API
78 static SdfVariantSetSpecHandle
79 New(const SdfVariantSpecHandle& prim, const std::string& name);
80
82
85
87 SDF_API
88 std::string GetName() const;
89
91 SDF_API
93
97
99 SDF_API
100 SdfSpecHandle GetOwner() const;
101
105
107 SDF_API
109
111 SDF_API
112 SdfVariantSpecHandleVector GetVariantList() const;
113
118 SDF_API
119 void RemoveVariant(const SdfVariantSpecHandle& variant);
120
122};
123
124PXR_NAMESPACE_CLOSE_SCOPE
125
126#endif // SD_VARIANTSETSPEC_H
Provides a view onto an object's children.
Definition: childrenView.h:222
Base class for all Sdf spec classes.
Definition: spec.h:50
Represents a coherent set of alternate representations for part of a scene.
SDF_API std::string GetName() const
Returns the name of this variant set.
SDF_API SdfVariantView GetVariants() const
Returns the variants as a map.
SDF_API TfToken GetNameToken() const
Returns the name of this variant set.
SDF_API SdfVariantSpecHandleVector GetVariantList() const
Returns the variants as a vector.
static SDF_API SdfVariantSetSpecHandle New(const SdfPrimSpecHandle &prim, const std::string &name)
Constructs a new instance.
SDF_API SdfSpecHandle GetOwner() const
Returns the prim or variant that this variant set belongs to.
SDF_API void RemoveVariant(const SdfVariantSpecHandle &variant)
Removes variant from the list of variants.
static SDF_API SdfVariantSetSpecHandle New(const SdfVariantSpecHandle &prim, const std::string &name)
Constructs a new instance.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Basic Sdf data types.