HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
coordSys.h
Go to the documentation of this file.
1 //
2 // Copyright 2019 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_COORD_SYS_H
8 #define PXR_IMAGING_HD_COORD_SYS_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/sprim.h"
14 
16 
17 /// \class HdCoordSys
18 ///
19 /// HdCoordSys representes a coordinate system as a Hydra state prim.
20 ///
21 /// Coordinate systems may be referred to by name from a shader network.
22 /// Following the convention in UsdShadeCoordSysAPI, we use the Hydra
23 /// id to establish the name, where the id is a namespaced property
24 /// path of the form <tt><.../prim.coordSys:NAME></tt>. GetName()
25 /// will retrieve the name.
26 ///
27 /// Each rprim may have a set of bound coordinate systems, which
28 /// may be retrieved via the <tt>HdTokens->coordSysBindings</tt> key.
29 /// The returned value is of type HdIdVectorSharedPtr, a reference-
30 /// counted pointer to a vector of ids of coordinate systems.
31 /// The intention of this design is to make it efficient for scene
32 /// delegates to communicate to renderer delegates the common
33 /// mappings of bound coordinate systems across groups of rprims.
34 ///
35 /// The transform value of an HdCoordSys is the matrix representation
36 /// of the transform from its local space to world space. In other
37 /// words, it has the same interpretation as the transform for rprims.
38 ///
39 class HdCoordSys : public HdSprim
40 {
41 public:
42  HD_API
43  HdCoordSys(SdfPath const & id);
44  HD_API
45  ~HdCoordSys() override;
46 
47  // Change tracking for HdCoordSys
49  Clean = 0,
50  DirtyName = 1 << 0,
51  DirtyTransform = 1 << 1,
53  |DirtyName)
54  };
55 
56  /// Returns the name bound to this coordinate system.
57  ///
58  /// There may be multiple coordinate systems with the same
59  /// name, but they must associate with disjoint sets of rprims.
60  TfToken GetName() const { return _name; }
61 
62  HD_API
63  void Sync(HdSceneDelegate *sceneDelegate,
64  HdRenderParam *renderParam,
65  HdDirtyBits *dirtyBits) override;
66 
67  HD_API
68  HdDirtyBits GetInitialDirtyBitsMask() const override;
69 
70 private:
71  TfToken _name;
72 };
73 
75 
76 #endif // PXR_IMAGING_HD_COORD_SYS_H
uint32_t HdDirtyBits
Definition: types.h:143
#define HD_API
Definition: api.h:23
HD_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Definition: token.h:70
HD_API HdDirtyBits GetInitialDirtyBitsMask() const override
Definition: path.h:273
HD_API HdCoordSys(SdfPath const &id)
Definition: sprim.h:34
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API ~HdCoordSys() override
TfToken GetName() const
Definition: coordSys.h:60