HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Measure.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_Measure.h ( GU Library, C++)
7  *
8  * COMMENTS: Compute some measurements on geometry.
9  */
10 
11 #ifndef __GU_Measure__
12 #define __GU_Measure__
13 
14 #include "GU_API.h"
15 #include <GA/GA_Handle.h>
16 #include <UT/UT_Vector3.h>
17 #include <SYS/SYS_Types.h>
18 
19 class GU_Detail;
20 class GA_PointGroup;
21 class GA_PrimitiveGroup;
22 
24 {
25 public:
27  {
30  CURVE_CONVEX
31  };
32 
33  //! Measure the perimeter of primitives
34  /// The perimeter of each primitive will be computed and stored in the
35  /// attribute handle passed in. The attribute handle MUST point to a
36  /// primitive attribute.
37  static void computePerimeter(
38  GU_Detail &gdp,
39  const GA_RWHandleF &perimeter,
40  const GA_PrimitiveGroup *group);
41 
42  //! Measure the area of primitives
43  /// The area of each primitive will be computed and stored in the
44  /// attribute handle passed in. The attribute handle MUST point to a
45  /// primitive attribute.
46  static void computeArea(
47  GU_Detail &gdp,
48  const GA_RWHandleF &area,
49  const GA_PrimitiveGroup *group);
50 
51  //! Measure the curvature of points
52  /// The curvature of each point will be computed and stored in the
53  /// attribute handle passed in. The normal attribute handle should point
54  /// to an attribute containing the normal for each point (which does not
55  /// have to be normalized). This is used in the curvature computations.
56  /// The curvature computed is an approximation which is more accurate for
57  /// polygon meshes. No special code is used to compute curvature on higher
58  /// order surfaces.
59  /// mode
60  static void computeCurvature(
61  GU_Detail &gdp,
62  const GA_RWHandleF &curvature,
63  const GA_ROHandleV3 &normal,
64  const GA_PointGroup *pgroup,
65  const CurvatureType type,
66  fpreal min,
67  fpreal max);
68 
69  static void computeVolume(
70  GU_Detail &gdp,
71  const UT_Vector3 &refpt,
72  const GA_RWHandleF &volume,
73  const GA_PrimitiveGroup *group);
74 };
75 
76 #endif
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GA_API const UT_StringHolder perimeter
#define GU_API
Definition: GU_API.h:14
fpreal64 fpreal
Definition: SYS_Types.h:277
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
type
Definition: core.h:1059
GA_API const UT_StringHolder area