HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
points.h
Go to the documentation of this file.
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_POINTS_H
8 #define PXR_IMAGING_HD_POINTS_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/rprim.h"
14 
16 
17 /// \class HdPointsReprDesc
18 ///
19 /// Descriptor to configure a drawItem for a repr.
20 ///
22 {
26  {}
27 
28  bool IsEmpty() const {
30  }
31 
33 };
34 
35 /// Hydra Schema for a point cloud.
36 ///
37 class HdPoints: public HdRprim
38 {
39 public:
40  HD_API
41  ~HdPoints() override;
42 
43  inline HdDisplayStyle GetDisplayStyle(HdSceneDelegate* delegate) const;
44 
45  HD_API
46  TfTokenVector const & GetBuiltinPrimvarNames() const override;
47 
48  /// Configure geometric style of drawItems for \p reprName
49  HD_API
50  static void ConfigureRepr(TfToken const &reprName,
51  const HdPointsReprDesc &desc);
52 
53 protected:
54  /// Constructor. instancerId, if specified, is the instancer which uses
55  /// this point cloud as a prototype.
56  HD_API
57  HdPoints(SdfPath const& id);
58 
60 
61  HD_API
62  static _PointsReprConfig::DescArray _GetReprDesc(TfToken const &reprName);
63 
64 private:
65 
66  // Class can not be default constructed or copied.
67  HdPoints() = delete;
68  HdPoints(const HdPoints &) = delete;
69  HdPoints &operator =(const HdPoints &) = delete;
70 
71  static _PointsReprConfig _reprDescConfig;
72 };
73 
74 inline HdDisplayStyle
76 {
77  return delegate->GetDisplayStyle(GetId());
78 }
79 
80 
82 
83 #endif // PXR_IMAGING_HD_POINTS_H
HdPointsGeomStyle geomStyle
Definition: points.h:32
#define HD_API
Definition: api.h:23
HD_API TfTokenVector const & GetBuiltinPrimvarNames() const override
Definition: token.h:70
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id)
Returns the display style for the given prim.
Definition: rprim.h:37
static HD_API _PointsReprConfig::DescArray _GetReprDesc(TfToken const &reprName)
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
HdPointsReprDesc(HdPointsGeomStyle geomStyle=HdPointsGeomStyleInvalid)
Definition: points.h:23
Definition: path.h:273
HdPointsGeomStyle
Definition: enums.h:148
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
SdfPath const & GetId() const
Definition: rprim.h:146
std::array< DESC_TYPE, N > DescArray
Definition: rprim.h:304
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool IsEmpty() const
Definition: points.h:28
HdDisplayStyle GetDisplayStyle(HdSceneDelegate *delegate) const
Definition: points.h:75
static HD_API void ConfigureRepr(TfToken const &reprName, const HdPointsReprDesc &desc)
Configure geometric style of drawItems for reprName.
HD_API ~HdPoints() override