All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
rprimSharedData.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_RPRIM_SHARED_DATA_H
8#define PXR_IMAGING_HD_RPRIM_SHARED_DATA_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/bufferArrayRange.h"
14#include "pxr/imaging/hd/tokens.h"
15
16#include "pxr/usd/sdf/path.h"
17
18#include "pxr/base/gf/bbox3d.h"
19#include "pxr/base/vt/array.h"
20#include "pxr/base/vt/types.h"
21
22PXR_NAMESPACE_OPEN_SCOPE
23
24using TopologyToPrimvarVector =
25 std::vector<std::pair<VtIntArray, std::vector<TfToken>>>;
26
27// HdRprimSharedData is an assortment of data being shared across HdReprs,
28// owned by HdRprim. HdDrawItem holds a const pointer to HdRprimSharedData.
29//
30// HdRprim
31// |
32// +--HdRepr(s)
33// | |
34// | +--HdDrawItem(s)-----.
35// | |
36// +--HdRprimSharedData <---'
37//
38
39struct HdRprimSharedData {
40 HdRprimSharedData(int barContainerSize)
41 : barContainer(barContainerSize)
42 , bounds()
43 , instancerLevels(0)
44 , visible(true)
45 , rprimID()
46 { }
47
48 HdRprimSharedData(int barContainerSize,
49 bool visible)
50 : barContainer(barContainerSize)
51 , bounds()
52 , instancerLevels(0)
53 , visible(visible)
54 , rprimID()
55 { }
56
57 // BufferArrayRange array
58 HdBufferArrayRangeContainer barContainer;
59
60 // Used for CPU frustum culling.
61 GfBBox3d bounds;
62
63 // The number of levels of instancing applied to this rprim.
64 int instancerLevels;
65
66 // Used for authored/delegate visibility.
67 bool visible;
68
69 // The owning Rprim's identifier.
70 SdfPath rprimID;
71
72 // Data structure containing the face-varying topologies of an rprim (mesh
73 // only) and each of the topology's associated face-varying primvar names.
74 // Used in drawing to determine which primvar uses which face-varying
75 // channel.
76 TopologyToPrimvarVector fvarTopologyToPrimvarVector;
77};
78
79
80PXR_NAMESPACE_CLOSE_SCOPE
81
82#endif // PXR_IMAGING_HD_RPRIM_SHARED_DATA_H
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
Basic type: arbitrarily oriented 3D bounding box.
Definition: bbox3d.h:67
A resizable container of HdBufferArrayRanges.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274