HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
selectionsSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2022 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_IMAGING_HD_SELECTIONS_SCHEMA_H
9 #define PXR_IMAGING_HD_SELECTIONS_SCHEMA_H
10 
11 #include "pxr/imaging/hd/api.h"
12 
15 
17 
18 class HdSelectionSchema;
19 
20 //-----------------------------------------------------------------------------
21 
22 #define HDSELECTIONS_SCHEMA_TOKENS \
23  (selections) \
24 
25 TF_DECLARE_PUBLIC_TOKENS(HdSelectionsSchemaTokens, HD_API,
27 
28 //-----------------------------------------------------------------------------
29 
30 class HdSelectionsSchema : public HdSchemaBasedVectorSchema<HdSelectionSchema>
31 {
32 public:
33  HdSelectionsSchema(HdVectorDataSourceHandle const &vector)
34  : HdSchemaBasedVectorSchema(vector) {}
35 
36  /// Retrieves a vector data source with the schema's default name token
37  /// "selections" from the parent vector and constructs a
38  /// HdSelectionsSchema instance.
39  /// Because the requested vector data source may not exist, the result
40  /// should be checked with IsDefined() or a bool comparison before use.
41  HD_API
43  const HdContainerDataSourceHandle &fromParentContainer);
44 
45  /// Returns a token where the container representing this schema is found in
46  /// a container by default.
47  HD_API
48  static const TfToken &GetSchemaToken();
49 
50  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
51  /// where the vector data source representing this schema is found by
52  /// default.
53  HD_API
54  static const HdDataSourceLocator &GetDefaultLocator();
55 };
56 
58 
59 #endif
#define HD_API
Definition: api.h:23
#define HDSELECTIONS_SCHEMA_TOKENS
Definition: token.h:70
HdSelectionsSchema(HdVectorDataSourceHandle const &vector)
static HD_API HdSelectionsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
static HD_API const TfToken & GetSchemaToken()
static HD_API const HdDataSourceLocator & GetDefaultLocator()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
TF_DECLARE_PUBLIC_TOKENS(HdSelectionsSchemaTokens, HD_API, HDSELECTIONS_SCHEMA_TOKENS)