All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bufferArrayRangeGL.h
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 HDST_BUFFER_ARRAY_RANGE_GL_H
25 #define HDST_BUFFER_ARRAY_RANGE_GL_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdSt/api.h"
29 #include "pxr/imaging/hd/version.h"
30 #include "pxr/base/tf/token.h"
31 #include "pxr/imaging/hd/bufferArrayRange.h"
32 
33 #include <boost/shared_ptr.hpp>
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 
38 class HdBufferArrayGL;
39 
40 typedef boost::shared_ptr<class HdStBufferArrayRangeGL> HdStBufferArrayRangeGLSharedPtr;
41 
43 
44 typedef boost::shared_ptr<class HdStBufferResourceGL> HdStBufferResourceGLSharedPtr;
45 typedef std::vector<
46  std::pair<TfToken, HdStBufferResourceGLSharedPtr> > HdStBufferResourceGLNamedList;
47 
57 {
58 public:
64  HDST_API
65  virtual ~HdStBufferArrayRangeGL();
66 
69  virtual HdStBufferResourceGLSharedPtr GetResource() const = 0;
70 
72  virtual HdStBufferResourceGLSharedPtr GetResource(TfToken const& name) = 0;
73 
75  virtual HdStBufferResourceGLNamedList const& GetResources() const = 0;
76 
78  HDST_API
79  virtual void GetBufferSpecs(HdBufferSpecVector *bufferSpecs) const override;
80 };
81 
82 HDST_API
83 std::ostream &operator <<(std::ostream &out,
84  const HdStBufferArrayRangeGL &self);
85 
91 {
92 public:
94  HdStBufferArrayRangeGLContainer(int size) : _ranges(size) { }
95 
98  HDST_API
99  void Set(int index, HdStBufferArrayRangeGLSharedPtr const &range);
100 
102  // is out of range or not yet set.
103  HDST_API
104  HdStBufferArrayRangeGLSharedPtr const &Get(int index) const;
105 
106 private:
107  std::vector<HdStBufferArrayRangeGLSharedPtr> _ranges;
108 };
109 
110 
111 PXR_NAMESPACE_CLOSE_SCOPE
112 
113 #endif // HD_BUFFER_ARRAY_RANGE_GL_H
HDST_API void Set(int index, HdStBufferArrayRangeGLSharedPtr const &range)
Set range into the container at index.
A resizable container of HdBufferArrayRanges.
HDST_API HdStBufferArrayRangeGLSharedPtr const & Get(int index) const
Returns the bar at index. returns null if either the index.
Interface class for representing range (subset) locator of HdBufferArray.
virtual HdStBufferResourceGLNamedList const & GetResources() const =0
Returns the list of all named GPU resources for this bufferArrayRange.
virtual HDST_API void GetBufferSpecs(HdBufferSpecVector *bufferSpecs) const override
Sets the bufferSpecs for all resources.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
Interface class for representing range (subset) locator of HdBufferArray.
virtual HdStBufferResourceGLSharedPtr GetResource() const =0
Returns the GPU resource.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
virtual HDST_API ~HdStBufferArrayRangeGL()
Destructor (do nothing).
HdStBufferArrayRangeGLContainer(int size)
Constructor.
A specific type of HdBufferResource (GPU resource) representing an OpenGL buffer object.