HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
smoothNormals.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_SMOOTH_NORMALS_H
8 #define PXR_IMAGING_HD_SMOOTH_NORMALS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hd/api.h"
12 #include "pxr/imaging/hd/types.h"
13 
14 #include "pxr/base/gf/vec3d.h"
15 #include "pxr/base/gf/vec3f.h"
16 
18 
19 
20 class Hd_VertexAdjacency;
21 
22 /// \class Hd_SmoothNormals
23 ///
24 /// Hd_SmoothNormals encapsulates mesh smooth normals information.
25 /// It uses passed-in adjacency information and points data to compute
26 /// smooth per-vertex normals. It does this by averaging face normals of
27 /// faces surrounding a vertex.
28 ///
29 class Hd_SmoothNormals final
30 {
31 public:
32  /// Computes the smooth normals result using the supplied adjacency
33  /// information and points data. Returns an array of the same size and
34  /// type as the source points, with optional packing.
35  HD_API
37  Hd_VertexAdjacency const * adjacency,
38  int numPoints,
39  GfVec3f const * pointsPtr);
40  HD_API
42  Hd_VertexAdjacency const * adjacency,
43  int numPoints,
44  GfVec3d const * pointsPtr);
45  HD_API
47  Hd_VertexAdjacency const * adjacency,
48  int numPoints,
49  GfVec3f const * pointsPtr);
50  HD_API
52  Hd_VertexAdjacency const * adjacency,
53  int numPoints,
54  GfVec3d const * pointsPtr);
55 
56 private:
57  Hd_SmoothNormals() = delete;
58  ~Hd_SmoothNormals() = delete;
59 };
60 
61 
63 
64 #endif // PXR_IMAGING_HD_SMOOTH_NORMALS_H
Definition: vec3f.h:45
#define HD_API
Definition: api.h:23
static HD_API VtArray< GfVec3f > ComputeSmoothNormals(Hd_VertexAdjacency const *adjacency, int numPoints, GfVec3f const *pointsPtr)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static HD_API VtArray< HdVec4f_2_10_10_10_REV > ComputeSmoothNormalsPacked(Hd_VertexAdjacency const *adjacency, int numPoints, GfVec3f const *pointsPtr)
Definition: vec3d.h:45
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74