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 <GA/GA_Handle.h>
19 #include <UT/UT_UniquePtr.h>
20 
21 class GU_Detail;
22 class GA_Attribute;
23 
24 /// Promote attributes from one owner to another
26 {
27 public:
29  {
30  GU_PROMOTE_MAX, // Choose maximum value of input
31  GU_PROMOTE_MIN, // Choose minimum value
32  GU_PROMOTE_MEAN, // Average values
33  GU_PROMOTE_MODE, // Mode (most common)
34  GU_PROMOTE_MEDIAN, // Choose median value
35  GU_PROMOTE_SUM, // Sum of values
36  GU_PROMOTE_SUMSQUARE, // Sum of the squares
37  GU_PROMOTE_RMS, // Root Mean Square
38  GU_PROMOTE_FIRST, // First
39  GU_PROMOTE_LAST, // Last
40  GU_PROMOTE_ARRAY, // All as an array attribute.
41  GU_PROMOTE_UNIQUE // Array of all unique values (set)
42  };
43 
44  /// Promote the given attribute to the new attribute class. The new
45  /// attribute is returned.
46  static GA_Attribute *promote(GU_Detail &gdp,
47  GA_Attribute *attrib,
48  GA_AttributeOwner new_owner,
49  bool destroy_existing = true,
50  PROMOTE_METHOD method = GU_PROMOTE_MEAN,
51  const char *new_name=NULL,
52  const GA_Attribute *piece_attrib = nullptr,
53  GA_Attribute *index_attrib = nullptr);
54 
55  /// Promote the given (tuple) attribute to the new attribute class into a
56  /// newly created detached attribute.
57  static GA_AttributeUPtr
58  create(GA_AttributeOwner dst_owner,
59  const GA_Attribute &src_attrib,
60  PROMOTE_METHOD method = GU_PROMOTE_MEAN);
61 
62 private:
63 };
64 
65 #endif
66 
Definition of a geometry attribute.
Definition: GA_Attribute.h:203
#define GU_API
Definition: GU_API.h:14
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
Definition: GA_Attribute.h:995
GA_AttributeOwner
Definition: GA_Types.h:35
Promote attributes from one owner to another.
Definition: GU_Promote.h:25