HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_AttributeSwap.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_AttributeSwap.h ( GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_AttributeSwap__
12 #define __GU_AttributeSwap__
13 
14 #include "GU_API.h"
15 #include <GA/GA_Types.h>
16 
17 class GU_Detail;
18 class UT_StringRef;
19 
20 
22 {
23 public:
24  /// Operation to perform.
25  /// Move will remove the source. Note the point attribute P cannot
26  /// be moved so it will be instead silently copied.
27  /// Swap exchanges the pair. If destination is missing, it is copied.
29  {
33  NUM_METHODS
34  };
35 
36  /// What to do about typeinfos. When stashing attributes one often
37  /// wants to clear the transform type so succeeding deformers don't
38  /// also change your stashed values, this becomes the preserve-dest.
39  /// OTOH, when duplicating, you want the copy to have the source typeinfo.
40  /// This is ignored for swapping.
41  enum TypeInfo
42  {
45  NUM_TYPEINFOS
46  };
47 
48  /// Does the method to the two named attributes. If swapping a missing
49  /// attribute, will first create it.
50  /// source attribute is assumed to exist.
51  /// Returns false if failed for some reason; note there are special
52  /// rules about how P can change.
53  /// You must invoke gdp->refreshCachedAttributes() if there is a risk
54  /// you changed the P attribute!
55  static bool swapAttribute(GU_Detail *gdp, SwapMethod method, TypeInfo typeinfo, GA_AttributeOwner owner, const UT_StringRef &srcname, const UT_StringRef &dstname);
56 };
57 
58 #endif
59 
#define GU_API
Definition: GU_API.h:14
GA_AttributeOwner
Definition: GA_Types.h:35