Loading...
Searching...
No Matches
drawItem.h
1//
2// Copyright 2016 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_DRAW_ITEM_H
25#define PXR_IMAGING_HD_DRAW_ITEM_H
26
27#include "pxr/pxr.h"
28#include "pxr/imaging/hd/api.h"
29#include "pxr/imaging/hd/version.h"
30#include "pxr/imaging/hd/perfLog.h"
31#include "pxr/imaging/hd/drawingCoord.h"
32#include "pxr/imaging/hd/rprimSharedData.h"
33
34#include "pxr/imaging/hf/perfLog.h"
35
37#include "pxr/base/gf/bbox3d.h"
38#include "pxr/base/gf/vec2i.h"
39
40PXR_NAMESPACE_OPEN_SCOPE
41
42
65{
66public:
67 HF_MALLOC_TAG_NEW("new HdDrawItem");
68
69 HD_API
70 HdDrawItem(HdRprimSharedData const *sharedData);
71
72 HD_API
73 virtual ~HdDrawItem();
74
75 SdfPath const &GetRprimID() const { return _sharedData->rprimID; }
76
77 GfBBox3d const & GetBounds() const { return _sharedData->bounds; }
78
79 GfRange3d const& GetExtent() const {
80 return _sharedData->bounds.GetRange();
81 }
82
83 GfMatrix4d const& GetMatrix() const {
84 return _sharedData->bounds.GetMatrix();
85 }
86
87 HdDrawingCoord *GetDrawingCoord() {
88 return &_drawingCoord;
89 }
90
92 bool GetVisible() const { return _sharedData->visible; }
93
94 TfToken const& GetMaterialTag() const {
95 return _materialTag;
96 }
97
98 void SetMaterialTag(TfToken const &materialTag) {
99 _materialTag = materialTag;
100 }
101
102protected:
105 return _drawingCoord;
106 }
107
109 HdRprimSharedData const *_GetSharedData() const {
110 return _sharedData;
111 }
112
113private:
114 // configuration of how to bundle the drawing coordinate for this draw item
115 // out of BARs in sharedData
116 HdDrawingCoord _drawingCoord;
117
118 // pointer to shared data across reprs, owned by rprim:
119 // bufferArrayRanges, bounds, visibility
120 HdRprimSharedData const *_sharedData;
121
126 TfToken _materialTag;
127};
128
129
130PXR_NAMESPACE_CLOSE_SCOPE
131
132#endif //PXR_IMAGING_HD_DRAW_ITEM_H
Basic type: arbitrarily oriented 3D bounding box.
Definition: bbox3d.h:84
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
Basic type: 3-dimensional floating point range.
Definition: range3d.h:64
A draw item is a light-weight representation of an HdRprim's resources and material to be used for re...
Definition: drawItem.h:65
bool GetVisible() const
Returns the authored visibility, expressed by the delegate.
Definition: drawItem.h:92
HdRprimSharedData const * _GetSharedData() const
Returns the shared data.
Definition: drawItem.h:109
HdDrawingCoord const & _GetDrawingCoord() const
Returns the drawingCoord.
Definition: drawItem.h:104
A tiny set of integers, which provides an indirection mapping from the conceptual space of an HdRprim...
Definition: drawingCoord.h:83
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88