HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
drawTargetRenderPassState.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 #ifndef PXR_IMAGING_HD_ST_DRAW_TARGET_RENDER_PASS_STATE_H
25 #define PXR_IMAGING_HD_ST_DRAW_TARGET_RENDER_PASS_STATE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdSt/api.h"
29 #include "pxr/imaging/hd/enums.h"
31 #include "pxr/usd/sdf/path.h"
32 
34 
35 
36 class VtValue;
38  std::vector<struct HdRenderPassAovBinding>;
39 
40 /// \class HdStDrawTargetRenderPassState
41 ///
42 /// Represents common non-gl context specific render pass state for a draw
43 /// target.
44 ///
45 /// \note This is a temporary API to aid transition to Storm, and is subject
46 /// to major changes. It is likely this functionality will be absorbed into
47 /// the base class.
48 ///
50 {
51 public:
52  HDST_API
54  HDST_API
55  ~HdStDrawTargetRenderPassState(); // final no need to be virtual
56 
58  return _aovBindings;
59  }
60 
61  HDST_API
62  void SetAovBindings(const HdRenderPassAovBindingVector &aovBindings);
63 
64  /// Sets the priority of values in the depth buffer.
65  /// i.e. should pixels closer or further from the camera win.
66  HDST_API
67  void SetDepthPriority(HdDepthPriority priority);
68 
69  /// Set the path to the camera to use to draw this render path from.
70  HDST_API
71  void SetCamera(const SdfPath &cameraId);
72 
73  HDST_API
74  void SetRprimCollection(HdRprimCollection const& col);
75 
76  HdDepthPriority GetDepthPriority() const { return _depthPriority; }
77 
78 
79  /// Returns the path to the camera to render from.
80  const SdfPath &GetCamera() const { return _cameraId; }
81 
82  /// Returns an increasing version number for when the collection object
83  /// is changed.
84  /// Note: This tracks the actual object and not the contents of the
85  /// collection.
86  unsigned int GetRprimCollectionVersion() const
87  {
88  return _rprimCollectionVersion;
89  }
90 
91  /// Returns the collection associated with this draw target.
93  {
94  return _rprimCollection;
95  }
96 
97 private:
98  HdRenderPassAovBindingVector _aovBindings;
99  HdDepthPriority _depthPriority;
100 
101  SdfPath _cameraId;
102 
103  HdRprimCollection _rprimCollection;
104  unsigned int _rprimCollectionVersion;
105 
106  HdStDrawTargetRenderPassState(const HdStDrawTargetRenderPassState &) = delete;
107  HdStDrawTargetRenderPassState &operator =(const HdStDrawTargetRenderPassState &) = delete;
108 };
109 
110 
112 
113 #endif // PXR_IMAGING_HD_ST_DRAW_TARGET_RENDER_PASS_STATE_H
HdDepthPriority
Definition: enums.h:237
HDST_API void SetCamera(const SdfPath &cameraId)
Set the path to the camera to use to draw this render path from.
HDST_API HdStDrawTargetRenderPassState()
HdDepthPriority GetDepthPriority() const
HDST_API void SetAovBindings(const HdRenderPassAovBindingVector &aovBindings)
Definition: path.h:290
unsigned int GetRprimCollectionVersion() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define HDST_API
Definition: api.h:40
const HdRenderPassAovBindingVector & GetAovBindings() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HDST_API void SetRprimCollection(HdRprimCollection const &col)
const SdfPath & GetCamera() const
Returns the path to the camera to render from.
const HdRprimCollection & GetRprimCollection() const
Returns the collection associated with this draw target.
HDST_API ~HdStDrawTargetRenderPassState()
std::vector< HdRenderPassAovBinding > HdRenderPassAovBindingVector
Definition: aov.h:154
Definition: value.h:164
HDST_API void SetDepthPriority(HdDepthPriority priority)