HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Promote.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_Promote.h ( GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_Promote__
12 #define __GU_Promote__
13 
14 #include "GU_API.h"
15 
16 #include <GA/GA_Types.h>
17 #include <GA/GA_Attribute.h>
18 #include <UT/UT_UniquePtr.h>
19 
20 class GU_Detail;
21 class GA_Attribute;
22 
23 /// Promote attributes from one owner to another
25 {
26 public:
28  {
29  GU_PROMOTE_MAX, // Choose maximum value of input
30  GU_PROMOTE_MIN, // Choose minimum value
31  GU_PROMOTE_MEAN, // Average values
32  GU_PROMOTE_MODE, // Mode (most common)
33  GU_PROMOTE_MEDIAN, // Choose median value
34  GU_PROMOTE_SUM, // Sum of values
35  GU_PROMOTE_SUMSQUARE, // Sum of the squares
36  GU_PROMOTE_RMS, // Root Mean Square
37  GU_PROMOTE_FIRST, // First
38  GU_PROMOTE_LAST, // Last
39  GU_PROMOTE_ARRAY, // All as an array attribute.
40  };
41 
42  /// Promote the given attribute to the new attribute class. The new
43  /// attribute is returned.
44  static GA_Attribute *promote(GU_Detail &gdp,
45  GA_Attribute *attrib,
46  GA_AttributeOwner new_owner,
47  bool destroy_existing = true,
48  PROMOTE_METHOD method = GU_PROMOTE_MEAN,
49  const char *new_name=NULL,
50  const GA_Attribute *piece_attrib = nullptr);
51 
52  /// Promote the given (tuple) attribute to the new attribute class into a
53  /// newly created detached attribute.
54  static GA_AttributeUPtr
55  create(GA_AttributeOwner dst_owner,
56  const GA_Attribute &src_attrib,
57  PROMOTE_METHOD method = GU_PROMOTE_MEAN);
58 
59 private:
60 };
61 
62 #endif
63 
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
#define GU_API
Definition: GU_API.h:14
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
Definition: GA_Attribute.h:930
GA_AttributeOwner
Definition: GA_Types.h:35
Promote attributes from one owner to another.
Definition: GU_Promote.h:24