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_Group;
23 
24 enum class GU_VoxelBlend
25 {
26  None,
28  ByVoxelPos,
29  Advected
30 };
31 
32 namespace GU_Blend
33 {
35 {
40 };
41 
43 {
45  bool myHasIdAttribMapping = false;
46  bool myIdAttribDataIdIsSame = false;
47 };
48 
49 /// This cache can be used to accelerate successive blends. However,
50 /// it is all references to *external* data.
51 /// It also does *NOT* detect if the id attribute names change, so the
52 /// caller is expected to clear the cache in that case.
54 {
55 public:
65 };
66 }
67 
68 /// If deleteUnmatched is true, points that don't have a match to interpolate with are deleted.
69 /// If deleteUnmatched is false but unmatchedGroupName is given (non-NULL), then these points
70 /// are instead put into a point group of the specified name.
71 /// Note that points of volume and VDB primitives are neither deleted nor put into the group.
72 GU_API void GUblend(
73  GU_Detail *dest, const GU_Detail *source, fpreal weight,
74  const char *pattern = "*", const UT_StringRef &ptidattr = GA_Names::id, const UT_StringRef &primidattr = GA_Names::name,
75  bool doslerp = true, bool usevforpinterp = false, float timestep = (1/24.0),
76  GU_VoxelBlend dovoxel = GU_VoxelBlend::None, GU_Blend::CachedItems *cached_items = NULL, const char *velname = "vel",
77  float advdt = 1, bool deleteUnmatched = false, const char *unmatchedGroupName = NULL);
78 
79 /// If deleteUnmatched is non-zero, points that have fewer than that many interpolation sources
80 /// are deleted from the output (or put into the specified group if unmatchedGroupName is not
81 /// NULL).
82 /// NOTE: Advected volume interpolation is necessarily linear; in that case, volweight is needed to determine
83 /// which detail to blend with and by how much.
84 GU_API void GUblend(
85  GU_Detail *dest, const GU_Detail *gdps[], const float *weights, int size, const GA_Group *group,
86  const char *pattern = "*", const UT_StringRef &ptidattr = GA_Names::id, const UT_StringRef &primidattr = GA_Names::name,
87  bool doslerp = true, GU_VoxelBlend dovoxel = GU_VoxelBlend::None, GU_Blend::CachedItems *cached_items = NULL,
88  bool is_differencing = true, bool dosparse = false,
89  float timestep = (1/24.0), const char *velname = "vel", float advdt = 1, fpreal volweight = 0,
90  int deleteUnmatched = 0, const char *unmatchedGroupName = NULL);
91 
92 #endif
UT_Array< GA_Offset > myArrayOfOffsets
Definition: GU_Blend.h:44
GLbyte * weights
Definition: glew.h:7551
GLsizeiptr size
Definition: glew.h:1681
UT_Array< PerAttribData > * myVertexArrayOfPerAttribData
Definition: GU_Blend.h:58
UT_Array< PerMappingData > * myPtArrayOfPerMappingData
Definition: GU_Blend.h:59
GLuint GLuint GLfloat weight
Definition: glew.h:13609
UT_Array< PerAttribData > * myPtArrayOfPerAttribData
Definition: GU_Blend.h:56
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
GA_API const UT_StringHolder name
long long int64
Definition: SYS_Types.h:111
UT_Array< UT_Array< int > > myArrayOfPageOffsets
Definition: GU_Blend.h:37
UT_Array< int64 > * myPrimListDataIds
Definition: GU_Blend.h:62
UT_Array< UT_Array< std::pair< GA_PageNum, exint > > > myArrayOfPageStarts
Definition: GU_Blend.h:38
UT_Array< PerAttribData > * myPrimArrayOfPerAttribData
Definition: GU_Blend.h:57
#define GU_API
Definition: GU_API.h:14
GA_API const UT_StringHolder id
GU_VoxelBlend
Definition: GU_Blend.h:24
UT_Array< int64 > * myPtTopoDataIds
Definition: GU_Blend.h:61
double fpreal
Definition: SYS_Types.h:276
int64 * myPtIdDataId
Definition: GU_Blend.h:63
UT_Array< int64 > myArrayOfDataId
Definition: GU_Blend.h:39
int64 * myPrimIdDataId
Definition: GU_Blend.h:64
GLubyte * pattern
Definition: glew.h:5711
UT_Array< UT_Array< float > > myArrayOfDeltas
Definition: GU_Blend.h:36
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:60