HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  // Reset elements with deltas to the values from the source detail.
55  void resetElementsFromSource(GEO_Detail &gdp,
56  const GA_AIFEditDeltaMap &map,
57  const GEO_Detail &src_gdp,
58  const GA_AIFEditDeltaMap &src_map) const;
59 
60  // Apply stored deltas for elements also recordered in other to the
61  // given gdp.
62  void applyIntersectionDeltas(
63  const GDT_TokenList &token_list,
64  GEO_Detail &gdp,
65  const GA_AIFEditDeltaMap &map,
66  const GDT_Position &other) const;
67 
68  // Zero all the deltas non-destructively
69  virtual void zeroDeltas();
70 
71  // Begin/end a change to a point position
72  void beginPointPositionChange(const GA_Attribute *P,
73  GA_Offset element);
74  void beginPointPositionChange(const GA_Attribute *P,
75  const GA_Range &range);
76  void endPointPositionChange(
77  const GA_AIFEditDeltaMap &map);
78 
79  virtual unsigned int changed() const;
80 
81  // I/O Methods
82  virtual bool legacyLoad(UT_IStream &is,
83  unsigned int numtotal);
84 
85  virtual bool save(UT_JSONWriter &w,
86  const GDT_JSON &json) const;
87  virtual bool load(UT_JSONParser &p,
88  const GDT_JSON &json);
89 
90  void setCoordinateFrames(const GDT_CoordinateFrames *coords);
91 
92  void createSymmetryDeltas(const GDT_Position &input,
94  const GA_AIFEditDeltaMap &map);
95 
96 private:
97  GA_AIFEditDelta *myDelta;
98  GA_AIFEditSnapshot *mySnapshot;
99 
100  const GDT_CoordinateFrames *myCoordinateFrames;
101 };
102 
103 #endif
GLenum GLint * range
Definition: glew.h:3500
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
GLenum GLenum GLenum input
Definition: glew.h:13879
#define GDT_API
Definition: GDT_API.h:10
GLuint GLenum GLenum transform
Definition: glew.h:14742
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:13880
GLenum GLuint coords
Definition: glew.h:7906
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:75
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:637
long long int64
Definition: SYS_Types.h:111
double fpreal64
Definition: SYS_Types.h:196
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
Base class for storing snapshots during an edit operation.
Definition: GA_AIFEdit.h:112
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
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
Class for mapping between an index and an attribute data offset.
Definition: GA_AIFEdit.h:48