HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
common.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 USD_COMMON_H
25 #define USD_COMMON_H
26 
27 /// \file usd/common.h
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usd/api.h"
34 
36 #include "pxr/usd/usd/timeCode.h"
37 
38 #include <string>
39 #include <map>
40 
42 
43 // Forward declare Usd classes.
44 class UsdStage;
45 class UsdObject;
46 class UsdPrim;
47 class UsdProperty;
48 class UsdAttribute;
49 class UsdRelationship;
50 class UsdStageCache;
51 
52 class VtValue;
53 
55 typedef UsdStagePtr UsdStageWeakPtr;
56 
57 /// Return a human-readable description.
58 USD_API
60 /// \overload
61 USD_API
62 std::string UsdDescribe(const UsdStageRefPtr &);
63 /// \overload
64 USD_API
66 /// \overload
67 USD_API
69 /// \overload
70 USD_API
72 /// \overload
73 USD_API
75 
76 // XXX:
77 // Currently used for querying composed values from ascii layers, so VtValue is
78 // the optimal value-store, but this may not always be the case.
79 typedef std::map<class TfToken, VtValue,
82 
83 /// Returns true if USD uses the historical behavior of applying
84 /// the inverse of composed layer offsets to map layer time to
85 /// stage time. Respects the env setting USD_USE_INVERSE_LAYER_OFFSET.
86 USD_API
88 
89 /// Prepare the given offset for application to map layer time to
90 /// stage time, respecting the environment variable
91 /// USD_USE_INVERSE_LAYER_OFFSET.
92 ///
93 /// Typically, the supplied SdfLayerOffset will come from Pcp -- in
94 /// a PcpNodeRef or PcpLayerStack -- and represent the cumulative offset
95 /// to transform data from a layer to the Usd stage.
96 ///
97 /// Historically, USD applied the inverse of that offset, flipping
98 /// the intended semantics. To address this, this function provides a
99 /// temporary measure to control whether to take the inverse or not.
100 /// Under the new behavior this function will become a no-op,
101 /// and can eventually be phased out.
102 USD_API
104 
105 /// \enum UsdListPosition
106 ///
107 /// Specifies a position to add items to lists. Used by some Add()
108 /// methods in the USD API that manipulate lists, such as AddReference().
109 ///
111  /// The position at the front of the prepend list.
112  /// An item added at this position will, after composition is applied,
113  /// be stronger than other items prepended in this layer, and stronger
114  /// than items added by weaker layers.
116  /// The position at the back of the prepend list.
117  /// An item added at this position will, after composition is applied,
118  /// be weaker than other items prepended in this layer, but stronger
119  /// than items added by weaker layers.
121  /// The position at the front of the append list.
122  /// An item added at this position will, after composition is applied,
123  /// be stronger than other items appended in this layer, and stronger
124  /// than items added by weaker layers.
126  /// The position at the back of the append list.
127  /// An item added at this position will, after composition is applied,
128  /// be weaker than other items appended in this layer, but stronger
129  /// than items added by weaker layers.
131 };
132 
133 /// \enum UsdLoadPolicy
134 ///
135 /// Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or
136 /// not descendant prims are loaded.
137 ///
139  /// Load a prim plus all its descendants.
141  /// Load a prim by itself with no descendants.
143 };
144 
145 /// \enum UsdSchemaType
146 ///
147 /// An enum representing which type of schema a given schema class belongs to
148 ///
149 enum class UsdSchemaType {
150  /// Represents abstract or base schema types that are interface-only
151  /// and cannot be instantiated. These are reserved for core base classes
152  /// known to the usdGenSchema system, so this should never be assigned to
153  /// generated schema classes.
154  AbstractBase,
155  /// Represents a non-concrete typed schema
157  /// Represents a concrete typed schema
159  /// Non-applied API schema
161  /// Single Apply API schema
163  /// Multiple Apply API Schema
165 
166 };
167 
169 
170 #endif
#define USD_API
Definition: api.h:40
UsdListPosition
Definition: common.h:110
Load a prim plus all its descendants.
Definition: common.h:140
USD_API SdfLayerOffset UsdPrepLayerOffset(SdfLayerOffset offset)
TF_DECLARE_WEAK_AND_REF_PTRS(UsdStage)
Represents a concrete typed schema.
USD_API std::string UsdDescribe(const UsdObject &)
Return a human-readable description.
Definition: token.h:89
USD_API bool UsdUsesInverseLayerOffset()
std::map< class TfToken, VtValue, TfDictionaryLessThan > UsdMetadataValueMap
Definition: common.h:81
Multiple Apply API Schema.
Non-applied API schema.
Load a prim by itself with no descendants.
Definition: common.h:142
UsdSchemaType
Definition: common.h:149
Definition: prim.h:131
Single Apply API schema.
Represents a non-concrete typed schema.
UsdStagePtr UsdStageWeakPtr
Definition: common.h:55
GLsizei const GLchar *const * string
Definition: glew.h:1844
UsdLoadPolicy
Definition: common.h:138
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
Definition: value.h:182
GLintptr offset
Definition: glew.h:1682