HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GDT_CaptureWeight.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: GDT_CaptureWeight.h (Geo Delta Library)
7  *
8  * COMMENTS: This contains a full list of vectors that describe the changes
9  * to the gdp's point capture weight attributes.
10  *
11  */
12 
13 #ifndef __GDT_CaptureWeight_h__
14 #define __GDT_CaptureWeight_h__
15 
16 #include "GDT_API.h"
17 #include <UT/UT_IntArray.h>
18 #include <UT/UT_ValArray.h>
19 #include <UT/UT_VectorTypes.h>
20 #include <GA/GA_Types.h>
21 
22 #include "GDT_Token.h"
23 
24 class GA_AIFEditDelta;
25 class GA_AIFEditSnapshot;
26 class GA_Attribute;
27 class GEO_Detail;
28 class GDT_TokenList;
29 class GU_DetailHandle;
30 
31 typedef int (*GDT_CaptureRegionCB)( void *user_data,
32  char *cregion,
33  UT_Matrix4 &parent_xform,
34  GU_DetailHandle &tube_gdp );
35 
36 
38 {
39 public:
41  ~GDT_CaptureWeight() override;
42 
43  GDT_CaptureWeight( const GDT_CaptureWeight &other );
44 
45  int64 getMemoryUsage(bool inclusive) const override;
46 
47  void getOpPaths( UT_StringList &paths );
48  void getOpPathsCopy( UT_ValArray<char *> &paths );
49  void setOpPaths( const UT_ValArray<char *> &paths );
50  int changeOpPaths( const char *old_name,
51  const char *new_name );
52  void changeCaptureRegionRoot( const char *old_root,
53  const char *new_root );
54  void refreshCaptureFrameInfo(
55  const GEO_Detail &gdp,
56  GDT_CaptureRegionCB get_region,
57  void *user_data );
58 
59  void applyDeltas( const GDT_TokenList &token_list,
60  GEO_Detail &gdp,
61  const GA_AIFEditDeltaMap &map,
62  bool inverse=false ) const override;
63  virtual void applyScaledDelta(GEO_Detail &gdp, GA_Offset pt,
64  fpreal scale,
65  const GA_AIFEditDeltaMap &map) const;
66 
67  void mergeCaptureWeightDeltas(
68  const GDT_CaptureWeight &other,
69  bool inverse = false );
70 
71  // Reset elements with deltas to the values from the source detail.
72  void resetElementsFromSource(GEO_Detail &gdp,
73  const GA_AIFEditDeltaMap &map,
74  const GEO_Detail &src_gdp,
75  const GA_AIFEditDeltaMap &src_map) const;
76 
77  // Apply stored deltas for elements also recordered in other to the
78  // given gdp.
79  void applyIntersectionDeltas(
80  const GDT_TokenList &token_list,
81  GEO_Detail &gdp,
82  const GA_AIFEditDeltaMap &map,
83  const GDT_CaptureWeight &other) const;
84 
85  virtual void zeroDeltas();
86 
87  // Begin/end a change to a point capture weight
88  void beginCaptureWeightChange( const GA_Attribute *capt,
89  GA_Offset element );
90  void endCaptureWeightChange(
91  const GA_AIFEditDeltaMap &map);
92 
93  virtual unsigned int changed() const;
94 
95  // I/O Methods
96  bool legacyLoad(UT_IStream &is,
97  unsigned int numtotal) override;
98 
99  bool save(UT_JSONWriter &w,
100  const GDT_JSON &jsn) const override;
101  bool load(UT_JSONParser &p,
102  const GDT_JSON &jsn) override;
103 
104 private: // methods
105  void destroy();
106 
107 private: // data
108  GA_AIFEditDelta *myDelta;
109  GA_AIFEditSnapshot *mySnapshot;
110 };
111 
112 #endif // __GDT_CaptureWeight_h__
Definition of a geometry attribute.
Definition: GA_Attribute.h:196
#define GDT_API
Definition: GDT_API.h:10
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:13880
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:76
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:34
virtual bool legacyLoad(UT_IStream &is, unsigned int numtotal)=0
GA_Size GA_Offset
Definition: GA_Types.h:639
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
long long int64
Definition: SYS_Types.h:116
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
Base class for storing snapshots during an edit operation.
Definition: GA_AIFEdit.h:112
int(* GDT_CaptureRegionCB)(void *user_data, char *cregion, UT_Matrix4 &parent_xform, GU_DetailHandle &tube_gdp)
GLfloat GLfloat p
Definition: glew.h:16321
virtual void applyDeltas(const GDT_TokenList &list, GEO_Detail &gdp, const GA_AIFEditDeltaMap &map, bool inverse=false) const =0
fpreal64 fpreal
Definition: SYS_Types.h:277
Base class to store recorder data.
Definition: GA_AIFEdit.h:217
virtual bool load(UT_JSONParser &p, const GDT_JSON &json)=0
virtual bool save(UT_JSONWriter &w, const GDT_JSON &json) const =0
virtual int64 getMemoryUsage(bool inclusive=false) const =0
GLenum const void * paths
Definition: glew.h:13589
Class for mapping between an index and an attribute data offset.
Definition: GA_AIFEdit.h:48