HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Blend.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_Blend.h (C++)
7  *
8  * COMMENTS: Functions for blending between details.
9  *
10  */
11 
12 
13  #ifndef __GU_BLEND_H__
14 #define __GU_BLEND_H__
15 
16 #include "GU_API.h"
17 #include <GA/GA_Names.h>
18 #include <GA/GA_Types.h>
19 
20 class UT_StringRef;
21 class GU_Detail;
22 class GA_Attribute;
23 class GA_Group;
24 class GA_Range;
25 
26 enum class GU_VoxelBlend
27 {
28  None,
30  ByVoxelPos,
31  Advected
32 };
33 
34 namespace GU_Blend
35 {
37 {
42 };
43 
45 {
47  bool myHasIdAttribMapping = false;
48  bool myIdAttribDataIdIsSame = false;
49 };
50 
51 /// This cache can be used to accelerate successive blends. However,
52 /// it is all references to *external* data.
53 /// It also does *NOT* detect if the id attribute names change, so the
54 /// caller is expected to clear the cache in that case.
56 {
57 public:
67 };
68 }
69 
70 /// If deleteUnmatched is true, points that don't have a match to interpolate with are deleted.
71 /// If deleteUnmatched is false but unmatchedGroupName is given (non-NULL), then these points
72 /// are instead put into a point group of the specified name.
73 /// Note that points of volume and VDB primitives are neither deleted nor put into the group.
74 GU_API void GUblend(
75  GU_Detail *dest, const GU_Detail *source, fpreal weight,
76  const char *pattern = "*", const UT_StringRef &ptidattr = GA_Names::id, const UT_StringRef &primidattr = GA_Names::name,
77  bool doslerp = true, bool usevforpinterp = false, float timestep = (1/24.0),
78  GU_VoxelBlend dovoxel = GU_VoxelBlend::None, GU_Blend::CachedItems *cached_items = NULL, const char *velname = "vel",
79  float advdt = 1, bool deleteUnmatched = false, const char *unmatchedGroupName = NULL);
80 
81 /// If deleteUnmatched is non-zero, points that have fewer than that many interpolation sources
82 /// are deleted from the output (or put into the specified group if unmatchedGroupName is not
83 /// NULL).
84 /// NOTE: Advected volume interpolation is necessarily linear; in that case, volweight is needed to determine
85 /// which detail to blend with and by how much.
86 GU_API void GUblend(
87  GU_Detail *dest, const GU_Detail *gdps[], const float *weights, int size, const GA_Group *group,
88  const char *pattern = "*", const UT_StringRef &ptidattr = GA_Names::id, const UT_StringRef &primidattr = GA_Names::name,
89  bool doslerp = true, GU_VoxelBlend dovoxel = GU_VoxelBlend::None, GU_Blend::CachedItems *cached_items = NULL,
90  bool is_differencing = true, bool dosparse = false,
91  float timestep = (1/24.0), const char *velname = "vel", float advdt = 1, fpreal volweight = 0,
92  int deleteUnmatched = 0, const char *unmatchedGroupName = NULL);
93 
94 /// Blend the attribute values for the given range, with an optional mapping to
95 /// different offsets in the second detail.
96 GU_API void GUblendRange(
97  GA_Attribute &attrib0,
98  const GA_Attribute &attrib1,
99  const GA_Range &range0,
100  float weight,
102 
103 #endif
UT_Array< GA_Offset > myArrayOfOffsets
Definition: GU_Blend.h:46
GLbyte * weights
Definition: glew.h:7551
Definition of a geometry attribute.
Definition: GA_Attribute.h:196
GLsizeiptr size
Definition: glew.h:1681
UT_Array< PerAttribData > * myVertexArrayOfPerAttribData
Definition: GU_Blend.h:60
UT_Array< PerMappingData > * myPtArrayOfPerMappingData
Definition: GU_Blend.h:61
GLenum GLenum GLenum GLenum mapping
Definition: glew.h:13879
GLuint GLuint GLfloat weight
Definition: glew.h:13609
UT_Array< PerAttribData > * myPtArrayOfPerAttribData
Definition: GU_Blend.h:58
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_API const UT_StringHolder name
UT_Array< UT_Array< int > > myArrayOfPageOffsets
Definition: GU_Blend.h:39
UT_Array< int64 > * myPrimListDataIds
Definition: GU_Blend.h:64
UT_Array< UT_Array< std::pair< GA_PageNum, exint > > > myArrayOfPageStarts
Definition: GU_Blend.h:40
UT_Array< PerAttribData > * myPrimArrayOfPerAttribData
Definition: GU_Blend.h:59
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
GA_API const UT_StringHolder id
GU_VoxelBlend
Definition: GU_Blend.h:26
UT_Array< int64 > * myPtTopoDataIds
Definition: GU_Blend.h:63
GU_API void GUblendRange(GA_Attribute &attrib0, const GA_Attribute &attrib1, const GA_Range &range0, float weight, const UT_Array< GA_Offset > *mapping)
int64 * myPtIdDataId
Definition: GU_Blend.h:65
UT_Array< int64 > myArrayOfDataId
Definition: GU_Blend.h:41
fpreal64 fpreal
Definition: SYS_Types.h:277
int64 * myPrimIdDataId
Definition: GU_Blend.h:66
GLubyte * pattern
Definition: glew.h:5711
UT_Array< UT_Array< float > > myArrayOfDeltas
Definition: GU_Blend.h:38
GU_API void GUblend(GU_Detail *dest, const GU_Detail *source, fpreal weight, const char *pattern="*", const UT_StringRef &ptidattr=GA_Names::id, const UT_StringRef &primidattr=GA_Names::name, bool doslerp=true, bool usevforpinterp=false, float timestep=(1/24.0), GU_VoxelBlend dovoxel=GU_VoxelBlend::None, GU_Blend::CachedItems *cached_items=NULL, const char *velname="vel", float advdt=1, bool deleteUnmatched=false, const char *unmatchedGroupName=NULL)
GLboolean GLuint group
Definition: glew.h:2745
UT_Array< PerMappingData > * myPrimArrayOfPerMappingData
Definition: GU_Blend.h:62