HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flatNormals.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 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_FLAT_NORMALS_H
8 #define PXR_IMAGING_HD_FLAT_NORMALS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hd/api.h"
12 
13 #include "pxr/imaging/hd/types.h"
14 
15 #include "pxr/base/gf/vec3d.h"
16 #include "pxr/base/gf/vec3f.h"
17 
19 
20 
21 class HdMeshTopology;
22 
23 /// \class Hd_FlatNormals
24 ///
25 /// Hd_FlatNormals encapsulates mesh flat normals information.
26 /// It uses passed-in face index data and points data to compute
27 /// flat per-face normals. It does this by breaking each face into
28 /// a triangle fan centered at vertex 0, and averaging triangle normals.
29 ///
30 class Hd_FlatNormals final
31 {
32 public:
33  /// Computes the flat normals result using the supplied face coord
34  /// information and points data. Returns an array of the same size and
35  /// type as the source points, with optional packing.
36  HD_API
38  HdMeshTopology const * topology,
39  GfVec3f const * pointsPtr);
40  HD_API
42  HdMeshTopology const * topology,
43  GfVec3d const * pointsPtr);
44  HD_API
46  HdMeshTopology const * topology,
47  GfVec3f const * pointsPtr);
48  HD_API
50  HdMeshTopology const * topology,
51  GfVec3d const * pointsPtr);
52 
53 private:
54  Hd_FlatNormals() = delete;
55  ~Hd_FlatNormals() = delete;
56 };
57 
58 
60 
61 #endif // PXR_IMAGING_HD_FLAT_NORMALS_H
static HD_API VtArray< HdVec4f_2_10_10_10_REV > ComputeFlatNormalsPacked(HdMeshTopology const *topology, GfVec3f const *pointsPtr)
Definition: vec3f.h:45
#define HD_API
Definition: api.h:23
GT_API const UT_StringHolder topology
static HD_API VtArray< GfVec3f > ComputeFlatNormals(HdMeshTopology const *topology, GfVec3f const *pointsPtr)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
Definition: vec3d.h:45
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74