HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
command.h
Go to the documentation of this file.
1 //
2 // Copyright 2021 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_IMAGING_HD_COMMAND_H
8 #define PXR_IMAGING_HD_COMMAND_H
9 
10 #include "pxr/pxr.h"
11 
12 #include "pxr/imaging/hd/api.h"
13 
14 #include "pxr/base/vt/dictionary.h"
15 #include "pxr/base/vt/value.h"
16 
17 #include "pxr/base/tf/token.h"
18 
19 #include <vector>
20 
22 
23 /// \class HdCommandArgDescriptor
24 ///
25 /// A bundle of state describing an argument to a command. See \c
26 /// HdCommandDescriptor for more information about commands.
27 ///
29 {
31 
33  const VtValue &defaultValue_)
34  : argName(argName)
35  , defaultValue(defaultValue_)
36  {}
37 
38  ///
39  /// The name of the argument
40  ///
42 
43  ///
44  /// Default value for this argument
45  ///
47 };
48 
49 using HdCommandArgDescriptors = std::vector<HdCommandArgDescriptor>;
50 
51 ///
52 /// Command arguments are a map of tokens to values
53 ///
55 
56 /// \class HdCommandDescriptor
57 ///
58 /// A bundle of state describing a "command". A command is simply a token
59 /// that can be invoked and delivered to the render delegate.
60 ///
62 {
64 
66  const TfToken &name_,
67  const std::string &description_="",
69  : commandName(name_)
70  , commandDescription(description_)
71  , commandArgs(args_)
72  {}
73 
74  ///
75  /// A token representing a command that can be invoked.
76  ///
78 
79  ///
80  /// A description of the command suitable for display in a UI for example.
81  ///
82  const std::string commandDescription;
83 
84  ///
85  /// List of arguments this command supports, may be empty.
86  ///
88 
89 };
90 
91 using HdCommandDescriptors = std::vector<HdCommandDescriptor>;
92 
93 
95 
96 #endif // PXR_IMAGING_HD_COMMAND_H
const HdCommandArgDescriptors commandArgs
Definition: command.h:87
const VtValue defaultValue
Definition: command.h:46
const TfToken commandName
Definition: command.h:77
Definition: token.h:70
std::vector< HdCommandDescriptor > HdCommandDescriptors
Definition: command.h:91
HdCommandArgDescriptor(const TfToken &argName, const VtValue &defaultValue_)
Definition: command.h:32
std::vector< HdCommandArgDescriptor > HdCommandArgDescriptors
Definition: command.h:49
const TfToken argName
Definition: command.h:41
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
const std::string commandDescription
Definition: command.h:82
HdCommandDescriptor(const TfToken &name_, const std::string &description_="", const HdCommandArgDescriptors &args_=HdCommandArgDescriptors())
Definition: command.h:65
Definition: value.h:146