HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
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.
20
class
GU_API
GU_Interpolate
21
{
22
public
:
23
using
DetailList
=
UT_Array<GU_ConstDetailHandle>
;
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.
40
static
GU_ConstDetailHandle
lerp
(
const
GU_ConstDetailHandle
&g0,
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
lerp
virtual bool lerp(GA_AttributeOperand &d, GA_AttributeOperand &a, GA_AttributeOperand &b, GA_AttributeOperand &t) const
d = SYSlerp(a, b, t);
GU_Interpolate
Interpolate between multiple pieces of geometry.
Definition:
GU_Interpolate.h:20
UT_SmallArray.h
UT_Array< GU_ConstDetailHandle >
GU_ConstDetailHandle
Definition:
GU_DetailHandle.h:176
GU_API
#define GU_API
Definition:
GU_API.h:14
t
GLdouble t
Definition:
glad.h:2397
GU_DetailHandle.h
fpreal
fpreal64 fpreal
Definition:
SYS_Types.h:277
GU_Detail
Definition:
GU_Detail.h:154
GU_API.h
GU
GU_Interpolate.h
Generated on Tue Dec 17 2024 03:39:47 for HDK by
1.8.6