HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GDT_Position.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 Library. (Geo Delta)
7  *
8  * COMMENTS: A GDT_Position contains a full list of vectors that describe
9  * the changes to the gdp's point positions.
10  *
11  */
12 #ifndef __GDT_Position_h__
13 #define __GDT_Position_h__
14 
15 #include "GDT_API.h"
16 #include <UT/UT_BitArray.h>
17 #include <UT/UT_Vector4Array.h>
18 #include <GA/GA_Types.h>
19 
20 #include "GDT_Token.h"
21 
22 #include "GDT_CoordinateFrames.h"
23 #include "GDT_SymmetryTransform.h"
24 
25 class GA_PointGroup;
26 class GA_AIFEditDelta;
27 class GA_AIFEditSnapshot;
28 class GDT_TokenList;
29 
31 {
32 public:
33  GDT_Position();
34  GDT_Position(const GDT_Position &other);
35  virtual ~GDT_Position();
36 
37  virtual int64 getMemoryUsage(bool inclusive=false) const;
38 
39  virtual void applyDeltas(const GDT_TokenList &list,
40  GEO_Detail &gdp,
41  const GA_AIFEditDeltaMap &map,
42  bool inverse=false) const;
43  virtual void applyScaledDelta(GEO_Detail &gdp, GA_Offset pt,
45  const GA_AIFEditDeltaMap &map) const;
46  virtual void applyScaledDeltas(GEO_Detail &gdp,
47  fpreal64 scale,
48  const GA_PointGroup *ptgroup,
49  const GA_AIFEditDeltaMap &map) const;
50 
51  void mergePositionDeltas(const GDT_Position &other,
52  bool inverse = false);
53 
54  // Zero all the deltas non-destructively
55  virtual void zeroDeltas();
56 
57  // Begin/end a change to a point position
58  void beginPointPositionChange(const GA_Attribute *P,
59  GA_Offset element);
60  void beginPointPositionChange(const GA_Attribute *P,
61  const GA_Range &range);
62  void endPointPositionChange(
63  const GA_AIFEditDeltaMap &map);
64 
65  virtual unsigned int changed() const;
66 
67  // I/O Methods
68  virtual bool legacyLoad(UT_IStream &is,
69  unsigned int numtotal);
70 
71  virtual bool save(UT_JSONWriter &w,
72  const GDT_JSON &json) const;
73  virtual bool load(UT_JSONParser &p,
74  const GDT_JSON &json);
75 
76  void setCoordinateFrames(const GDT_CoordinateFrames *coords);
77 
78  void createSymmetryDeltas(const GDT_Position &input,
80  const GA_AIFEditDeltaMap &map);
81 
82 private:
83  GA_AIFEditDelta *myDelta;
84  GA_AIFEditSnapshot *mySnapshot;
85 
86  const GDT_CoordinateFrames *myCoordinateFrames;
87 };
88 
89 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:189
#define GDT_API
Definition: GDT_API.h:10
GLenum GLint * range
Definition: glcorearb.h:1924
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
virtual bool legacyLoad(UT_IStream &is, unsigned int numtotal)=0
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_Size GA_Offset
Definition: GA_Types.h:617
long long int64
Definition: SYS_Types.h:100
GA_API const UT_StringHolder scale
double fpreal64
Definition: SYS_Types.h:185
Base class for storing snapshots during an edit operation.
Definition: GA_AIFEdit.h:112
GA_API const UT_StringHolder transform
virtual void applyDeltas(const GDT_TokenList &list, GEO_Detail &gdp, const GA_AIFEditDeltaMap &map, bool inverse=false) const =0
Base class to store recorder data.
Definition: GA_AIFEdit.h:217
virtual bool load(UT_JSONParser &p, const GDT_JSON &json)=0
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
virtual bool save(UT_JSONWriter &w, const GDT_JSON &json) const =0
virtual int64 getMemoryUsage(bool inclusive=false) const =0
Class for mapping between an index and an attribute data offset.
Definition: GA_AIFEdit.h:48