HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_Interpolate.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_Interpolate.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_Interpolate__
12 #define __GU_Interpolate__
13 
14 #include "GU_API.h"
15 
16 #include "GU_DetailHandle.h"
17 #include <UT/UT_SmallArray.h>
18 
19 /// Interpolate between multiple pieces of geometry.
21 {
22 public:
24 
25  /// Linear interpolate between two pieces of geometry. @c t should be
26  /// between 0 and 1.
27  ///
28  /// This method assumes the topology matches. Attributes don't have to
29  /// match, but the primitive types and topology do.
30  static GU_ConstDetailHandle fastLerp(const GU_ConstDetailHandle &g0,
31  const GU_ConstDetailHandle &g1,
32  fpreal t);
33 
34  /// Linear interpolate between two pieces of geometry. @c t should be
35  /// between 0 and 1.
36  ///
37  /// This method verifies the topology of the two details matches before
38  /// performing interpolation. If the topology doesn't match, the method
39  /// returns the geometry with the largest contribution.
41  const GU_ConstDetailHandle &g1,
42  fpreal t);
43 
44 
45  /// Perform a weighted sum of the geometry. @c sum(weights) should be 1.
46  ///
47  /// This method verifies the topology of the geometry matches before
48  /// performing interpolation. All geometry which matches topology with the
49  /// input with the largest weight will be considered. Any geometry which
50  /// doesn't match will have its weight distributed amongst the other
51  /// geometry.
52  static GU_ConstDetailHandle interpolate(const DetailList &geo,
53  const fpreal *weights);
54 
55  /// Perform a weighted sum of the geometry. @c sum(weights) should be 1.
56  ///
57  /// This method assumes topology on all the geometry matches. Attributes
58  /// don't have to match, but the primitive types and topology do.
59  static GU_ConstDetailHandle fastInterpolate(
60  const DetailList &geo,
61  const fpreal *weights);
62 
63  /// @{
64  /// Check to see whether geometry matches topology and can be interpolated.
65  /// This doesn't verify that the attributes for geometries match, only the
66  /// topology.
67  static bool matchTopology(const GU_ConstDetailHandle &g0,
68  const GU_ConstDetailHandle &g1);
69  static bool matchTopology(const GU_Detail &g0, const GU_Detail &g1);
70  /// @}
71 private:
72 };
73 
74 #endif
75 
virtual bool lerp(GA_AttributeOperand &d, GA_AttributeOperand &a, GA_AttributeOperand &b, GA_AttributeOperand &t) const
d = SYSlerp(a, b, t);
Interpolate between multiple pieces of geometry.
#define GU_API
Definition: GU_API.h:11
double fpreal
Definition: SYS_Types.h:269