Loading...
Searching...
No Matches
drawItemInstance.h
1//
2// Copyright 2016 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_ST_DRAW_ITEM_INSTANCE_H
8#define PXR_IMAGING_HD_ST_DRAW_ITEM_INSTANCE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/drawItem.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16using HdSt_DrawBatchSharedPtr = std::shared_ptr<class HdSt_DrawBatch>;
17
31{
32public:
33 HDST_API
34 HdStDrawItemInstance(HdStDrawItem const *drawItem);
35 HDST_API
37
39 HDST_API
40 void SetVisible(bool visible);
41
43 bool IsVisible() const { return _visible; }
44
47 HDST_API
48 void SetBatchIndex(size_t batchIndex);
49
51 size_t GetBatchIndex() const { return _batchIndex; }
52
56 // HDST_API
57 void SetBatch(HdSt_DrawBatch *batch);
58
60 HdStDrawItem const *GetDrawItem() const { return _drawItem; }
61
62private:
64
65 HdSt_DrawBatch * _batch;
66 HdStDrawItem const * _drawItem;
67 size_t _batchIndex;
68 bool _visible;
69};
70
71
72PXR_NAMESPACE_CLOSE_SCOPE
73
74#endif // PXR_IMAGING_HD_ST_DRAW_ITEM_INSTANCE_H
75
A container to store instance state for a drawitem.
HDST_API void SetBatchIndex(size_t batchIndex)
Set index into batch list.
void SetBatch(HdSt_DrawBatch *batch)
Set the batch that will receive the DrawItemInstanceChanged callback when visibility is updated.
HdStDrawItem const * GetDrawItem() const
Return a const pointer to draw item.
size_t GetBatchIndex() const
Query batch index.
HDST_API void SetVisible(bool visible)
Set visibility state.
bool IsVisible() const
Query visibility state.