HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compExtCompInputSource.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 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 
25 #ifndef PXR_IMAGING_HD_COMP_EXT_COMP_INPUT_SOURCE_H
26 #define PXR_IMAGING_HD_COMP_EXT_COMP_INPUT_SOURCE_H
27 
28 #include "pxr/pxr.h"
29 #include "pxr/imaging/hd/api.h"
30 #include "pxr/imaging/hd/version.h"
32 
33 #include <memory>
34 
36 
38 
40  std::shared_ptr<HdExtCompCpuComputation>;
41 
42 ///
43 /// An Hd Buffer Source Computation that is used to bind an ExtComputation input
44 /// to a specific output of another ExtComputation.
45 ///
47 public:
48  /// Constructs the computation, binding inputName to sourceOutputName
49  /// on buffer source representation of the source computation.
50  HD_API
51  Hd_CompExtCompInputSource(const TfToken &inputName,
53  const TfToken &sourceOutputName);
54 
55  HD_API
56  virtual ~Hd_CompExtCompInputSource() = default;
57 
58  /// Returns true once the source computation has been resolved.
59  HD_API
60  virtual bool Resolve() override;
61 
62  /// Obtains the value of the output from the source computation.
63  HD_API
64  virtual const VtValue &GetValue() const override;
65 
66 protected:
67  /// Returns true if the binding is successful.
68  virtual bool _CheckValid() const override;
69 
70 private:
72  size_t _sourceOutputIdx;
73 
74  Hd_CompExtCompInputSource() = delete;
75  Hd_CompExtCompInputSource(const Hd_CompExtCompInputSource &) = delete;
76  Hd_CompExtCompInputSource &operator = (const Hd_CompExtCompInputSource &)
77  = delete;
78 };
79 
81 
82 #endif // PXR_IMAGING_HD_COMP_EXT_COMP_INPUT_SOURCE_H
#define HD_API
Definition: api.h:40
virtual bool _CheckValid() const override
Returns true if the binding is successful.
virtual HD_API ~Hd_CompExtCompInputSource()=default
Definition: token.h:87
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
std::shared_ptr< HdExtCompCpuComputation > HdExtCompCpuComputationSharedPtr
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
virtual HD_API bool Resolve() override
Returns true once the source computation has been resolved.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
virtual HD_API const VtValue & GetValue() const override
Obtains the value of the output from the source computation.
Definition: value.h:168